diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index c6b40ee46d..33b6731633 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -46,7 +46,7 @@ class SafepointGenerator : public CallWrapper { deoptimization_index_(deoptimization_index) { } virtual ~SafepointGenerator() { } - virtual void BeforeCall(int call_size) { + virtual void BeforeCall(int call_size) const { ASSERT(call_size >= 0); // Ensure that we have enough space after the previous safepoint position // for the generated code there. @@ -63,7 +63,7 @@ class SafepointGenerator : public CallWrapper { } } - virtual void AfterCall() { + virtual void AfterCall() const { codegen_->RecordSafepoint(pointers_, deoptimization_index_); } @@ -2641,7 +2641,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) { // The number of arguments is stored in receiver which is r0, as expected // by InvokeFunction. v8::internal::ParameterCount actual(receiver); - __ InvokeFunction(function, actual, CALL_FUNCTION, &safepoint_generator); + __ InvokeFunction(function, actual, CALL_FUNCTION, safepoint_generator); __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); } @@ -3084,7 +3084,7 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { RegisterEnvironmentForDeoptimization(env); SafepointGenerator generator(this, pointers, env->deoptimization_index()); ParameterCount count(instr->arity()); - __ InvokeFunction(r1, count, CALL_FUNCTION, &generator); + __ InvokeFunction(r1, count, CALL_FUNCTION, generator); __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); } @@ -4256,7 +4256,7 @@ void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { SafepointGenerator safepoint_generator(this, pointers, env->deoptimization_index()); - __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, &safepoint_generator); + __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator); } @@ -4272,7 +4272,7 @@ void LCodeGen::DoIn(LIn* instr) { SafepointGenerator safepoint_generator(this, pointers, env->deoptimization_index()); - __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, &safepoint_generator); + __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); } diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc index eeaba733ee..3f2b01ea2c 100644 --- a/src/arm/macro-assembler-arm.cc +++ b/src/arm/macro-assembler-arm.cc @@ -886,7 +886,7 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected, Register code_reg, Label* done, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { bool definitely_matches = false; Label regular_invoke; @@ -941,11 +941,9 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected, Handle adaptor = isolate()->builtins()->ArgumentsAdaptorTrampoline(); if (flag == CALL_FUNCTION) { - if (call_wrapper != NULL) { - call_wrapper->BeforeCall(CallSize(adaptor, RelocInfo::CODE_TARGET)); - } + call_wrapper.BeforeCall(CallSize(adaptor, RelocInfo::CODE_TARGET)); Call(adaptor, RelocInfo::CODE_TARGET); - if (call_wrapper != NULL) call_wrapper->AfterCall(); + call_wrapper.AfterCall(); b(done); } else { Jump(adaptor, RelocInfo::CODE_TARGET); @@ -959,15 +957,15 @@ void MacroAssembler::InvokeCode(Register code, const ParameterCount& expected, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { Label done; InvokePrologue(expected, actual, Handle::null(), code, &done, flag, call_wrapper); if (flag == CALL_FUNCTION) { - if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(code)); + call_wrapper.BeforeCall(CallSize(code)); Call(code); - if (call_wrapper != NULL) call_wrapper->AfterCall(); + call_wrapper.AfterCall(); } else { ASSERT(flag == JUMP_FUNCTION); Jump(code); @@ -1002,7 +1000,7 @@ void MacroAssembler::InvokeCode(Handle code, void MacroAssembler::InvokeFunction(Register fun, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { // Contract with called JS functions requires that function is passed in r1. ASSERT(fun.is(r1)); @@ -2314,12 +2312,12 @@ MaybeObject* MacroAssembler::TryJumpToExternalReference( void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { GetBuiltinEntry(r2, id); if (flag == CALL_FUNCTION) { - if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(r2)); + call_wrapper.BeforeCall(CallSize(r2)); Call(r2); - if (call_wrapper != NULL) call_wrapper->AfterCall(); + call_wrapper.AfterCall(); } else { ASSERT(flag == JUMP_FUNCTION); Jump(r2); diff --git a/src/arm/macro-assembler-arm.h b/src/arm/macro-assembler-arm.h index ba35769d8c..ca6b015714 100644 --- a/src/arm/macro-assembler-arm.h +++ b/src/arm/macro-assembler-arm.h @@ -350,7 +350,7 @@ class MacroAssembler: public Assembler { const ParameterCount& expected, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); void InvokeCode(Handle code, const ParameterCount& expected, @@ -363,7 +363,7 @@ class MacroAssembler: public Assembler { void InvokeFunction(Register function, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); void InvokeFunction(JSFunction* function, const ParameterCount& actual, @@ -799,7 +799,7 @@ class MacroAssembler: public Assembler { // the unresolved list if the name does not resolve. void InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); // Store the code object for the given builtin in the target register and // setup the function in r1. @@ -1002,7 +1002,7 @@ class MacroAssembler: public Assembler { Register code_reg, Label* done, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); // Activation support. void EnterFrame(StackFrame::Type type); diff --git a/src/assembler.h b/src/assembler.h index 4cc352b819..ef4ddc0cda 100644 --- a/src/assembler.h +++ b/src/assembler.h @@ -852,9 +852,17 @@ class CallWrapper { virtual ~CallWrapper() { } // Called just before emitting a call. Argument is the size of the generated // call code. - virtual void BeforeCall(int call_size) = 0; + virtual void BeforeCall(int call_size) const = 0; // Called just after emitting a call, i.e., at the return site for the call. - virtual void AfterCall() = 0; + virtual void AfterCall() const = 0; +}; + +class NullCallWrapper : public CallWrapper { + public: + NullCallWrapper() { } + virtual ~NullCallWrapper() { } + virtual void BeforeCall(int call_size) const { } + virtual void AfterCall() const { } }; } } // namespace v8::internal diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index c94b6563c4..25138df9de 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -50,9 +50,9 @@ class SafepointGenerator : public CallWrapper { deoptimization_index_(deoptimization_index) {} virtual ~SafepointGenerator() { } - virtual void BeforeCall(int call_size) {} + virtual void BeforeCall(int call_size) const {} - virtual void AfterCall() { + virtual void AfterCall() const { codegen_->RecordSafepoint(pointers_, deoptimization_index_); } @@ -2552,7 +2552,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) { pointers, env->deoptimization_index()); ParameterCount actual(eax); - __ InvokeFunction(function, actual, CALL_FUNCTION, &safepoint_generator); + __ InvokeFunction(function, actual, CALL_FUNCTION, safepoint_generator); } @@ -2974,7 +2974,7 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { RegisterEnvironmentForDeoptimization(env); SafepointGenerator generator(this, pointers, env->deoptimization_index()); ParameterCount count(instr->arity()); - __ InvokeFunction(edi, count, CALL_FUNCTION, &generator); + __ InvokeFunction(edi, count, CALL_FUNCTION, generator); } @@ -4237,7 +4237,7 @@ void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { env->deoptimization_index()); __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); __ push(Immediate(Smi::FromInt(strict_mode_flag()))); - __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, &safepoint_generator); + __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator); } @@ -4297,7 +4297,7 @@ void LCodeGen::DoIn(LIn* instr) { pointers, env->deoptimization_index()); __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); - __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, &safepoint_generator); + __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); } diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc index 92464b7679..f13585d0d6 100644 --- a/src/ia32/macro-assembler-ia32.cc +++ b/src/ia32/macro-assembler-ia32.cc @@ -1435,7 +1435,7 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected, const Operand& code_operand, NearLabel* done, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { bool definitely_matches = false; Label invoke; if (expected.is_immediate()) { @@ -1485,11 +1485,9 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected, } if (flag == CALL_FUNCTION) { - if (call_wrapper != NULL) { - call_wrapper->BeforeCall(CallSize(adaptor, RelocInfo::CODE_TARGET)); - } + call_wrapper.BeforeCall(CallSize(adaptor, RelocInfo::CODE_TARGET)); call(adaptor, RelocInfo::CODE_TARGET); - if (call_wrapper != NULL) call_wrapper->AfterCall(); + call_wrapper.AfterCall(); jmp(done); } else { jmp(adaptor, RelocInfo::CODE_TARGET); @@ -1503,14 +1501,14 @@ void MacroAssembler::InvokeCode(const Operand& code, const ParameterCount& expected, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { NearLabel done; InvokePrologue(expected, actual, Handle::null(), code, &done, flag, call_wrapper); if (flag == CALL_FUNCTION) { - if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(code)); + call_wrapper.BeforeCall(CallSize(code)); call(code); - if (call_wrapper != NULL) call_wrapper->AfterCall(); + call_wrapper.AfterCall(); } else { ASSERT(flag == JUMP_FUNCTION); jmp(code); @@ -1524,14 +1522,14 @@ void MacroAssembler::InvokeCode(Handle code, const ParameterCount& actual, RelocInfo::Mode rmode, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { NearLabel done; Operand dummy(eax); InvokePrologue(expected, actual, code, dummy, &done, flag, call_wrapper); if (flag == CALL_FUNCTION) { - if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(code, rmode)); + call_wrapper.BeforeCall(CallSize(code, rmode)); call(code, rmode); - if (call_wrapper != NULL) call_wrapper->AfterCall(); + call_wrapper.AfterCall(); } else { ASSERT(flag == JUMP_FUNCTION); jmp(code, rmode); @@ -1543,7 +1541,7 @@ void MacroAssembler::InvokeCode(Handle code, void MacroAssembler::InvokeFunction(Register fun, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { ASSERT(fun.is(edi)); mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); @@ -1559,7 +1557,7 @@ void MacroAssembler::InvokeFunction(Register fun, void MacroAssembler::InvokeFunction(JSFunction* function, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { ASSERT(function->is_compiled()); // Get the function and setup the context. mov(edi, Immediate(Handle(function))); @@ -1582,7 +1580,7 @@ void MacroAssembler::InvokeFunction(JSFunction* function, void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { // Calls are not allowed in some stubs. ASSERT(flag == JUMP_FUNCTION || allow_stub_calls()); diff --git a/src/ia32/macro-assembler-ia32.h b/src/ia32/macro-assembler-ia32.h index cb0081bdb4..ee8c0c79b6 100644 --- a/src/ia32/macro-assembler-ia32.h +++ b/src/ia32/macro-assembler-ia32.h @@ -157,32 +157,32 @@ class MacroAssembler: public Assembler { const ParameterCount& expected, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); void InvokeCode(Handle code, const ParameterCount& expected, const ParameterCount& actual, RelocInfo::Mode rmode, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); // Invoke the JavaScript function in the given register. Changes the // current context to the context in the function before invoking. void InvokeFunction(Register function, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); void InvokeFunction(JSFunction* function, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); // Invoke specified builtin JavaScript function. Adds an entry to // the unresolved list if the name does not resolve. void InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); // Store the function for the given builtin in the target register. void GetBuiltinFunction(Register target, Builtins::JavaScript id); @@ -649,7 +649,7 @@ class MacroAssembler: public Assembler { const Operand& code_operand, NearLabel* done, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); // Activation support. void EnterFrame(StackFrame::Type type); diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc index 03e243ccd9..f24ed6ff0e 100644 --- a/src/mips/macro-assembler-mips.cc +++ b/src/mips/macro-assembler-mips.cc @@ -2255,7 +2255,7 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected, Register code_reg, Label* done, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { bool definitely_matches = false; Label regular_invoke; @@ -2308,11 +2308,9 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected, Handle adaptor = isolate()->builtins()->ArgumentsAdaptorTrampoline(); if (flag == CALL_FUNCTION) { - if (call_wrapper != NULL) { - call_wrapper->BeforeCall(CallSize(adaptor, RelocInfo::CODE_TARGET)); - } + call_wrapper.BeforeCall(CallSize(adaptor, RelocInfo::CODE_TARGET)); Call(adaptor, RelocInfo::CODE_TARGET); - if (call_wrapper != NULL) call_wrapper->AfterCall(); + call_wrapper.AfterCall(); jmp(done); } else { Jump(adaptor, RelocInfo::CODE_TARGET); @@ -2326,7 +2324,7 @@ void MacroAssembler::InvokeCode(Register code, const ParameterCount& expected, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { Label done; InvokePrologue(expected, actual, Handle::null(), code, &done, flag, @@ -2365,7 +2363,7 @@ void MacroAssembler::InvokeCode(Handle code, void MacroAssembler::InvokeFunction(Register function, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { // Contract with called JS functions requires that function is passed in a1. ASSERT(function.is(a1)); Register expected_reg = a2; @@ -2657,12 +2655,12 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) { void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { GetBuiltinEntry(t9, id); if (flag == CALL_FUNCTION) { - if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(t9)); + call_wrapper.BeforeCall(CallSize(t9)); Call(t9); - if (call_wrapper != NULL) call_wrapper->AfterCall(); + call_wrapper.AfterCall(); } else { ASSERT(flag == JUMP_FUNCTION); Jump(t9); diff --git a/src/mips/macro-assembler-mips.h b/src/mips/macro-assembler-mips.h index 0e6393cee7..266ef71297 100644 --- a/src/mips/macro-assembler-mips.h +++ b/src/mips/macro-assembler-mips.h @@ -587,7 +587,7 @@ DECLARE_NOTARGET_PROTOTYPE(Ret) const ParameterCount& expected, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); void InvokeCode(Handle code, const ParameterCount& expected, @@ -600,7 +600,7 @@ DECLARE_NOTARGET_PROTOTYPE(Ret) void InvokeFunction(Register function, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); void InvokeFunction(JSFunction* function, const ParameterCount& actual, @@ -770,7 +770,7 @@ DECLARE_NOTARGET_PROTOTYPE(Ret) // the unresolved list if the name does not resolve. void InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); // Store the code object for the given builtin in the target register and // setup the function in a1. @@ -953,7 +953,7 @@ DECLARE_NOTARGET_PROTOTYPE(Ret) Register code_reg, Label* done, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); // Get the code for the given builtin. Returns if able to resolve // the function in the 'resolved' flag. diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index 388d69814d..5b45b136e7 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -49,7 +49,7 @@ class SafepointGenerator : public CallWrapper { deoptimization_index_(deoptimization_index) { } virtual ~SafepointGenerator() { } - virtual void BeforeCall(int call_size) { + virtual void BeforeCall(int call_size) const { ASSERT(call_size >= 0); // Ensure that we have enough space after the previous safepoint position // for the jump generated there. @@ -62,7 +62,7 @@ class SafepointGenerator : public CallWrapper { } } - virtual void AfterCall() { + virtual void AfterCall() const { codegen_->RecordSafepoint(pointers_, deoptimization_index_); } @@ -2562,7 +2562,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) { pointers, env->deoptimization_index()); v8::internal::ParameterCount actual(rax); - __ InvokeFunction(function, actual, CALL_FUNCTION, &safepoint_generator); + __ InvokeFunction(function, actual, CALL_FUNCTION, safepoint_generator); __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); } @@ -2969,7 +2969,7 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { RegisterEnvironmentForDeoptimization(env); SafepointGenerator generator(this, pointers, env->deoptimization_index()); ParameterCount count(instr->arity()); - __ InvokeFunction(rdi, count, CALL_FUNCTION, &generator); + __ InvokeFunction(rdi, count, CALL_FUNCTION, generator); __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); } @@ -4046,7 +4046,7 @@ void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { pointers, env->deoptimization_index()); __ Push(Smi::FromInt(strict_mode_flag())); - __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, &safepoint_generator); + __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator); } @@ -4066,7 +4066,7 @@ void LCodeGen::DoIn(LIn* instr) { SafepointGenerator safepoint_generator(this, pointers, env->deoptimization_index()); - __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, &safepoint_generator); + __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); } diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc index 24f2fefcd8..5cf959fcd8 100644 --- a/src/x64/macro-assembler-x64.cc +++ b/src/x64/macro-assembler-x64.cc @@ -755,7 +755,7 @@ MaybeObject* MacroAssembler::TryJumpToExternalReference( void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { // Calls are not allowed in some stubs. ASSERT(flag == JUMP_FUNCTION || allow_stub_calls()); @@ -2056,7 +2056,7 @@ void MacroAssembler::InvokeCode(Register code, const ParameterCount& expected, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { NearLabel done; InvokePrologue(expected, actual, @@ -2066,9 +2066,9 @@ void MacroAssembler::InvokeCode(Register code, flag, call_wrapper); if (flag == CALL_FUNCTION) { - if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(code)); + call_wrapper.BeforeCall(CallSize(code)); call(code); - if (call_wrapper != NULL) call_wrapper->AfterCall(); + call_wrapper.AfterCall(); } else { ASSERT(flag == JUMP_FUNCTION); jmp(code); @@ -2082,7 +2082,7 @@ void MacroAssembler::InvokeCode(Handle code, const ParameterCount& actual, RelocInfo::Mode rmode, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { NearLabel done; Register dummy = rax; InvokePrologue(expected, @@ -2093,9 +2093,9 @@ void MacroAssembler::InvokeCode(Handle code, flag, call_wrapper); if (flag == CALL_FUNCTION) { - if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(code)); + call_wrapper.BeforeCall(CallSize(code)); Call(code, rmode); - if (call_wrapper != NULL) call_wrapper->AfterCall(); + call_wrapper.AfterCall(); } else { ASSERT(flag == JUMP_FUNCTION); Jump(code, rmode); @@ -2107,7 +2107,7 @@ void MacroAssembler::InvokeCode(Handle code, void MacroAssembler::InvokeFunction(Register function, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { ASSERT(function.is(rdi)); movq(rdx, FieldOperand(function, JSFunction::kSharedFunctionInfoOffset)); movq(rsi, FieldOperand(function, JSFunction::kContextOffset)); @@ -2125,7 +2125,7 @@ void MacroAssembler::InvokeFunction(Register function, void MacroAssembler::InvokeFunction(JSFunction* function, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { ASSERT(function->is_compiled()); // Get the function and setup the context. Move(rdi, Handle(function)); diff --git a/src/x64/macro-assembler-x64.h b/src/x64/macro-assembler-x64.h index db8bfb9867..400bdce3dc 100644 --- a/src/x64/macro-assembler-x64.h +++ b/src/x64/macro-assembler-x64.h @@ -244,32 +244,32 @@ class MacroAssembler: public Assembler { const ParameterCount& expected, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); void InvokeCode(Handle code, const ParameterCount& expected, const ParameterCount& actual, RelocInfo::Mode rmode, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); // Invoke the JavaScript function in the given register. Changes the // current context to the context in the function before invoking. void InvokeFunction(Register function, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); void InvokeFunction(JSFunction* function, const ParameterCount& actual, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); // Invoke specified builtin JavaScript function. Adds an entry to // the unresolved list if the name does not resolve. void InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag, - CallWrapper* call_wrapper = NULL); + const CallWrapper& call_wrapper = NullCallWrapper()); // Store the function for the given builtin in the target register. void GetBuiltinFunction(Register target, Builtins::JavaScript id); @@ -1126,7 +1126,7 @@ class MacroAssembler: public Assembler { Register code_register, LabelType* done, InvokeFlag flag, - CallWrapper* call_wrapper); + const CallWrapper& call_wrapper); // Activation support. void EnterFrame(StackFrame::Type type); @@ -1936,7 +1936,7 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected, Register code_register, LabelType* done, InvokeFlag flag, - CallWrapper* call_wrapper) { + const CallWrapper& call_wrapper) { bool definitely_matches = false; NearLabel invoke; if (expected.is_immediate()) { @@ -1985,9 +1985,9 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected, } if (flag == CALL_FUNCTION) { - if (call_wrapper != NULL) call_wrapper->BeforeCall(CallSize(adaptor)); + call_wrapper.BeforeCall(CallSize(adaptor)); Call(adaptor, RelocInfo::CODE_TARGET); - if (call_wrapper != NULL) call_wrapper->AfterCall(); + call_wrapper.AfterCall(); jmp(done); } else { Jump(adaptor, RelocInfo::CODE_TARGET);