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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1478303002: Revert of [runtime] Replace global object link with native context link in all contexts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/crankshaft/arm64/lithium-codegen-arm64.cc ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index e1cf7d808035bc4ac41a6187c2fdda76c7f60cc9..6d5a81460b7dbe68a19751e5c3df74cf85ad0bd8 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -1859,9 +1859,11 @@
NOT_TENURED, JS_ARRAY_TYPE);
// Initialize the JSRegExpResult header.
+ HValue* global_object = Add<HLoadNamedField>(
+ context(), nullptr,
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
HValue* native_context = Add<HLoadNamedField>(
- context(), nullptr,
- HObjectAccess::ForContextSlot(Context::NATIVE_CONTEXT_INDEX));
+ global_object, nullptr, HObjectAccess::ForJSGlobalObjectNativeContext());
Add<HStoreNamedField>(
result, HObjectAccess::ForMap(),
Add<HLoadNamedField>(
@@ -3258,9 +3260,13 @@
HInstruction* HGraphBuilder::BuildGetNativeContext() {
- return Add<HLoadNamedField>(
+ // Get the global object, then the native context
+ HValue* global_object = Add<HLoadNamedField>(
context(), nullptr,
- HObjectAccess::ForContextSlot(Context::NATIVE_CONTEXT_INDEX));
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
+ return Add<HLoadNamedField>(global_object, nullptr,
+ HObjectAccess::ForObservableJSObjectOffset(
+ JSGlobalObject::kNativeContextOffset));
}
@@ -3268,9 +3274,12 @@
// Get the global object, then the native context
HInstruction* context = Add<HLoadNamedField>(
closure, nullptr, HObjectAccess::ForFunctionContextPointer());
- return Add<HLoadNamedField>(
+ HInstruction* global_object = Add<HLoadNamedField>(
context, nullptr,
- HObjectAccess::ForContextSlot(Context::NATIVE_CONTEXT_INDEX));
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
+ HObjectAccess access = HObjectAccess::ForObservableJSObjectOffset(
+ JSGlobalObject::kNativeContextOffset);
+ return Add<HLoadNamedField>(global_object, nullptr, access);
}
@@ -3541,7 +3550,12 @@
HValue* HGraphBuilder::AddLoadJSBuiltin(int context_index) {
- HValue* native_context = BuildGetNativeContext();
+ HValue* global_object = Add<HLoadNamedField>(
+ context(), nullptr,
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
+ HObjectAccess access = HObjectAccess::ForObservableJSObjectOffset(
+ JSGlobalObject::kNativeContextOffset);
+ HValue* native_context = Add<HLoadNamedField>(global_object, nullptr, access);
HObjectAccess function_access = HObjectAccess::ForContextSlot(context_index);
return Add<HLoadNamedField>(native_context, nullptr, function_access);
}
@@ -5700,8 +5714,8 @@
}
} else {
HValue* global_object = Add<HLoadNamedField>(
- BuildGetNativeContext(), nullptr,
- HObjectAccess::ForContextSlot(Context::EXTENSION_INDEX));
+ context(), nullptr,
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
HLoadGlobalGeneric* instr = New<HLoadGlobalGeneric>(
global_object, variable->name(), ast_context()->typeof_mode());
instr->SetVectorAndSlot(handle(current_feedback_vector(), isolate()),
@@ -6914,8 +6928,8 @@
}
} else {
HValue* global_object = Add<HLoadNamedField>(
- BuildGetNativeContext(), nullptr,
- HObjectAccess::ForContextSlot(Context::EXTENSION_INDEX));
+ context(), nullptr,
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
HStoreNamedGeneric* instr =
Add<HStoreNamedGeneric>(global_object, var->name(), value,
function_language_mode(), PREMONOMORPHIC);
@@ -10017,7 +10031,11 @@
BuildAllocate(Add<HConstant>(JSArrayBuffer::kSizeWithInternalFields),
HType::JSObject(), JS_ARRAY_BUFFER_TYPE, HAllocationMode());
- HValue* native_context = BuildGetNativeContext();
+ HValue* global_object = Add<HLoadNamedField>(
+ context(), nullptr,
+ HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
+ HValue* native_context = Add<HLoadNamedField>(
+ global_object, nullptr, HObjectAccess::ForJSGlobalObjectNativeContext());
Add<HStoreNamedField>(
result, HObjectAccess::ForMap(),
Add<HLoadNamedField>(
« no previous file with comments | « src/crankshaft/arm64/lithium-codegen-arm64.cc ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698