Make stack_parameter_count a plain register.
R=rossberg@chromium.org, danno@chromium.org Review URL: https://codereview.chromium.org/28993003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17275 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
4d0f2cdd3b
commit
701417f955
@ -192,7 +192,7 @@ static void InitializeArrayConstructorDescriptor(
|
|||||||
descriptor->register_param_count_ = 2;
|
descriptor->register_param_count_ = 2;
|
||||||
if (constant_stack_parameter_count != 0) {
|
if (constant_stack_parameter_count != 0) {
|
||||||
// stack param count needs (constructor pointer, and single argument)
|
// 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->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
||||||
descriptor->register_params_ = registers;
|
descriptor->register_params_ = registers;
|
||||||
@ -214,7 +214,7 @@ static void InitializeInternalArrayConstructorDescriptor(
|
|||||||
|
|
||||||
if (constant_stack_parameter_count != 0) {
|
if (constant_stack_parameter_count != 0) {
|
||||||
// stack param count needs (constructor pointer, and single argument)
|
// 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->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
||||||
descriptor->register_params_ = registers;
|
descriptor->register_params_ = registers;
|
||||||
|
@ -107,10 +107,7 @@ void Deoptimizer::SetPlatformCompiledStubRegisters(
|
|||||||
ApiFunction function(descriptor->deoptimization_handler_);
|
ApiFunction function(descriptor->deoptimization_handler_);
|
||||||
ExternalReference xref(&function, ExternalReference::BUILTIN_CALL, isolate_);
|
ExternalReference xref(&function, ExternalReference::BUILTIN_CALL, isolate_);
|
||||||
intptr_t handler = reinterpret_cast<intptr_t>(xref.address());
|
intptr_t handler = reinterpret_cast<intptr_t>(xref.address());
|
||||||
int params = descriptor->register_param_count_;
|
int params = descriptor->environment_length();
|
||||||
if (descriptor->stack_parameter_count_ != NULL) {
|
|
||||||
params++;
|
|
||||||
}
|
|
||||||
output_frame->SetRegister(r0.code(), params);
|
output_frame->SetRegister(r0.code(), params);
|
||||||
output_frame->SetRegister(r1.code(), handler);
|
output_frame->SetRegister(r1.code(), handler);
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HInstruction* stack_parameter_count;
|
HInstruction* stack_parameter_count;
|
||||||
if (descriptor_->stack_parameter_count_ != NULL) {
|
if (descriptor_->stack_parameter_count_.is_valid()) {
|
||||||
ASSERT(descriptor_->environment_length() == (param_count + 1));
|
ASSERT(descriptor_->environment_length() == (param_count + 1));
|
||||||
stack_parameter_count = New<HParameter>(param_count,
|
stack_parameter_count = New<HParameter>(param_count,
|
||||||
HParameter::REGISTER_PARAMETER,
|
HParameter::REGISTER_PARAMETER,
|
||||||
@ -298,7 +298,7 @@ static Handle<Code> DoGenerateCode(Isolate* isolate, Stub* stub) {
|
|||||||
// the runtime that is significantly faster than using the standard
|
// the runtime that is significantly faster than using the standard
|
||||||
// stub-failure deopt mechanism.
|
// stub-failure deopt mechanism.
|
||||||
if (stub->IsUninitialized() && descriptor->has_miss_handler()) {
|
if (stub->IsUninitialized() && descriptor->has_miss_handler()) {
|
||||||
ASSERT(descriptor->stack_parameter_count_ == NULL);
|
ASSERT(!descriptor->stack_parameter_count_.is_valid());
|
||||||
return stub->GenerateLightweightMissCode(isolate);
|
return stub->GenerateLightweightMissCode(isolate);
|
||||||
}
|
}
|
||||||
ElapsedTimer timer;
|
ElapsedTimer timer;
|
||||||
|
@ -41,7 +41,7 @@ namespace internal {
|
|||||||
|
|
||||||
CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor()
|
CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor()
|
||||||
: register_param_count_(-1),
|
: register_param_count_(-1),
|
||||||
stack_parameter_count_(NULL),
|
stack_parameter_count_(no_reg),
|
||||||
hint_stack_parameter_count_(-1),
|
hint_stack_parameter_count_(-1),
|
||||||
function_mode_(NOT_JS_FUNCTION_STUB_MODE),
|
function_mode_(NOT_JS_FUNCTION_STUB_MODE),
|
||||||
register_params_(NULL),
|
register_params_(NULL),
|
||||||
|
@ -30,8 +30,9 @@
|
|||||||
|
|
||||||
#include "allocation.h"
|
#include "allocation.h"
|
||||||
#include "assembler.h"
|
#include "assembler.h"
|
||||||
#include "globals.h"
|
|
||||||
#include "codegen.h"
|
#include "codegen.h"
|
||||||
|
#include "globals.h"
|
||||||
|
#include "macro-assembler.h"
|
||||||
|
|
||||||
namespace v8 {
|
namespace v8 {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
@ -280,7 +281,7 @@ enum StubFunctionMode { NOT_JS_FUNCTION_STUB_MODE, JS_FUNCTION_STUB_MODE };
|
|||||||
struct CodeStubInterfaceDescriptor {
|
struct CodeStubInterfaceDescriptor {
|
||||||
CodeStubInterfaceDescriptor();
|
CodeStubInterfaceDescriptor();
|
||||||
int register_param_count_;
|
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
|
// if hint_stack_parameter_count_ > 0, the code stub can optimize the
|
||||||
// return sequence. Default value is -1, which means it is ignored.
|
// return sequence. Default value is -1, which means it is ignored.
|
||||||
int hint_stack_parameter_count_;
|
int hint_stack_parameter_count_;
|
||||||
@ -289,7 +290,7 @@ struct CodeStubInterfaceDescriptor {
|
|||||||
Address deoptimization_handler_;
|
Address deoptimization_handler_;
|
||||||
|
|
||||||
int environment_length() const {
|
int environment_length() const {
|
||||||
if (stack_parameter_count_ != NULL) {
|
if (stack_parameter_count_.is_valid()) {
|
||||||
return register_param_count_ + 1;
|
return register_param_count_ + 1;
|
||||||
}
|
}
|
||||||
return register_param_count_;
|
return register_param_count_;
|
||||||
@ -320,7 +321,7 @@ struct CodeStubInterfaceDescriptor {
|
|||||||
// defined outside of the platform directories
|
// defined outside of the platform directories
|
||||||
#define DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index) \
|
#define DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index) \
|
||||||
((index) == (descriptor)->register_param_count_) \
|
((index) == (descriptor)->register_param_count_) \
|
||||||
? *((descriptor)->stack_parameter_count_) \
|
? (descriptor)->stack_parameter_count_ \
|
||||||
: (descriptor)->register_params_[(index)]
|
: (descriptor)->register_params_[(index)]
|
||||||
|
|
||||||
|
|
||||||
|
@ -1494,7 +1494,7 @@ void Deoptimizer::DoComputeCompiledStubFrame(TranslationIterator* iterator,
|
|||||||
}
|
}
|
||||||
|
|
||||||
intptr_t caller_arg_count = 0;
|
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.
|
// Build the Arguments object for the caller's parameters and a pointer to it.
|
||||||
output_frame_offset -= kPointerSize;
|
output_frame_offset -= kPointerSize;
|
||||||
|
@ -172,7 +172,7 @@ static void InitializeArrayConstructorDescriptor(
|
|||||||
|
|
||||||
if (constant_stack_parameter_count != 0) {
|
if (constant_stack_parameter_count != 0) {
|
||||||
// stack param count needs (constructor pointer, and single argument)
|
// 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->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
||||||
descriptor->register_params_ = registers;
|
descriptor->register_params_ = registers;
|
||||||
@ -194,7 +194,7 @@ static void InitializeInternalArrayConstructorDescriptor(
|
|||||||
|
|
||||||
if (constant_stack_parameter_count != 0) {
|
if (constant_stack_parameter_count != 0) {
|
||||||
// stack param count needs (constructor pointer, and single argument)
|
// 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->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
||||||
descriptor->register_params_ = registers;
|
descriptor->register_params_ = registers;
|
||||||
|
@ -202,10 +202,7 @@ void Deoptimizer::SetPlatformCompiledStubRegisters(
|
|||||||
FrameDescription* output_frame, CodeStubInterfaceDescriptor* descriptor) {
|
FrameDescription* output_frame, CodeStubInterfaceDescriptor* descriptor) {
|
||||||
intptr_t handler =
|
intptr_t handler =
|
||||||
reinterpret_cast<intptr_t>(descriptor->deoptimization_handler_);
|
reinterpret_cast<intptr_t>(descriptor->deoptimization_handler_);
|
||||||
int params = descriptor->register_param_count_;
|
int params = descriptor->environment_length();
|
||||||
if (descriptor->stack_parameter_count_ != NULL) {
|
|
||||||
params++;
|
|
||||||
}
|
|
||||||
output_frame->SetRegister(eax.code(), params);
|
output_frame->SetRegister(eax.code(), params);
|
||||||
output_frame->SetRegister(ebx.code(), handler);
|
output_frame->SetRegister(ebx.code(), handler);
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ static void InitializeArrayConstructorDescriptor(
|
|||||||
descriptor->register_param_count_ = 2;
|
descriptor->register_param_count_ = 2;
|
||||||
if (constant_stack_parameter_count != 0) {
|
if (constant_stack_parameter_count != 0) {
|
||||||
// stack param count needs (constructor pointer, and single argument)
|
// 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->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
||||||
descriptor->register_params_ = registers;
|
descriptor->register_params_ = registers;
|
||||||
@ -203,7 +203,7 @@ static void InitializeInternalArrayConstructorDescriptor(
|
|||||||
|
|
||||||
if (constant_stack_parameter_count != 0) {
|
if (constant_stack_parameter_count != 0) {
|
||||||
// Stack param count needs (constructor pointer, and single argument).
|
// 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->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
||||||
descriptor->register_params_ = registers;
|
descriptor->register_params_ = registers;
|
||||||
|
@ -104,10 +104,7 @@ void Deoptimizer::SetPlatformCompiledStubRegisters(
|
|||||||
ApiFunction function(descriptor->deoptimization_handler_);
|
ApiFunction function(descriptor->deoptimization_handler_);
|
||||||
ExternalReference xref(&function, ExternalReference::BUILTIN_CALL, isolate_);
|
ExternalReference xref(&function, ExternalReference::BUILTIN_CALL, isolate_);
|
||||||
intptr_t handler = reinterpret_cast<intptr_t>(xref.address());
|
intptr_t handler = reinterpret_cast<intptr_t>(xref.address());
|
||||||
int params = descriptor->register_param_count_;
|
int params = descriptor->environment_length();
|
||||||
if (descriptor->stack_parameter_count_ != NULL) {
|
|
||||||
params++;
|
|
||||||
}
|
|
||||||
output_frame->SetRegister(s0.code(), params);
|
output_frame->SetRegister(s0.code(), params);
|
||||||
output_frame->SetRegister(s1.code(), (params - 1) * kPointerSize);
|
output_frame->SetRegister(s1.code(), (params - 1) * kPointerSize);
|
||||||
output_frame->SetRegister(s2.code(), handler);
|
output_frame->SetRegister(s2.code(), handler);
|
||||||
|
@ -179,7 +179,7 @@ static void InitializeArrayConstructorDescriptor(
|
|||||||
descriptor->register_param_count_ = 2;
|
descriptor->register_param_count_ = 2;
|
||||||
if (constant_stack_parameter_count != 0) {
|
if (constant_stack_parameter_count != 0) {
|
||||||
// stack param count needs (constructor pointer, and single argument)
|
// 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->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
||||||
descriptor->register_params_ = registers;
|
descriptor->register_params_ = registers;
|
||||||
@ -201,7 +201,7 @@ static void InitializeInternalArrayConstructorDescriptor(
|
|||||||
|
|
||||||
if (constant_stack_parameter_count != 0) {
|
if (constant_stack_parameter_count != 0) {
|
||||||
// stack param count needs (constructor pointer, and single argument)
|
// 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->hint_stack_parameter_count_ = constant_stack_parameter_count;
|
||||||
descriptor->register_params_ = registers;
|
descriptor->register_params_ = registers;
|
||||||
|
@ -106,10 +106,7 @@ void Deoptimizer::SetPlatformCompiledStubRegisters(
|
|||||||
FrameDescription* output_frame, CodeStubInterfaceDescriptor* descriptor) {
|
FrameDescription* output_frame, CodeStubInterfaceDescriptor* descriptor) {
|
||||||
intptr_t handler =
|
intptr_t handler =
|
||||||
reinterpret_cast<intptr_t>(descriptor->deoptimization_handler_);
|
reinterpret_cast<intptr_t>(descriptor->deoptimization_handler_);
|
||||||
int params = descriptor->register_param_count_;
|
int params = descriptor->environment_length();
|
||||||
if (descriptor->stack_parameter_count_ != NULL) {
|
|
||||||
params++;
|
|
||||||
}
|
|
||||||
output_frame->SetRegister(rax.code(), params);
|
output_frame->SetRegister(rax.code(), params);
|
||||||
output_frame->SetRegister(rbx.code(), handler);
|
output_frame->SetRegister(rbx.code(), handler);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user