Index: src/x64/macro-assembler-x64.cc |
=================================================================== |
--- src/x64/macro-assembler-x64.cc (revision 8124) |
+++ src/x64/macro-assembler-x64.cc (working copy) |
@@ -44,7 +44,6 @@ |
: Assembler(arg_isolate, buffer, size), |
generating_stub_(false), |
allow_stub_calls_(true), |
- has_frame_(false), |
root_array_available_(true) { |
if (isolate() != NULL) { |
code_object_ = Handle<Object>(isolate()->heap()->undefined_value(), |
@@ -398,7 +397,7 @@ |
Label L; |
j(cc, &L, Label::kNear); |
Abort(msg); |
- // Control will not return here. |
+ // will not return here |
bind(&L); |
} |
@@ -446,6 +445,9 @@ |
RecordComment(msg); |
} |
#endif |
+ // Disable stub call restrictions to always allow calls to abort. |
+ AllowStubCallsScope allow_scope(this, true); |
+ |
push(rax); |
movq(kScratchRegister, p0, RelocInfo::NONE); |
push(kScratchRegister); |
@@ -453,28 +455,20 @@ |
reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(p1 - p0))), |
RelocInfo::NONE); |
push(kScratchRegister); |
- |
- if (!has_frame_) { |
- // We don't actually want to generate a pile of code for this, so just |
- // claim there is a stack frame, without generating one. |
- FrameScope scope(this, StackFrame::NONE); |
- CallRuntime(Runtime::kAbort, 2); |
- } else { |
- CallRuntime(Runtime::kAbort, 2); |
- } |
- // Control will not return here. |
+ CallRuntime(Runtime::kAbort, 2); |
+ // will not return here |
int3(); |
} |
void MacroAssembler::CallStub(CodeStub* stub, unsigned ast_id) { |
- ASSERT(AllowThisStubCall(stub)); // Calls are not allowed in some stubs |
+ ASSERT(allow_stub_calls()); // calls are not allowed in some stubs |
Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id); |
} |
MaybeObject* MacroAssembler::TryCallStub(CodeStub* stub) { |
- ASSERT(AllowThisStubCall(stub)); // Calls are not allowed in some stubs. |
+ ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs. |
MaybeObject* result = stub->TryGetCode(); |
if (!result->IsFailure()) { |
call(Handle<Code>(Code::cast(result->ToObjectUnchecked())), |
@@ -485,12 +479,13 @@ |
void MacroAssembler::TailCallStub(CodeStub* stub) { |
- ASSERT(stub->CompilingCallsToThisStubIsGCSafe() || allow_stub_calls_); |
+ ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs. |
Jump(stub->GetCode(), RelocInfo::CODE_TARGET); |
} |
MaybeObject* MacroAssembler::TryTailCallStub(CodeStub* stub) { |
+ ASSERT(allow_stub_calls()); // Calls are not allowed in some stubs. |
MaybeObject* result = stub->TryGetCode(); |
if (!result->IsFailure()) { |
jmp(Handle<Code>(Code::cast(result->ToObjectUnchecked())), |
@@ -506,12 +501,6 @@ |
} |
-bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { |
- if (!has_frame_ && stub->SometimesSetsUpAFrame()) return false; |
- return stub->CompilingCallsToThisStubIsGCSafe() || allow_stub_calls_; |
-} |
- |
- |
void MacroAssembler::IllegalOperation(int num_arguments) { |
if (num_arguments > 0) { |
addq(rsp, Immediate(num_arguments * kPointerSize)); |
@@ -803,8 +792,8 @@ |
void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, |
InvokeFlag flag, |
const CallWrapper& call_wrapper) { |
- // You can't call a builtin without a valid frame. |
- ASSERT(flag == JUMP_FUNCTION || has_frame()); |
+ // Calls are not allowed in some stubs. |
+ ASSERT(flag == JUMP_FUNCTION || allow_stub_calls()); |
// Rely on the assertion to check that the number of provided |
// arguments match the expected number of arguments. Fake a |
@@ -2782,10 +2771,10 @@ |
#ifdef ENABLE_DEBUGGER_SUPPORT |
void MacroAssembler::DebugBreak() { |
+ ASSERT(allow_stub_calls()); |
Set(rax, 0); // No arguments. |
LoadAddress(rbx, ExternalReference(Runtime::kDebugBreak, isolate())); |
CEntryStub ces(1); |
- ASSERT(AllowThisStubCall(&ces)); |
Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); |
} |
#endif // ENABLE_DEBUGGER_SUPPORT |
@@ -2811,9 +2800,6 @@ |
InvokeFlag flag, |
const CallWrapper& call_wrapper, |
CallKind call_kind) { |
- // You can't call a function without a valid frame. |
- ASSERT(flag == JUMP_FUNCTION || has_frame()); |
- |
Label done; |
InvokePrologue(expected, |
actual, |
@@ -2845,9 +2831,6 @@ |
InvokeFlag flag, |
const CallWrapper& call_wrapper, |
CallKind call_kind) { |
- // You can't call a function without a valid frame. |
- ASSERT(flag == JUMP_FUNCTION || has_frame()); |
- |
Label done; |
Register dummy = rax; |
InvokePrologue(expected, |
@@ -2878,9 +2861,6 @@ |
InvokeFlag flag, |
const CallWrapper& call_wrapper, |
CallKind call_kind) { |
- // You can't call a function without a valid frame. |
- ASSERT(flag == JUMP_FUNCTION || has_frame()); |
- |
ASSERT(function.is(rdi)); |
movq(rdx, FieldOperand(function, JSFunction::kSharedFunctionInfoOffset)); |
movq(rsi, FieldOperand(function, JSFunction::kContextOffset)); |
@@ -2900,9 +2880,6 @@ |
InvokeFlag flag, |
const CallWrapper& call_wrapper, |
CallKind call_kind) { |
- // You can't call a function without a valid frame. |
- ASSERT(flag == JUMP_FUNCTION || has_frame()); |
- |
ASSERT(function->is_compiled()); |
// Get the function and setup the context. |
Move(rdi, Handle<JSFunction>(function)); |
@@ -3731,7 +3708,6 @@ |
void MacroAssembler::CallCFunction(Register function, int num_arguments) { |
- ASSERT(has_frame()); |
// Check stack alignment. |
if (emit_debug_code()) { |
CheckStackAlignment(); |