Initialize CodeStubInterfaceDescriptor in the constructor.
R=mvstanton@chromium.org Review URL: https://codereview.chromium.org/553833002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23773 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
6e1ebdcbc3
commit
014c0fe278
@ -122,8 +122,7 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
|
||||
// Update the static counter each time a new code stub is generated.
|
||||
isolate()->counters()->code_stubs()->Increment();
|
||||
|
||||
CodeStubInterfaceDescriptor descriptor;
|
||||
InitializeInterfaceDescriptor(&descriptor);
|
||||
CodeStubInterfaceDescriptor descriptor(this);
|
||||
int param_count = descriptor.GetEnvironmentParameterCount();
|
||||
{
|
||||
// Call the runtime system in a fresh internal frame.
|
||||
|
@ -2456,8 +2456,7 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
|
||||
return DefineAsSpilled(result, spill_index);
|
||||
} else {
|
||||
DCHECK(info()->IsStub());
|
||||
CodeStubInterfaceDescriptor descriptor;
|
||||
info()->code_stub()->InitializeInterfaceDescriptor(&descriptor);
|
||||
CodeStubInterfaceDescriptor descriptor(info()->code_stub());
|
||||
int index = static_cast<int>(instr->index());
|
||||
Register reg = descriptor.GetEnvironmentParameterRegister(index);
|
||||
return DefineFixed(result, reg);
|
||||
|
@ -111,8 +111,7 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
|
||||
// Update the static counter each time a new code stub is generated.
|
||||
isolate()->counters()->code_stubs()->Increment();
|
||||
|
||||
CodeStubInterfaceDescriptor descriptor;
|
||||
InitializeInterfaceDescriptor(&descriptor);
|
||||
CodeStubInterfaceDescriptor descriptor(this);
|
||||
int param_count = descriptor.GetEnvironmentParameterCount();
|
||||
{
|
||||
// Call the runtime system in a fresh internal frame.
|
||||
|
@ -2001,8 +2001,7 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
|
||||
return DefineAsSpilled(result, spill_index);
|
||||
} else {
|
||||
DCHECK(info()->IsStub());
|
||||
CodeStubInterfaceDescriptor descriptor;
|
||||
info()->code_stub()->InitializeInterfaceDescriptor(&descriptor);
|
||||
CodeStubInterfaceDescriptor descriptor(info()->code_stub());
|
||||
int index = static_cast<int>(instr->index());
|
||||
Register reg = descriptor.GetEnvironmentParameterRegister(index);
|
||||
return DefineFixed(result, reg);
|
||||
|
@ -37,8 +37,8 @@ class CodeStubGraphBuilderBase : public HGraphBuilder {
|
||||
: HGraphBuilder(&info_),
|
||||
arguments_length_(NULL),
|
||||
info_(stub, isolate),
|
||||
descriptor_(stub),
|
||||
context_(NULL) {
|
||||
stub->InitializeInterfaceDescriptor(&descriptor_);
|
||||
int parameter_count = descriptor_.GetEnvironmentParameterCount();
|
||||
parameters_.Reset(new HParameter*[parameter_count]);
|
||||
}
|
||||
@ -251,8 +251,7 @@ Handle<Code> HydrogenCodeStub::GenerateLightweightMissCode() {
|
||||
template <class Stub>
|
||||
static Handle<Code> DoGenerateCode(Stub* stub) {
|
||||
Isolate* isolate = stub->isolate();
|
||||
CodeStubInterfaceDescriptor descriptor;
|
||||
stub->InitializeInterfaceDescriptor(&descriptor);
|
||||
CodeStubInterfaceDescriptor descriptor(stub);
|
||||
|
||||
// If we are uninitialized we can use a light-weight stub to enter
|
||||
// the runtime that is significantly faster than using the standard
|
||||
|
@ -16,14 +16,29 @@ namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
|
||||
CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor()
|
||||
CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor(CodeStub* stub)
|
||||
: stack_parameter_count_(no_reg),
|
||||
hint_stack_parameter_count_(-1),
|
||||
function_mode_(NOT_JS_FUNCTION_STUB_MODE),
|
||||
deoptimization_handler_(NULL),
|
||||
handler_arguments_mode_(DONT_PASS_ARGUMENTS),
|
||||
miss_handler_(),
|
||||
has_miss_handler_(false) {}
|
||||
has_miss_handler_(false) {
|
||||
stub->InitializeInterfaceDescriptor(this);
|
||||
}
|
||||
|
||||
|
||||
CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor(Isolate* isolate,
|
||||
uint32_t stub_key)
|
||||
: stack_parameter_count_(no_reg),
|
||||
hint_stack_parameter_count_(-1),
|
||||
function_mode_(NOT_JS_FUNCTION_STUB_MODE),
|
||||
deoptimization_handler_(NULL),
|
||||
handler_arguments_mode_(DONT_PASS_ARGUMENTS),
|
||||
miss_handler_(),
|
||||
has_miss_handler_(false) {
|
||||
CodeStub::InitializeInterfaceDescriptor(isolate, stub_key, this);
|
||||
}
|
||||
|
||||
|
||||
void CodeStubInterfaceDescriptor::Initialize(
|
||||
|
@ -329,7 +329,9 @@ enum HandlerArgumentsMode { DONT_PASS_ARGUMENTS, PASS_ARGUMENTS };
|
||||
|
||||
class CodeStubInterfaceDescriptor {
|
||||
public:
|
||||
CodeStubInterfaceDescriptor();
|
||||
explicit CodeStubInterfaceDescriptor(CodeStub* stub);
|
||||
|
||||
CodeStubInterfaceDescriptor(Isolate* isolate, uint32_t stub_key);
|
||||
|
||||
void Initialize(CodeStub::Major major,
|
||||
CallInterfaceDescriptor call_descriptor,
|
||||
|
@ -269,8 +269,7 @@ static CallDescriptor::Flags FlagsForNode(Node* node) {
|
||||
void JSGenericLowering::ReplaceWithCompareIC(Node* node, Token::Value token,
|
||||
bool pure) {
|
||||
BinaryOpICStub stub(isolate(), Token::ADD); // TODO(mstarzinger): Hack.
|
||||
CodeStubInterfaceDescriptor d;
|
||||
stub.InitializeInterfaceDescriptor(&d);
|
||||
CodeStubInterfaceDescriptor d(&stub);
|
||||
bool has_frame_state = OperatorProperties::HasFrameStateInput(node->op());
|
||||
CallDescriptor* desc_compare = linkage()->GetStubCallDescriptor(
|
||||
&d, 0, CallDescriptor::kPatchableCallSiteWithNop | FlagsForNode(node));
|
||||
@ -320,8 +319,7 @@ void JSGenericLowering::ReplaceWithCompareIC(Node* node, Token::Value token,
|
||||
|
||||
void JSGenericLowering::ReplaceWithStubCall(Node* node, HydrogenCodeStub* stub,
|
||||
CallDescriptor::Flags flags) {
|
||||
CodeStubInterfaceDescriptor d;
|
||||
stub->InitializeInterfaceDescriptor(&d);
|
||||
CodeStubInterfaceDescriptor d(stub);
|
||||
CallDescriptor* desc =
|
||||
linkage()->GetStubCallDescriptor(&d, 0, flags | FlagsForNode(node));
|
||||
Node* stub_code = CodeConstant(stub->GetCode());
|
||||
@ -334,8 +332,7 @@ void JSGenericLowering::ReplaceWithBuiltinCall(Node* node,
|
||||
Builtins::JavaScript id,
|
||||
int nargs) {
|
||||
CallFunctionStub stub(isolate(), nargs - 1, NO_CALL_FUNCTION_FLAGS);
|
||||
CodeStubInterfaceDescriptor d;
|
||||
stub.InitializeInterfaceDescriptor(&d);
|
||||
CodeStubInterfaceDescriptor d(&stub);
|
||||
CallDescriptor* desc = linkage()->GetStubCallDescriptor(&d, nargs);
|
||||
// TODO(mstarzinger): Accessing the builtins object this way prevents sharing
|
||||
// of code across native contexts. Fix this by loading from given context.
|
||||
@ -460,8 +457,7 @@ Node* JSGenericLowering::LowerJSInstanceOf(Node* node) {
|
||||
InstanceofStub::kReturnTrueFalseObject |
|
||||
InstanceofStub::kArgsInRegisters);
|
||||
InstanceofStub stub(isolate(), flags);
|
||||
CodeStubInterfaceDescriptor d;
|
||||
stub.InitializeInterfaceDescriptor(&d);
|
||||
CodeStubInterfaceDescriptor d(&stub);
|
||||
CallDescriptor* desc = linkage()->GetStubCallDescriptor(&d, 0);
|
||||
Node* stub_code = CodeConstant(stub.GetCode());
|
||||
PatchInsertInput(node, 0, stub_code);
|
||||
@ -510,8 +506,7 @@ Node* JSGenericLowering::LowerJSStoreContext(Node* node) {
|
||||
Node* JSGenericLowering::LowerJSCallConstruct(Node* node) {
|
||||
int arity = OpParameter<int>(node);
|
||||
CallConstructStub stub(isolate(), NO_CALL_CONSTRUCTOR_FLAGS);
|
||||
CodeStubInterfaceDescriptor d;
|
||||
stub.InitializeInterfaceDescriptor(&d);
|
||||
CodeStubInterfaceDescriptor d(&stub);
|
||||
CallDescriptor* desc =
|
||||
linkage()->GetStubCallDescriptor(&d, arity, FlagsForNode(node));
|
||||
Node* stub_code = CodeConstant(stub.GetCode());
|
||||
@ -528,8 +523,7 @@ Node* JSGenericLowering::LowerJSCallConstruct(Node* node) {
|
||||
Node* JSGenericLowering::LowerJSCallFunction(Node* node) {
|
||||
CallParameters p = OpParameter<CallParameters>(node);
|
||||
CallFunctionStub stub(isolate(), p.arity - 2, p.flags);
|
||||
CodeStubInterfaceDescriptor d;
|
||||
stub.InitializeInterfaceDescriptor(&d);
|
||||
CodeStubInterfaceDescriptor d(&stub);
|
||||
CallDescriptor* desc =
|
||||
linkage()->GetStubCallDescriptor(&d, p.arity - 1, FlagsForNode(node));
|
||||
Node* stub_code = CodeConstant(stub.GetCode());
|
||||
|
@ -52,8 +52,7 @@ Linkage::Linkage(CompilationInfo* info) : info_(info) {
|
||||
} else if (info->code_stub() != NULL) {
|
||||
// Use the code stub interface descriptor.
|
||||
HydrogenCodeStub* stub = info->code_stub();
|
||||
CodeStubInterfaceDescriptor descriptor;
|
||||
stub->InitializeInterfaceDescriptor(&descriptor);
|
||||
CodeStubInterfaceDescriptor descriptor(stub);
|
||||
incoming_ = GetStubCallDescriptor(&descriptor);
|
||||
} else {
|
||||
incoming_ = NULL; // TODO(titzer): ?
|
||||
|
@ -84,9 +84,7 @@ Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver,
|
||||
Node* context, Node* frame_state,
|
||||
CallFunctionFlags flags) {
|
||||
CallFunctionStub stub(isolate(), 0, flags);
|
||||
CodeStubInterfaceDescriptor d;
|
||||
stub.InitializeInterfaceDescriptor(&d);
|
||||
|
||||
CodeStubInterfaceDescriptor d(&stub);
|
||||
CallDescriptor* desc = Linkage::GetStubCallDescriptor(
|
||||
&d, 1, CallDescriptor::kNeedsFrameState, zone());
|
||||
Node* stub_code = HeapConstant(stub.GetCode());
|
||||
|
@ -852,8 +852,7 @@ void SimplifiedLowering::DoStoreElement(Node* node) {
|
||||
|
||||
void SimplifiedLowering::DoStringAdd(Node* node) {
|
||||
StringAddStub stub(zone()->isolate(), STRING_ADD_CHECK_NONE, NOT_TENURED);
|
||||
CodeStubInterfaceDescriptor d;
|
||||
stub.InitializeInterfaceDescriptor(&d);
|
||||
CodeStubInterfaceDescriptor d(&stub);
|
||||
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
|
||||
CallDescriptor* desc = Linkage::GetStubCallDescriptor(&d, 0, flags, zone());
|
||||
node->set_op(common()->Call(desc));
|
||||
|
@ -1622,9 +1622,7 @@ void Deoptimizer::DoComputeCompiledStubFrame(TranslationIterator* iterator,
|
||||
|
||||
CHECK(compiled_code_->is_hydrogen_stub());
|
||||
int major_key = CodeStub::GetMajorKey(compiled_code_);
|
||||
CodeStubInterfaceDescriptor descriptor;
|
||||
CodeStub::InitializeInterfaceDescriptor(isolate_, compiled_code_->stub_key(),
|
||||
&descriptor);
|
||||
CodeStubInterfaceDescriptor descriptor(isolate_, compiled_code_->stub_key());
|
||||
// Check that there is a matching descriptor to the major key.
|
||||
// This will fail if there has not been one installed to the isolate.
|
||||
DCHECK_EQ(descriptor.MajorKey(), major_key);
|
||||
|
@ -3435,8 +3435,7 @@ HGraph::HGraph(CompilationInfo* info)
|
||||
inlined_functions_(5, info->zone()) {
|
||||
if (info->IsStub()) {
|
||||
HydrogenCodeStub* stub = info->code_stub();
|
||||
CodeStubInterfaceDescriptor descriptor;
|
||||
stub->InitializeInterfaceDescriptor(&descriptor);
|
||||
CodeStubInterfaceDescriptor descriptor(stub);
|
||||
start_environment_ = new (zone_)
|
||||
HEnvironment(zone_, descriptor.GetEnvironmentParameterCount());
|
||||
} else {
|
||||
|
@ -115,8 +115,7 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
|
||||
// Update the static counter each time a new code stub is generated.
|
||||
isolate()->counters()->code_stubs()->Increment();
|
||||
|
||||
CodeStubInterfaceDescriptor descriptor;
|
||||
InitializeInterfaceDescriptor(&descriptor);
|
||||
CodeStubInterfaceDescriptor descriptor(this);
|
||||
int param_count = descriptor.GetEnvironmentParameterCount();
|
||||
{
|
||||
// Call the runtime system in a fresh internal frame.
|
||||
|
@ -2514,8 +2514,7 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
|
||||
return DefineAsSpilled(result, spill_index);
|
||||
} else {
|
||||
DCHECK(info()->IsStub());
|
||||
CodeStubInterfaceDescriptor descriptor;
|
||||
info()->code_stub()->InitializeInterfaceDescriptor(&descriptor);
|
||||
CodeStubInterfaceDescriptor descriptor(info()->code_stub());
|
||||
int index = static_cast<int>(instr->index());
|
||||
Register reg = descriptor.GetEnvironmentParameterRegister(index);
|
||||
return DefineFixed(result, reg);
|
||||
|
@ -107,8 +107,7 @@ void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) {
|
||||
// Update the static counter each time a new code stub is generated.
|
||||
isolate()->counters()->code_stubs()->Increment();
|
||||
|
||||
CodeStubInterfaceDescriptor descriptor;
|
||||
InitializeInterfaceDescriptor(&descriptor);
|
||||
CodeStubInterfaceDescriptor descriptor(this);
|
||||
int param_count = descriptor.GetEnvironmentParameterCount();
|
||||
{
|
||||
// Call the runtime system in a fresh internal frame.
|
||||
|
@ -2494,8 +2494,7 @@ LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
|
||||
return DefineAsSpilled(result, spill_index);
|
||||
} else {
|
||||
DCHECK(info()->IsStub());
|
||||
CodeStubInterfaceDescriptor descriptor;
|
||||
info()->code_stub()->InitializeInterfaceDescriptor(&descriptor);
|
||||
CodeStubInterfaceDescriptor descriptor(info()->code_stub());
|
||||
int index = static_cast<int>(instr->index());
|
||||
Register reg = descriptor.GetEnvironmentParameterRegister(index);
|
||||
return DefineFixed(result, reg);
|
||||
|
Loading…
Reference in New Issue
Block a user