| Index: src/ia32/macro-assembler-ia32.cc
|
| diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
|
| index 0bb6894097df50e809dd94c43618699ff860daca..826a4fbe01576bf24ac41f0988690046be4380ad 100644
|
| --- a/src/ia32/macro-assembler-ia32.cc
|
| +++ b/src/ia32/macro-assembler-ia32.cc
|
| @@ -1145,6 +1145,16 @@ void MacroAssembler::CallRuntime(Runtime::Function* f, int num_arguments) {
|
| }
|
|
|
|
|
| +void MacroAssembler::CallExternalReference(ExternalReference ref,
|
| + int num_arguments) {
|
| + mov(eax, Immediate(num_arguments));
|
| + mov(ebx, Immediate(ref));
|
| +
|
| + CEntryStub stub(1);
|
| + CallStub(&stub);
|
| +}
|
| +
|
| +
|
| Object* MacroAssembler::TryCallRuntime(Runtime::Function* f,
|
| int num_arguments) {
|
| if (f->nargs >= 0 && f->nargs != num_arguments) {
|
| @@ -1365,6 +1375,20 @@ void MacroAssembler::InvokeFunction(Register fun,
|
| }
|
|
|
|
|
| +void MacroAssembler::InvokeFunction(JSFunction* function,
|
| + const ParameterCount& actual) {
|
| + ASSERT(function->is_compiled());
|
| + // Get the function and setup the context.
|
| + mov(edi, Immediate(Handle<JSFunction>(function)));
|
| + mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
|
| +
|
| + // Jump to the cached code (tail call).
|
| + Handle<Code> code(function->code());
|
| + ParameterCount expected(function->shared()->formal_parameter_count());
|
| + InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, JUMP_FUNCTION);
|
| +}
|
| +
|
| +
|
| void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag) {
|
| // Calls are not allowed in some stubs.
|
| ASSERT(flag == JUMP_FUNCTION || allow_stub_calls());
|
|
|