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

Unified Diff: src/isolate.cc

Issue 1099453007: Empty Array prototype elements protection needs to alert on length change. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: With comments. Created 5 years, 8 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.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 f7a2740ef5a4ab7f3a19be4733950c7ca75cfcba..5427a8c319d59369dd8f6e5fbde3aea5789e1d43 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -2374,16 +2374,18 @@ bool Isolate::use_crankshaft() const {
bool Isolate::IsFastArrayConstructorPrototypeChainIntact() {
- Handle<PropertyCell> no_elements_cell =
- handle(heap()->array_protector(), this);
+ PropertyCell* no_elements_cell = heap()->array_protector();
bool cell_reports_intact = no_elements_cell->value()->IsSmi() &&
Smi::cast(no_elements_cell->value())->value() == 1;
#ifdef DEBUG
Map* root_array_map =
get_initial_js_array_map(GetInitialFastElementsKind());
- JSObject* initial_array_proto = JSObject::cast(*initial_array_prototype());
- JSObject* initial_object_proto = JSObject::cast(*initial_object_prototype());
+ Context* native_context = context()->native_context();
+ JSObject* initial_array_proto = JSObject::cast(
+ native_context->get(Context::INITIAL_ARRAY_PROTOTYPE_INDEX));
+ JSObject* initial_object_proto = JSObject::cast(
+ native_context->get(Context::INITIAL_OBJECT_PROTOTYPE_INDEX));
if (root_array_map == NULL || initial_array_proto == initial_object_proto) {
// We are in the bootstrapping process, and the entire check sequence
@@ -2426,7 +2428,6 @@ bool Isolate::IsFastArrayConstructorPrototypeChainIntact() {
void Isolate::UpdateArrayProtectorOnSetElement(Handle<JSObject> object) {
- Handle<PropertyCell> array_protector = factory()->array_protector();
if (IsFastArrayConstructorPrototypeChainIntact() &&
object->map()->is_prototype_map()) {
Object* context = heap()->native_contexts_list();
@@ -2436,7 +2437,7 @@ void Isolate::UpdateArrayProtectorOnSetElement(Handle<JSObject> object) {
*object ||
current_context->get(Context::INITIAL_ARRAY_PROTOTYPE_INDEX) ==
*object) {
- PropertyCell::SetValueWithInvalidation(array_protector,
+ PropertyCell::SetValueWithInvalidation(factory()->array_protector(),
handle(Smi::FromInt(0), this));
break;
}
« no previous file with comments | « src/isolate.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698