Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: src/compiler/js-generic-lowering.cc

Issue 552803002: Get CallInterfaceDescriptor directly from CodeStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/js-generic-lowering.cc
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
index ea8976f2d11857217f6bd90a113973f807b14b78..2fada33e8b0c0a1152d5d4410a9c6dfe1a783e55 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -29,10 +29,8 @@ class LoadICStubShim : public HydrogenCodeStub {
return LoadIC::initialize_stub(isolate(), extra_state);
}
- virtual void InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) OVERRIDE {
- LoadDescriptor call_descriptor(isolate());
- descriptor->Initialize(MajorKey(), call_descriptor);
+ virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE {
+ return LoadDescriptor(isolate());
}
private:
@@ -54,10 +52,8 @@ class KeyedLoadICStubShim : public HydrogenCodeStub {
return isolate()->builtins()->KeyedLoadIC_Initialize();
}
- virtual void InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) OVERRIDE {
- LoadDescriptor call_descriptor(isolate());
- descriptor->Initialize(MajorKey(), call_descriptor);
+ virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE {
+ return LoadDescriptor(isolate());
}
private:
@@ -78,10 +74,8 @@ class StoreICStubShim : public HydrogenCodeStub {
return StoreIC::initialize_stub(isolate(), strict_mode_);
}
- virtual void InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) OVERRIDE {
- StoreDescriptor call_descriptor(isolate());
- descriptor->Initialize(MajorKey(), call_descriptor);
+ virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE {
+ return StoreDescriptor(isolate());
}
private:
@@ -106,10 +100,8 @@ class KeyedStoreICStubShim : public HydrogenCodeStub {
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
}
- virtual void InitializeInterfaceDescriptor(
- CodeStubInterfaceDescriptor* descriptor) OVERRIDE {
- StoreDescriptor call_descriptor(isolate());
- descriptor->Initialize(MajorKey(), call_descriptor);
+ virtual CallInterfaceDescriptor GetCallInterfaceDescriptor() OVERRIDE {
+ return StoreDescriptor(isolate());
}
private:
@@ -269,10 +261,10 @@ 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);
+ CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
bool has_frame_state = OperatorProperties::HasFrameStateInput(node->op());
CallDescriptor* desc_compare = linkage()->GetStubCallDescriptor(
- &d, 0, CallDescriptor::kPatchableCallSiteWithNop | FlagsForNode(node));
+ d, 0, CallDescriptor::kPatchableCallSiteWithNop | FlagsForNode(node));
Handle<Code> ic = CompareIC::GetUninitialized(isolate(), token);
NodeVector inputs(zone());
inputs.reserve(node->InputCount() + 1);
@@ -319,9 +311,9 @@ void JSGenericLowering::ReplaceWithCompareIC(Node* node, Token::Value token,
void JSGenericLowering::ReplaceWithStubCall(Node* node, HydrogenCodeStub* stub,
CallDescriptor::Flags flags) {
- CodeStubInterfaceDescriptor d(stub);
+ CallInterfaceDescriptor d = stub->GetCallInterfaceDescriptor();
CallDescriptor* desc =
- linkage()->GetStubCallDescriptor(&d, 0, flags | FlagsForNode(node));
+ linkage()->GetStubCallDescriptor(d, 0, flags | FlagsForNode(node));
Node* stub_code = CodeConstant(stub->GetCode());
PatchInsertInput(node, 0, stub_code);
PatchOperator(node, common()->Call(desc));
@@ -332,8 +324,8 @@ void JSGenericLowering::ReplaceWithBuiltinCall(Node* node,
Builtins::JavaScript id,
int nargs) {
CallFunctionStub stub(isolate(), nargs - 1, NO_CALL_FUNCTION_FLAGS);
- CodeStubInterfaceDescriptor d(&stub);
- CallDescriptor* desc = linkage()->GetStubCallDescriptor(&d, nargs);
+ CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
+ 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.
Handle<JSFunction> function(
@@ -457,8 +449,8 @@ Node* JSGenericLowering::LowerJSInstanceOf(Node* node) {
InstanceofStub::kReturnTrueFalseObject |
InstanceofStub::kArgsInRegisters);
InstanceofStub stub(isolate(), flags);
- CodeStubInterfaceDescriptor d(&stub);
- CallDescriptor* desc = linkage()->GetStubCallDescriptor(&d, 0);
+ CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
+ CallDescriptor* desc = linkage()->GetStubCallDescriptor(d, 0);
Node* stub_code = CodeConstant(stub.GetCode());
PatchInsertInput(node, 0, stub_code);
PatchOperator(node, common()->Call(desc));
@@ -506,9 +498,9 @@ 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);
+ CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
CallDescriptor* desc =
- linkage()->GetStubCallDescriptor(&d, arity, FlagsForNode(node));
+ linkage()->GetStubCallDescriptor(d, arity, FlagsForNode(node));
Node* stub_code = CodeConstant(stub.GetCode());
Node* construct = NodeProperties::GetValueInput(node, 0);
PatchInsertInput(node, 0, stub_code);
@@ -523,9 +515,9 @@ 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);
+ CallInterfaceDescriptor d = stub.GetCallInterfaceDescriptor();
CallDescriptor* desc =
- linkage()->GetStubCallDescriptor(&d, p.arity - 1, FlagsForNode(node));
+ linkage()->GetStubCallDescriptor(d, p.arity - 1, FlagsForNode(node));
Node* stub_code = CodeConstant(stub.GetCode());
PatchInsertInput(node, 0, stub_code);
PatchOperator(node, common()->Call(desc));

Powered by Google App Engine
This is Rietveld 408576698