Revision: 17275
Author:   [email protected]
Date:     Fri Oct 18 14:55:21 2013 UTC
Log:      Make stack_parameter_count a plain register.

[email protected], [email protected]

Review URL: https://codereview.chromium.org/28993003
http://code.google.com/p/v8/source/detail?r=17275

Modified:
 /branches/bleeding_edge/src/arm/code-stubs-arm.cc
 /branches/bleeding_edge/src/arm/deoptimizer-arm.cc
 /branches/bleeding_edge/src/code-stubs-hydrogen.cc
 /branches/bleeding_edge/src/code-stubs.cc
 /branches/bleeding_edge/src/code-stubs.h
 /branches/bleeding_edge/src/deoptimizer.cc
 /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc
 /branches/bleeding_edge/src/ia32/deoptimizer-ia32.cc
 /branches/bleeding_edge/src/mips/code-stubs-mips.cc
 /branches/bleeding_edge/src/mips/deoptimizer-mips.cc
 /branches/bleeding_edge/src/x64/code-stubs-x64.cc
 /branches/bleeding_edge/src/x64/deoptimizer-x64.cc

=======================================
--- /branches/bleeding_edge/src/arm/code-stubs-arm.cc Fri Oct 4 08:17:11 2013 UTC +++ /branches/bleeding_edge/src/arm/code-stubs-arm.cc Fri Oct 18 14:55:21 2013 UTC
@@ -192,7 +192,7 @@
   descriptor->register_param_count_ = 2;
   if (constant_stack_parameter_count != 0) {
     // stack param count needs (constructor pointer, and single argument)
-    descriptor->stack_parameter_count_ = &r0;
+    descriptor->stack_parameter_count_ = r0;
   }
   descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
   descriptor->register_params_ = registers;
@@ -214,7 +214,7 @@

   if (constant_stack_parameter_count != 0) {
     // stack param count needs (constructor pointer, and single argument)
-    descriptor->stack_parameter_count_ = &r0;
+    descriptor->stack_parameter_count_ = r0;
   }
   descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
   descriptor->register_params_ = registers;
=======================================
--- /branches/bleeding_edge/src/arm/deoptimizer-arm.cc Mon Sep 23 15:01:33 2013 UTC +++ /branches/bleeding_edge/src/arm/deoptimizer-arm.cc Fri Oct 18 14:55:21 2013 UTC
@@ -107,10 +107,7 @@
   ApiFunction function(descriptor->deoptimization_handler_);
ExternalReference xref(&function, ExternalReference::BUILTIN_CALL, isolate_);
   intptr_t handler = reinterpret_cast<intptr_t>(xref.address());
-  int params = descriptor->register_param_count_;
-  if (descriptor->stack_parameter_count_ != NULL) {
-    params++;
-  }
+  int params = descriptor->environment_length();
   output_frame->SetRegister(r0.code(), params);
   output_frame->SetRegister(r1.code(), handler);
 }
=======================================
--- /branches/bleeding_edge/src/code-stubs-hydrogen.cc Mon Oct 14 09:22:34 2013 UTC +++ /branches/bleeding_edge/src/code-stubs-hydrogen.cc Fri Oct 18 14:55:21 2013 UTC
@@ -162,7 +162,7 @@
   }

   HInstruction* stack_parameter_count;
