| Index: src/ia32/full-codegen-ia32.cc
|
| diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
|
| index 4f3274436a6585d16fe02a13b3c9fb1deec9d7ad..643c95744f9a8c78449ad0d2fd49abdc9c1b9660 100644
|
| --- a/src/ia32/full-codegen-ia32.cc
|
| +++ b/src/ia32/full-codegen-ia32.cc
|
| @@ -2130,27 +2130,18 @@ void FullCodeGenerator::EmitCallWithStub(Call* expr, CallFunctionFlags flags) {
|
| SetSourcePosition(expr->position());
|
|
|
| // Record call targets in unoptimized code, but not in the snapshot.
|
| - bool record_call_target = !Serializer::enabled();
|
| - if (record_call_target) {
|
| + if (!Serializer::enabled()) {
|
| flags = static_cast<CallFunctionFlags>(flags | RECORD_CALL_TARGET);
|
| + Handle<Object> uninitialized = CacheCells::UninitializedSentinel(isolate());
|
| + Handle<JSGlobalPropertyCell> cell =
|
| + isolate()->factory()->NewJSGlobalPropertyCell(uninitialized);
|
| + RecordCacheCell(expr->id(), cell);
|
| + __ mov(ebx, cell);
|
| }
|
| +
|
| CallFunctionStub stub(arg_count, flags);
|
| __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize));
|
| __ CallStub(&stub, expr->id());
|
| - if (record_call_target) {
|
| - // There is a one element cache in the instruction stream.
|
| -#ifdef DEBUG
|
| - int return_site_offset = masm()->pc_offset();
|
| -#endif
|
| - Handle<Object> uninitialized =
|
| - CallFunctionStub::UninitializedSentinel(isolate());
|
| - Handle<JSGlobalPropertyCell> cell =
|
| - isolate()->factory()->NewJSGlobalPropertyCell(uninitialized);
|
| - __ test(eax, Immediate(cell));
|
| - // Patching code in the stub assumes the opcode is 1 byte and there is
|
| - // word for a pointer in the operand.
|
| - ASSERT(masm()->pc_offset() - return_site_offset >= 1 + kPointerSize);
|
| - }
|
|
|
| RecordJSReturnSite(expr);
|
| // Restore context register.
|
| @@ -2325,9 +2316,21 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
|
| __ SafeSet(eax, Immediate(arg_count));
|
| __ mov(edi, Operand(esp, arg_count * kPointerSize));
|
|
|
| - Handle<Code> construct_builtin =
|
| - isolate()->builtins()->JSConstructCall();
|
| - __ call(construct_builtin, RelocInfo::CONSTRUCT_CALL);
|
| + // Record call targets in unoptimized code, but not in the snapshot.
|
| + CallFunctionFlags flags;
|
| + if (!Serializer::enabled()) {
|
| + flags = RECORD_CALL_TARGET;
|
| + Handle<Object> uninitialized = CacheCells::UninitializedSentinel(isolate());
|
| + Handle<JSGlobalPropertyCell> cell =
|
| + isolate()->factory()->NewJSGlobalPropertyCell(uninitialized);
|
| + RecordCacheCell(expr->id(), cell);
|
| + __ mov(ebx, cell);
|
| + } else {
|
| + flags = NO_CALL_FUNCTION_FLAGS;
|
| + }
|
| +
|
| + CallConstructStub stub(flags);
|
| + __ call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL);
|
| context()->Plug(eax);
|
| }
|
|
|
|
|