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

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

Issue 879433002: [turbofan] Don't embed pointer to builtins object in generic lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment Created 5 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-generic-lowering.cc
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
index bad30ffd0cea10235c2ca995631adc80cc56c94a..d512519948c3ecc8201029791da23f2b9c006205 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -186,14 +186,23 @@ void JSGenericLowering::ReplaceWithBuiltinCall(Node* node,
CodeFactory::CallFunction(isolate(), nargs - 1, NO_CALL_FUNCTION_FLAGS);
CallDescriptor* desc = linkage()->GetStubCallDescriptor(
callable.descriptor(), nargs, FlagsForNode(node), properties);
- // 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* global_object = graph()->NewNode(
+ machine()->Load(kMachAnyTagged), NodeProperties::GetContextInput(node),
+ jsgraph()->IntPtrConstant(
+ Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)),
+ NodeProperties::GetEffectInput(node), graph()->start());
+ Node* builtins_object = graph()->NewNode(
+ machine()->Load(kMachAnyTagged), global_object,
+ jsgraph()->IntPtrConstant(GlobalObject::kBuiltinsOffset - kHeapObjectTag),
+ NodeProperties::GetEffectInput(node), graph()->start());
+ Node* function = graph()->NewNode(
+ machine()->Load(kMachAnyTagged), builtins_object,
+ jsgraph()->IntPtrConstant(JSBuiltinsObject::OffsetOfFunctionWithId(id) -
+ kHeapObjectTag),
+ NodeProperties::GetEffectInput(node), graph()->start());
Node* stub_code = jsgraph()->HeapConstant(callable.code());
- Node* function_node = jsgraph()->HeapConstant(function);
PatchInsertInput(node, 0, stub_code);
- PatchInsertInput(node, 1, function_node);
+ PatchInsertInput(node, 1, function);
PatchOperator(node, common()->Call(desc));
}
@@ -291,8 +300,8 @@ void JSGenericLowering::LowerJSStoreNamed(Node* node) {
void JSGenericLowering::LowerJSDeleteProperty(Node* node) {
StrictMode strict_mode = OpParameter<StrictMode>(node);
- PatchInsertInput(node, 2, jsgraph()->SmiConstant(strict_mode));
ReplaceWithBuiltinCall(node, Builtins::DELETE, 3);
+ PatchInsertInput(node, 4, jsgraph()->SmiConstant(strict_mode));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698