Index: src/ia32/macro-assembler-ia32.cc |
=================================================================== |
--- src/ia32/macro-assembler-ia32.cc (revision 3434) |
+++ src/ia32/macro-assembler-ia32.cc (working copy) |
@@ -1015,17 +1015,37 @@ |
void MacroAssembler::CallStub(CodeStub* stub) { |
- ASSERT(allow_stub_calls()); // calls are not allowed in some stubs |
+ ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs. |
call(stub->GetCode(), RelocInfo::CODE_TARGET); |
} |
+Object* MacroAssembler::TryCallStub(CodeStub* stub) { |
+ ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs. |
+ Object* result = stub->TryGetCode(); |
+ if (!result->IsFailure()) { |
+ call(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET); |
+ } |
+ return result; |
+} |
+ |
+ |
void MacroAssembler::TailCallStub(CodeStub* stub) { |
- ASSERT(allow_stub_calls()); // calls are not allowed in some stubs |
+ ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs. |
jmp(stub->GetCode(), RelocInfo::CODE_TARGET); |
} |
+Object* MacroAssembler::TryTailCallStub(CodeStub* stub) { |
+ ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs. |
+ Object* result = stub->TryGetCode(); |
+ if (!result->IsFailure()) { |
+ jmp(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET); |
+ } |
+ return result; |
+} |
+ |
+ |
void MacroAssembler::StubReturn(int argc) { |
ASSERT(argc >= 1 && generating_stub()); |
ret((argc - 1) * kPointerSize); |