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

Unified Diff: src/isolate.cc

Issue 15014020: Elide hole checks on KeyedLoads of holey double arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merge with ToT Created 7 years, 7 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/isolate.h ('k') | src/objects.h » ('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 79a9020bfc5ab53b8cbb01adc6cd6c64bec40e97..2f36063dd6b98d9fa63658f36dbd1041d39582e9 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -2443,6 +2443,44 @@ HTracer* Isolate::GetHTracer() {
}
+Map* Isolate::get_initial_js_array_map(ElementsKind kind) {
+ Context* native_context = context()->native_context();
+ Object* maybe_map_array = 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);
+ }
+ }
+ return NULL;
+}
+
+
+bool Isolate::IsFastArrayConstructorPrototypeChainIntact() {
+ Map* root_array_map =
+ get_initial_js_array_map(GetInitialFastElementsKind());
+ ASSERT(root_array_map != NULL);
+ JSObject* initial_array_proto = JSObject::cast(*initial_array_prototype());
+
+ // Check that the array prototype hasn't been altered WRT empty elements.
+ if (root_array_map->prototype() != initial_array_proto) return false;
+ if (initial_array_proto->elements() != heap()->empty_fixed_array()) {
+ return false;
+ }
+
+ // Check that the object prototype hasn't been altered WRT empty elements.
+ JSObject* initial_object_proto = JSObject::cast(*initial_object_prototype());
+ Object* root_array_map_proto = initial_array_proto->GetPrototype();
+ if (root_array_map_proto != initial_object_proto) return false;
+ if (initial_object_proto->elements() != heap()->empty_fixed_array()) {
+ return false;
+ }
+
+ return initial_object_proto->GetPrototype()->IsNull();
+}
+
+
CodeStubInterfaceDescriptor*
Isolate::code_stub_interface_descriptor(int index) {
return code_stub_interface_descriptors_ + index;
« no previous file with comments | « src/isolate.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698