| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index 01c340c77b92ad408861622450f7afc662aa0377..a1f04a270ecddb31bc5da7e8010f9de81a3b1459 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -3116,8 +3116,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ResumeJSGeneratorObject) {
|
| ASSERT_EQ(frame->function(), generator_object->function());
|
| ASSERT(frame->function()->is_compiled());
|
|
|
| - STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting <= 0);
|
| - STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed <= 0);
|
| + STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting < 0);
|
| + STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed == 0);
|
|
|
| Address pc = generator_object->function()->code()->instruction_start();
|
| int offset = generator_object->continuation();
|
| @@ -14328,14 +14328,19 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyContextDisposed) {
|
| }
|
|
|
|
|
| -RUNTIME_FUNCTION(MaybeObject*, Runtime_MigrateInstance) {
|
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_TryMigrateInstance) {
|
| HandleScope scope(isolate);
|
| ASSERT(args.length() == 1);
|
| CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
|
| if (!object->IsJSObject()) return Smi::FromInt(0);
|
| Handle<JSObject> js_object = Handle<JSObject>::cast(object);
|
| if (!js_object->map()->is_deprecated()) return Smi::FromInt(0);
|
| - JSObject::MigrateInstance(js_object);
|
| + // This call must not cause lazy deopts, because it's called from deferred
|
| + // code where we can't handle lazy deopts for lack of a suitable bailout
|
| + // ID. So we just try migration and signal failure if necessary,
|
| + // which will also trigger a deopt.
|
| + Handle<Object> result = JSObject::TryMigrateInstance(js_object);
|
| + if (result.is_null()) return Smi::FromInt(0);
|
| return *object;
|
| }
|
|
|
|
|