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

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: addressed comment 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') | no next file with comments »
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..ed9d2940e623fc518fc7c7e677144167ee36d150 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,8 @@ static Handle<Object> GetFunctionPrototype(Isolate* isolate,
}
-static Handle<Object> SetFunctionPrototype(Isolate* isolate,
- Handle<JSFunction> function,
- Handle<Object> value) {
+MUST_USE_RESULT static MaybeHandle<Object> SetFunctionPrototype(
+ Isolate* isolate, Handle<JSFunction> function, Handle<Object> value) {
Handle<Object> old_value;
bool is_observed = function->map()->is_observed();
if (is_observed) {
@@ -897,16 +899,17 @@ 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()) 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);
@@ -937,7 +940,9 @@ void Accessors::FunctionPrototypeSetter(
}
Handle<JSFunction> object =
Handle<JSFunction>::cast(Utils::OpenHandle(*info.Holder()));
- SetFunctionPrototype(isolate, object, value);
+ if (SetFunctionPrototype(isolate, object, value).is_null()) {
+ isolate->OptionalRescheduleException(false);
+ }
}
« no previous file with comments | « src/accessors.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698