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

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

Issue 473263004: Towards removing dependency from generic lowering on compilation info. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 5d1583142c1d5da49a3201c501a14ec947246615..0cb36059f4c770add1ab729cf456d7263868935d 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -155,12 +155,11 @@ class KeyedStoreICStubShim : public HydrogenCodeStub {
};
-JSGenericLowering::JSGenericLowering(CompilationInfo* info, JSGraph* jsgraph,
+JSGenericLowering::JSGenericLowering(JSGraph* jsgraph,
+ JSContextSpecializer* spec,
+ Linkage* linkage,
MachineOperatorBuilder* machine)
- : info_(info),
- jsgraph_(jsgraph),
- linkage_(new (jsgraph->zone()) Linkage(info)),
- machine_(machine) {}
+ : jsgraph_(jsgraph), spec_(spec), linkage_(linkage), machine_(machine) {}
void JSGenericLowering::PatchOperator(Node* node, Operator* op) {
@@ -340,12 +339,9 @@ void JSGenericLowering::ReplaceWithBuiltinCall(Node* node,
CallFunctionStub stub(isolate(), nargs - 1, NO_CALL_FUNCTION_FLAGS);
CodeStubInterfaceDescriptor* d = GetInterfaceDescriptor(isolate(), &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.
- Handle<JSFunction> function(
- JSFunction::cast(info()->context()->builtins()->javascript_builtin(id)));
+
+ Node* function_node = spec_->InsertBuiltinLoadBefore(node, id);
Node* stub_code = CodeConstant(stub.GetCode());
- Node* function_node = FunctionConstant(function);
PatchInsertInput(node, 0, stub_code);
PatchInsertInput(node, 1, function_node);
PatchOperator(node, common()->Call(desc));
@@ -417,9 +413,7 @@ Node* JSGenericLowering::LowerJSLoadNamed(Node* node) {
Node* JSGenericLowering::LowerJSStoreProperty(Node* node) {
- // TODO(mstarzinger): The strict_mode needs to be carried along in the
- // operator so that graphs are fully compositional for inlining.
- StrictMode strict_mode = info()->strict_mode();
+ StrictMode strict_mode = OpParameter<StrictMode>(node);
KeyedStoreICStubShim stub(isolate(), strict_mode);
ReplaceWithICStubCall(node, &stub);
return node;
@@ -427,12 +421,9 @@ Node* JSGenericLowering::LowerJSStoreProperty(Node* node) {
Node* JSGenericLowering::LowerJSStoreNamed(Node* node) {
- PrintableUnique<Name> key = OpParameter<PrintableUnique<Name> >(node);
- // TODO(mstarzinger): The strict_mode needs to be carried along in the
- // operator so that graphs are fully compositional for inlining.
- StrictMode strict_mode = info()->strict_mode();
- StoreICStubShim stub(isolate(), strict_mode);
- PatchInsertInput(node, 1, jsgraph()->HeapConstant(key));
+ StoreNamedParameters params = OpParameter<StoreNamedParameters>(node);
+ StoreICStubShim stub(isolate(), params.strict_mode);
+ PatchInsertInput(node, 1, jsgraph()->HeapConstant(params.name));
ReplaceWithICStubCall(node, &stub);
return node;
}

Powered by Google App Engine
This is Rietveld 408576698