ExternalReference::address_of_has_pending_message(isolate());
__ mov(ip, Operand(has_pending_message));
__ ldr(r1, MemOperand(ip));
+ __ SmiTag(r1);
__ push(r1);
ExternalReference pending_message_script =
__ str(r1, MemOperand(ip));
__ pop(r1);
+ __ SmiUntag(r1);
ExternalReference has_pending_message =
ExternalReference::address_of_has_pending_message(isolate());
__ mov(ip, Operand(has_pending_message));
ExternalReference has_pending_message =
ExternalReference::address_of_has_pending_message(isolate());
__ mov(edx, Operand::StaticVariable(has_pending_message));
+ __ SmiTag(edx);
__ push(edx);
ExternalReference pending_message_script =
__ mov(Operand::StaticVariable(pending_message_script), edx);
__ pop(edx);
+ __ SmiUntag(edx);
ExternalReference has_pending_message =
ExternalReference::address_of_has_pending_message(isolate());
__ mov(Operand::StaticVariable(has_pending_message), edx);
ExternalReference::address_of_has_pending_message(isolate());
__ li(at, Operand(has_pending_message));
__ lw(a1, MemOperand(at));
+ __ SmiTag(a1);
__ push(a1);
ExternalReference pending_message_script =
__ sw(a1, MemOperand(at));
__ pop(a1);
+ __ SmiUntag(a1);
ExternalReference has_pending_message =
ExternalReference::address_of_has_pending_message(isolate());
__ li(at, Operand(has_pending_message));
ExternalReference has_pending_message =
ExternalReference::address_of_has_pending_message(isolate());
__ Load(rdx, has_pending_message);
+ __ Integer32ToSmi(rdx, rdx);
__ push(rdx);
ExternalReference pending_message_script =
__ Store(pending_message_script, rdx);
__ pop(rdx);
+ __ SmiToInteger32(rdx, rdx);
ExternalReference has_pending_message =
ExternalReference::address_of_has_pending_message(isolate());
__ Store(has_pending_message, rdx);
"var result = f(obj);");
CHECK(context->Global()->Get(v8_str("result"))->IsUndefined());
}
+
+
+THREADED_TEST(Regress137496) {
+ i::FLAG_expose_gc = true;
+ v8::HandleScope scope;
+ LocalContext context;
+
+ // Compile a try-finally clause where the finally block causes a GC
+ // while there still is a message pending for external reporting.
+ TryCatch try_catch;
+ try_catch.SetVerbose(true);
+ CompileRun("try { throw new Error(); } finally { gc(); }");
+ CHECK(try_catch.HasCaught());
+}