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

Unified Diff: src/accessors.cc

Issue 653593002: Catch exceptions thrown when enqueuing change records. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/accessors.h ('k') | src/bootstrapper.cc » ('j') | src/objects.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/accessors.cc
diff --git a/src/accessors.cc b/src/accessors.cc
index 9bd6e5bb2c1b9bba335606f1ce6e3c1f47c04e92..f99056f35eb3a9c959ab446a02856faf16a5d30f 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -172,7 +172,10 @@ void Accessors::ArgumentsIteratorSetter(
LookupIterator it(object, Utils::OpenHandle(*name));
CHECK_EQ(LookupIterator::ACCESSOR, it.state());
DCHECK(it.HolderIsReceiverOrHiddenPrototype());
- Object::SetDataProperty(&it, value);
+
+ if (Object::SetDataProperty(&it, value).is_null()) {
+ isolate->OptionalRescheduleException(false);
+ }
}
@@ -247,7 +250,7 @@ void Accessors::ArrayLengthSetter(
if (uint32_v->Number() == number_v->Number()) {
maybe = JSArray::SetElementsLength(array_handle, uint32_v);
- maybe.Check();
+ if (maybe.is_null()) isolate->OptionalRescheduleException(false);
return;
}
@@ -881,9 +884,9 @@ static Handle<Object> GetFunctionPrototype(Isolate* isolate,
}
-static Handle<Object> SetFunctionPrototype(Isolate* isolate,
- Handle<JSFunction> function,
- Handle<Object> value) {
+static MaybeHandle<Object> SetFunctionPrototype(Isolate* isolate,
Igor Sheludko 2014/10/13 10:47:24 MUST_USE_RESULT?
+ Handle<JSFunction> function,
+ Handle<Object> value) {
Handle<Object> old_value;
bool is_observed = function->map()->is_observed();
if (is_observed) {
@@ -897,16 +900,20 @@ static Handle<Object> SetFunctionPrototype(Isolate* isolate,
DCHECK(function->prototype() == *value);
if (is_observed && !old_value->SameValue(*value)) {
- JSObject::EnqueueChangeRecord(
+ MaybeHandle<Object> result = JSObject::EnqueueChangeRecord(
function, "update", isolate->factory()->prototype_string(), old_value);
+ if (result.is_null()) {
+ isolate->OptionalRescheduleException(false);
+ return MaybeHandle<Object>();
+ }
}
return function;
}
-Handle<Object> Accessors::FunctionSetPrototype(Handle<JSFunction> function,
- Handle<Object> prototype) {
+MaybeHandle<Object> Accessors::FunctionSetPrototype(Handle<JSFunction> function,
+ Handle<Object> prototype) {
DCHECK(function->should_have_prototype());
Isolate* isolate = function->GetIsolate();
return SetFunctionPrototype(isolate, function, prototype);
« no previous file with comments | « src/accessors.h ('k') | src/bootstrapper.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698