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

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

Issue 1316943002: Move (uppercase) JS builtins from js builtins object to native context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove Isolate::js_builtins_object Created 5 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
« no previous file with comments | « src/compiler/js-generic-lowering.h ('k') | src/compiler/pipeline.cc » ('j') | 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 0c20ea067c489139844695562efbc89ee3238a83..3fa66b856a83ed95dc47830c7f25aee095d81fc7 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -214,8 +214,7 @@ void JSGenericLowering::ReplaceWithStubCall(Node* node, Callable callable,
}
-void JSGenericLowering::ReplaceWithBuiltinCall(Node* node,
- Builtins::JavaScript id,
+void JSGenericLowering::ReplaceWithBuiltinCall(Node* node, int context_index,
int nargs) {
Node* context_input = NodeProperties::GetContextInput(node);
Node* effect_input = NodeProperties::GetEffectInput(node);
@@ -231,14 +230,14 @@ void JSGenericLowering::ReplaceWithBuiltinCall(Node* node,
jsgraph()->IntPtrConstant(
Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)),
effect_input, graph()->start());
- Node* builtins_object = graph()->NewNode(
- machine()->Load(kMachAnyTagged), global_object,
- jsgraph()->IntPtrConstant(GlobalObject::kBuiltinsOffset - kHeapObjectTag),
- effect_input, graph()->start());
+ Node* native_context =
+ graph()->NewNode(machine()->Load(kMachAnyTagged), global_object,
+ jsgraph()->IntPtrConstant(
+ GlobalObject::kNativeContextOffset - kHeapObjectTag),
+ effect_input, graph()->start());
Node* function = graph()->NewNode(
- machine()->Load(kMachAnyTagged), builtins_object,
- jsgraph()->IntPtrConstant(JSBuiltinsObject::OffsetOfFunctionWithId(id) -
- kHeapObjectTag),
+ machine()->Load(kMachAnyTagged), native_context,
+ jsgraph()->IntPtrConstant(Context::SlotOffset(context_index)),
effect_input, graph()->start());
Node* stub_code = jsgraph()->HeapConstant(callable.code());
node->InsertInput(zone(), 0, stub_code);
@@ -297,12 +296,12 @@ void JSGenericLowering::LowerJSToNumber(Node* node) {
void JSGenericLowering::LowerJSToString(Node* node) {
- ReplaceWithBuiltinCall(node, Builtins::TO_STRING, 1);
+ ReplaceWithBuiltinCall(node, Context::TO_STRING_BUILTIN_INDEX, 1);
}
void JSGenericLowering::LowerJSToName(Node* node) {
- ReplaceWithBuiltinCall(node, Builtins::TO_NAME, 1);
+ ReplaceWithBuiltinCall(node, Context::TO_NAME_BUILTIN_INDEX, 1);
}
@@ -437,7 +436,7 @@ void JSGenericLowering::LowerJSDeleteProperty(Node* node) {
void JSGenericLowering::LowerJSHasProperty(Node* node) {
- ReplaceWithBuiltinCall(node, Builtins::IN, 2);
+ ReplaceWithBuiltinCall(node, Context::IN_BUILTIN_INDEX, 2);
}
« no previous file with comments | « src/compiler/js-generic-lowering.h ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698