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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1516433005: [contexts] Place the initial JSArray maps on the native context directly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. Created 5 years 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/contexts.h ('k') | src/factory.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 98ec18dbe48ac5ef2b3138efc8fad3553f983414..08e6d1adb15da6f0de49e0025072d7e16408ee14 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -3427,16 +3427,9 @@ HValue* HGraphBuilder::JSArrayBuilder::EmitMapCode() {
? builder()->BuildGetNativeContext(constructor_function_)
: builder()->BuildGetNativeContext();
- HInstruction* index = builder()->Add<HConstant>(
- static_cast<int32_t>(Context::JS_ARRAY_MAPS_INDEX));
-
- HInstruction* map_array = builder()->Add<HLoadKeyed>(
- native_context, index, nullptr, nullptr, FAST_ELEMENTS);
-
- HInstruction* kind_index = builder()->Add<HConstant>(kind_);
-
- return builder()->Add<HLoadKeyed>(map_array, kind_index, nullptr, nullptr,
- FAST_ELEMENTS);
+ HObjectAccess access =
+ HObjectAccess::ForContextSlot(Context::ArrayMapIndex(kind_));
+ return builder()->Add<HLoadNamedField>(native_context, nullptr, access);
}
« no previous file with comments | « src/contexts.h ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698