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

Unified Diff: src/isolate.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/ia32/macro-assembler-ia32.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index ed44793e0714d31056049310e7e47a334ab95fbe..927989f367f053979a87e6c357433581e1074a0d 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -2385,18 +2385,15 @@ CodeTracer* Isolate::GetCodeTracer() {
Map* Isolate::get_initial_js_array_map(ElementsKind kind, Strength strength) {
- Context* native_context = context()->native_context();
- Object* maybe_map_array = is_strong(strength)
- ? native_context->js_array_strong_maps()
- : native_context->js_array_maps();
- if (!maybe_map_array->IsUndefined()) {
- Object* maybe_transitioned_map =
- FixedArray::cast(maybe_map_array)->get(kind);
- if (!maybe_transitioned_map->IsUndefined()) {
- return Map::cast(maybe_transitioned_map);
+ if (IsFastElementsKind(kind)) {
+ DisallowHeapAllocation no_gc;
+ Object* const initial_js_array_map = context()->native_context()->get(
+ Context::ArrayMapIndex(kind, strength));
+ if (!initial_js_array_map->IsUndefined()) {
+ return Map::cast(initial_js_array_map);
}
}
- return NULL;
+ return nullptr;
}
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698