-  if (descriptor_->stack_parameter_count_ != NULL) {
+  if (descriptor_->stack_parameter_count_.is_valid()) {
     ASSERT(descriptor_->environment_length() == (param_count + 1));
     stack_parameter_count = New<HParameter>(param_count,
                                             HParameter::REGISTER_PARAMETER,
@@ -298,7 +298,7 @@
   // the runtime that is significantly faster than using the standard
   // stub-failure deopt mechanism.
   if (stub->IsUninitialized() && descriptor->has_miss_handler()) {
-    ASSERT(descriptor->stack_parameter_count_ == NULL);
+    ASSERT(!descriptor->stack_parameter_count_.is_valid());
     return stub->GenerateLightweightMissCode(isolate);
   }
   ElapsedTimer timer;
=======================================
--- /branches/bleeding_edge/src/code-stubs.cc   Tue Oct 15 16:12:25 2013 UTC
+++ /branches/bleeding_edge/src/code-stubs.cc   Fri Oct 18 14:55:21 2013 UTC
@@ -41,7 +41,7 @@

 CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor()
     : register_param_count_(-1),
-      stack_parameter_count_(NULL),
+      stack_parameter_count_(no_reg),
       hint_stack_parameter_count_(-1),
       function_mode_(NOT_JS_FUNCTION_STUB_MODE),
       register_params_(NULL),
=======================================
--- /branches/bleeding_edge/src/code-stubs.h    Thu Oct 10 08:45:40 2013 UTC
+++ /branches/bleeding_edge/src/code-stubs.h    Fri Oct 18 14:55:21 2013 UTC
@@ -30,8 +30,9 @@

 #include "allocation.h"
 #include "assembler.h"
+#include "codegen.h"
 #include "globals.h"
-#include "codegen.h"
+#include "macro-assembler.h"

 namespace v8 {
 namespace internal {
@@ -280,7 +281,7 @@
 struct CodeStubInterfaceDescriptor {
   CodeStubInterfaceDescriptor();
   int register_param_count_;
-  const Register* stack_parameter_count_;
+  Register stack_parameter_count_;
   // if hint_stack_parameter_count_ > 0, the code stub can optimize the
   // return sequence. Default value is -1, which means it is ignored.
   int hint_stack_parameter_count_;
@@ -289,7 +290,7 @@
   Address deoptimization_handler_;

   int environment_length() const {
-    if (stack_parameter_count_ != NULL) {
+    if (stack_parameter_count_.is_valid()) {
       return register_param_count_ + 1;
     }
     return register_param_count_;
@@ -320,7 +321,7 @@
 // defined outside of the platform directories
 #define DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index) \
   ((index) == (descriptor)->register_param_count_)           \
-      ? *((descriptor)->stack_parameter_count_)              \
+      ? (descriptor)->stack_parameter_count_                 \
       : (descriptor)->register_params_[(index)]


=======================================
--- /branches/bleeding_edge/src/deoptimizer.cc  Wed Oct 16 03:30:06 2013 UTC
+++ /branches/bleeding_edge/src/deoptimizer.cc  Fri Oct 18 14:55:21 2013 UTC
@@ -1494,7 +1494,7 @@
   }

   intptr_t caller_arg_count = 0;
-  bool arg_count_known = descriptor->stack_parameter_count_ == NULL;
+  bool arg_count_known = !descriptor->stack_parameter_count_.is_valid();

// Build the Arguments object for the caller's parameters and a pointer to it.
   output_frame_offset -= kPointerSize;
=======================================
--- /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Fri Oct 18 10:54:45 2013 UTC +++ /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Fri Oct 18 14:55:21 2013 UTC
@@ -172,7 +172,7 @@

   if (constant_stack_parameter_count != 0) {
     // stack param count needs (constructor pointer, and single argument)
-    descriptor->stack_parameter_count_ = &eax;
+    descriptor->stack_parameter_count_ = eax;
   }
   descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
   descriptor->register_params_ = registers;
@@ -194,7 +194,7 @@

   if (constant_stack_parameter_count != 0) {
     // stack param count needs (constructor pointer, and single argument)
-    descriptor->stack_parameter_count_ = &eax;
+    descriptor->stack_parameter_count_ = eax;
   }
   descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
   descriptor->register_params_ = registers;
=======================================
--- /branches/bleeding_edge/src/ia32/deoptimizer-ia32.cc Fri Oct 18 10:54:45 2013 UTC +++ /branches/bleeding_edge/src/ia32/deoptimizer-ia32.cc Fri Oct 18 14:55:21 2013 UTC
@@ -202,10 +202,7 @@
FrameDescription* output_frame, CodeStubInterfaceDescriptor* descriptor) {
   intptr_t handler =
       reinterpret_cast<intptr_t>(descriptor->deoptimization_handler_);
-  int params = descriptor->register_param_count_;
-  if (descriptor->stack_parameter_count_ != NULL) {
-    params++;
-  }
+  int params = descriptor->environment_length();
   output_frame->SetRegister(eax.code(), params);
   output_frame->SetRegister(ebx.code(), handler);
 }
=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Fri Oct 4 12:31:57 2013 UTC +++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Fri Oct 18 14:55:21 2013 UTC
@@ -181,7 +181,7 @@
   descriptor->register_param_count_ = 2;
   if (constant_stack_parameter_count != 0) {
     // stack param count needs (constructor pointer, and single argument)
-    descriptor->stack_parameter_count_ = &a0;
+    descriptor->stack_parameter_count_ = a0;
   }
   descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
   descriptor->register_params_ = registers;
@@ -203,7 +203,7 @@

   if (constant_stack_parameter_count != 0) {
     // Stack param count needs (constructor pointer, and single argument).
-    descriptor->stack_parameter_count_ = &a0;
+    descriptor->stack_parameter_count_ = a0;
   }
   descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
   descriptor->register_params_ = registers;
=======================================
--- /branches/bleeding_edge/src/mips/deoptimizer-mips.cc Thu Sep 19 09:08:08 2013 UTC +++ /branches/bleeding_edge/src/mips/deoptimizer-mips.cc Fri Oct 18 14:55:21 2013 UTC
@@ -104,10 +104,7 @@
   ApiFunction function(descriptor->deoptimization_handler_);
ExternalReference xref(&function, ExternalReference::BUILTIN_CALL, isolate_);
   intptr_t handler = reinterpret_cast<intptr_t>(xref.address());
-  int params = descriptor->register_param_count_;
-  if (descriptor->stack_parameter_count_ != NULL) {
-    params++;
-  }
+  int params = descriptor->environment_length();
   output_frame->SetRegister(s0.code(), params);
   output_frame->SetRegister(s1.code(), (params - 1) * kPointerSize);
   output_frame->SetRegister(s2.code(), handler);
=======================================
--- /branches/bleeding_edge/src/x64/code-stubs-x64.cc Mon Oct 14 12:41:28 2013 UTC +++ /branches/bleeding_edge/src/x64/code-stubs-x64.cc Fri Oct 18 14:55:21 2013 UTC
@@ -179,7 +179,7 @@
   descriptor->register_param_count_ = 2;
   if (constant_stack_parameter_count != 0) {
     // stack param count needs (constructor pointer, and single argument)
-    descriptor->stack_parameter_count_ = &rax;
+    descriptor->stack_parameter_count_ = rax;
   }
   descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
   descriptor->register_params_ = registers;
@@ -201,7 +201,7 @@

   if (constant_stack_parameter_count != 0) {
     // stack param count needs (constructor pointer, and single argument)
-    descriptor->stack_parameter_count_ = &rax;
+    descriptor->stack_parameter_count_ = rax;
   }
   descriptor->hint_stack_parameter_count_ = constant_stack_parameter_count;
   descriptor->register_params_ = registers;
=======================================
--- /branches/bleeding_edge/src/x64/deoptimizer-x64.cc Thu Sep 19 09:08:08 2013 UTC +++ /branches/bleeding_edge/src/x64/deoptimizer-x64.cc Fri Oct 18 14:55:21 2013 UTC
@@ -106,10 +106,7 @@
FrameDescription* output_frame, CodeStubInterfaceDescriptor* descriptor) {
   intptr_t handler =
       reinterpret_cast<intptr_t>(descriptor->deoptimization_handler_);
-  int params = descriptor->register_param_count_;
-  if (descriptor->stack_parameter_count_ != NULL) {
-    params++;
-  }
+  int params = descriptor->environment_length();
   output_frame->SetRegister(rax.code(), params);
   output_frame->SetRegister(rbx.code(), handler);
 }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to