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

Unified Diff: src/objects.cc

Issue 6461022: Merge a number of assertion failure fixes to the 3.0 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.0/
Patch Set: '' Created 9 years, 10 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
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 6703)
+++ src/objects.cc (working copy)
@@ -1705,8 +1705,9 @@
}
-bool JSObject::SetElementWithCallbackSetterInPrototypes(uint32_t index,
- Object* value) {
+MaybeObject* JSObject::SetElementWithCallbackSetterInPrototypes(uint32_t index,
+ Object* value,
+ bool* found) {
for (Object* pt = GetPrototype();
pt != Heap::null_value();
pt = pt->GetPrototype()) {
@@ -1716,15 +1717,16 @@
NumberDictionary* dictionary = JSObject::cast(pt)->element_dictionary();
int entry = dictionary->FindEntry(index);
if (entry != NumberDictionary::kNotFound) {
- Object* element = dictionary->ValueAt(entry);
PropertyDetails details = dictionary->DetailsAt(entry);
if (details.type() == CALLBACKS) {
- SetElementWithCallback(element, index, value, JSObject::cast(pt));
- return true;
+ *found = true;
+ return SetElementWithCallback(
+ dictionary->ValueAt(entry), index, value, JSObject::cast(pt));
}
}
}
- return false;
+ *found = false;
+ return Heap::the_hole_value();
}
@@ -2774,6 +2776,13 @@
MaybeObject* JSObject::PreventExtensions() {
+ if (IsJSGlobalProxy()) {
+ Object* proto = GetPrototype();
+ if (proto->IsNull()) return this;
+ ASSERT(proto->IsJSGlobalObject());
+ return JSObject::cast(proto)->PreventExtensions();
+ }
+
// If there are fast elements we normalize.
if (HasFastElements()) {
Object* ok;
@@ -6957,9 +6966,11 @@
uint32_t elms_length = static_cast<uint32_t>(elms->length());
if (check_prototype &&
- (index >= elms_length || elms->get(index)->IsTheHole()) &&
- SetElementWithCallbackSetterInPrototypes(index, value)) {
- return value;
+ (index >= elms_length || elms->get(index)->IsTheHole())) {
+ bool found;
+ MaybeObject* result =
+ SetElementWithCallbackSetterInPrototypes(index, value, &found);
+ if (found) return result;
}
@@ -7091,9 +7102,11 @@
}
} else {
// Index not already used. Look for an accessor in the prototype chain.
- if (check_prototype &&
- SetElementWithCallbackSetterInPrototypes(index, value)) {
- return value;
+ if (check_prototype) {
+ bool found;
+ MaybeObject* result =
+ SetElementWithCallbackSetterInPrototypes(index, value, &found);
+ if (found) return result;
}
// When we set the is_extensible flag to false we always force
// the element into dictionary mode (and force them to stay there).

Powered by Google App Engine
This is Rietveld 408576698