Don't push eax/rax before calling Runtime_Abort
Additionally delete the unused Throw(BailoutReason) BUG= R=jkummerow@chromium.org Review URL: https://codereview.chromium.org/308083006 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21582 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
a8b2528d7d
commit
f4aa3ab03d
@ -3775,52 +3775,6 @@ void MacroAssembler::ClampDoubleToUint8(Register result_reg,
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::Throw(BailoutReason reason) {
|
||||
Label throw_start;
|
||||
bind(&throw_start);
|
||||
#ifdef DEBUG
|
||||
const char* msg = GetBailoutReason(reason);
|
||||
if (msg != NULL) {
|
||||
RecordComment("Throw message: ");
|
||||
RecordComment(msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
mov(r0, Operand(Smi::FromInt(reason)));
|
||||
push(r0);
|
||||
// Disable stub call restrictions to always allow calls to throw.
|
||||
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::kHiddenThrowMessage, 1);
|
||||
} else {
|
||||
CallRuntime(Runtime::kHiddenThrowMessage, 1);
|
||||
}
|
||||
// will not return here
|
||||
if (is_const_pool_blocked()) {
|
||||
// If the calling code cares throw the exact number of
|
||||
// instructions generated, we insert padding here to keep the size
|
||||
// of the ThrowMessage macro constant.
|
||||
static const int kExpectedThrowMessageInstructions = 10;
|
||||
int throw_instructions = InstructionsGeneratedSince(&throw_start);
|
||||
ASSERT(throw_instructions <= kExpectedThrowMessageInstructions);
|
||||
while (throw_instructions++ < kExpectedThrowMessageInstructions) {
|
||||
nop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::ThrowIf(Condition cc, BailoutReason reason) {
|
||||
Label L;
|
||||
b(NegateCondition(cc), &L);
|
||||
Throw(reason);
|
||||
// will not return here
|
||||
bind(&L);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::LoadInstanceDescriptors(Register map,
|
||||
Register descriptors) {
|
||||
ldr(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset));
|
||||
|
@ -631,12 +631,6 @@ class MacroAssembler: public Assembler {
|
||||
// handler chain.
|
||||
void ThrowUncatchable(Register value);
|
||||
|
||||
// Throw a message string as an exception.
|
||||
void Throw(BailoutReason reason);
|
||||
|
||||
// Throw a message string as an exception if a condition is not true.
|
||||
void ThrowIf(Condition cc, BailoutReason reason);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Inline caching support
|
||||
|
||||
|
@ -1549,48 +1549,6 @@ void MacroAssembler::ThrowUncatchable(Register value,
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::Throw(BailoutReason reason) {
|
||||
Label throw_start;
|
||||
Bind(&throw_start);
|
||||
#ifdef DEBUG
|
||||
const char* msg = GetBailoutReason(reason);
|
||||
RecordComment("Throw message: ");
|
||||
RecordComment((msg != NULL) ? msg : "UNKNOWN");
|
||||
#endif
|
||||
|
||||
Mov(x0, Smi::FromInt(reason));
|
||||
Push(x0);
|
||||
|
||||
// Disable stub call restrictions to always allow calls to throw.
|
||||
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::kHiddenThrowMessage, 1);
|
||||
} else {
|
||||
CallRuntime(Runtime::kHiddenThrowMessage, 1);
|
||||
}
|
||||
// ThrowMessage should not return here.
|
||||
Unreachable();
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::ThrowIf(Condition cond, BailoutReason reason) {
|
||||
Label ok;
|
||||
B(InvertCondition(cond), &ok);
|
||||
Throw(reason);
|
||||
Bind(&ok);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::ThrowIfSmi(const Register& value, BailoutReason reason) {
|
||||
Label ok;
|
||||
JumpIfNotSmi(value, &ok);
|
||||
Throw(reason);
|
||||
Bind(&ok);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::SmiAbs(const Register& smi, Label* slow) {
|
||||
ASSERT(smi.Is64Bits());
|
||||
Abs(smi, smi, slow);
|
||||
|
@ -1072,15 +1072,6 @@ class MacroAssembler : public Assembler {
|
||||
Register scratch3,
|
||||
Register scratch4);
|
||||
|
||||
// Throw a message string as an exception.
|
||||
void Throw(BailoutReason reason);
|
||||
|
||||
// Throw a message string as an exception if a condition is not true.
|
||||
void ThrowIf(Condition cond, BailoutReason reason);
|
||||
|
||||
// Throw a message string as an exception if the value is a smi.
|
||||
void ThrowIfSmi(const Register& value, BailoutReason reason);
|
||||
|
||||
void CallStub(CodeStub* stub, TypeFeedbackId ast_id = TypeFeedbackId::None());
|
||||
void TailCallStub(CodeStub* stub);
|
||||
|
||||
|
@ -2786,7 +2786,6 @@ void MacroAssembler::Abort(BailoutReason reason) {
|
||||
}
|
||||
#endif
|
||||
|
||||
push(eax);
|
||||
push(Immediate(reinterpret_cast<intptr_t>(Smi::FromInt(reason))));
|
||||
// Disable stub call restrictions to always allow calls to abort.
|
||||
if (!has_frame_) {
|
||||
@ -2802,40 +2801,6 @@ void MacroAssembler::Abort(BailoutReason reason) {
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::Throw(BailoutReason reason) {
|
||||
#ifdef DEBUG
|
||||
const char* msg = GetBailoutReason(reason);
|
||||
if (msg != NULL) {
|
||||
RecordComment("Throw message: ");
|
||||
RecordComment(msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
push(eax);
|
||||
push(Immediate(Smi::FromInt(reason)));
|
||||
// Disable stub call restrictions to always allow calls to throw.
|
||||
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::kHiddenThrowMessage, 1);
|
||||
} else {
|
||||
CallRuntime(Runtime::kHiddenThrowMessage, 1);
|
||||
}
|
||||
// will not return here
|
||||
int3();
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::ThrowIf(Condition cc, BailoutReason reason) {
|
||||
Label L;
|
||||
j(NegateCondition(cc), &L);
|
||||
Throw(reason);
|
||||
// will not return here
|
||||
bind(&L);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::LoadInstanceDescriptors(Register map,
|
||||
Register descriptors) {
|
||||
mov(descriptors, FieldOperand(map, Map::kDescriptorsOffset));
|
||||
|
@ -553,12 +553,6 @@ class MacroAssembler: public Assembler {
|
||||
// Throw past all JS frames to the top JS entry frame.
|
||||
void ThrowUncatchable(Register value);
|
||||
|
||||
// Throw a message string as an exception.
|
||||
void Throw(BailoutReason reason);
|
||||
|
||||
// Throw a message string as an exception if a condition is not true.
|
||||
void ThrowIf(Condition cc, BailoutReason reason);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Inline caching support
|
||||
|
||||
|
@ -5407,57 +5407,6 @@ void MacroAssembler::EnsureNotWhite(
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::Throw(BailoutReason reason) {
|
||||
Label throw_start;
|
||||
bind(&throw_start);
|
||||
#ifdef DEBUG
|
||||
const char* msg = GetBailoutReason(reason);
|
||||
if (msg != NULL) {
|
||||
RecordComment("Throw message: ");
|
||||
RecordComment(msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
li(a0, Operand(Smi::FromInt(reason)));
|
||||
push(a0);
|
||||
// Disable stub call restrictions to always allow calls to throw.
|
||||
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::kHiddenThrowMessage, 1);
|
||||
} else {
|
||||
CallRuntime(Runtime::kHiddenThrowMessage, 1);
|
||||
}
|
||||
// will not return here
|
||||
if (is_trampoline_pool_blocked()) {
|
||||
// If the calling code cares throw the exact number of
|
||||
// instructions generated, we insert padding here to keep the size
|
||||
// of the ThrowMessage macro constant.
|
||||
// Currently in debug mode with debug_code enabled the number of
|
||||
// generated instructions is 14, so we use this as a maximum value.
|
||||
static const int kExpectedThrowMessageInstructions = 14;
|
||||
int throw_instructions = InstructionsGeneratedSince(&throw_start);
|
||||
ASSERT(throw_instructions <= kExpectedThrowMessageInstructions);
|
||||
while (throw_instructions++ < kExpectedThrowMessageInstructions) {
|
||||
nop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::ThrowIf(Condition cc,
|
||||
BailoutReason reason,
|
||||
Register rs,
|
||||
Operand rt) {
|
||||
Label L;
|
||||
Branch(&L, NegateCondition(cc), rs, rt);
|
||||
Throw(reason);
|
||||
// will not return here
|
||||
bind(&L);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::LoadInstanceDescriptors(Register map,
|
||||
Register descriptors) {
|
||||
lw(descriptors, FieldMemOperand(map, Map::kDescriptorsOffset));
|
||||
|
@ -931,12 +931,6 @@ class MacroAssembler: public Assembler {
|
||||
// handler chain.
|
||||
void ThrowUncatchable(Register value);
|
||||
|
||||
// Throw a message string as an exception.
|
||||
void Throw(BailoutReason reason);
|
||||
|
||||
// Throw a message string as an exception if a condition is not true.
|
||||
void ThrowIf(Condition cc, BailoutReason reason, Register rs, Operand rt);
|
||||
|
||||
// Copies a fixed number of fields of heap objects from src to dst.
|
||||
void CopyFields(Register dst, Register src, RegList temps, int field_count);
|
||||
|
||||
|
@ -9487,18 +9487,6 @@ RUNTIME_FUNCTION(RuntimeHidden_ThrowNotDateError) {
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(RuntimeHidden_ThrowMessage) {
|
||||
HandleScope scope(isolate);
|
||||
ASSERT(args.length() == 1);
|
||||
CONVERT_SMI_ARG_CHECKED(message_id, 0);
|
||||
const char* message = GetBailoutReason(
|
||||
static_cast<BailoutReason>(message_id));
|
||||
Handle<String> message_handle =
|
||||
isolate->factory()->NewStringFromAsciiChecked(message);
|
||||
return isolate->Throw(*message_handle);
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(RuntimeHidden_StackGuard) {
|
||||
SealHandleScope shs(isolate);
|
||||
ASSERT(args.length() == 0);
|
||||
|
@ -582,7 +582,6 @@ namespace internal {
|
||||
F(ReThrow, 1, 1) \
|
||||
F(ThrowReferenceError, 1, 1) \
|
||||
F(ThrowNotDateError, 0, 1) \
|
||||
F(ThrowMessage, 1, 1) \
|
||||
F(StackGuard, 0, 1) \
|
||||
F(Interrupt, 0, 1) \
|
||||
F(PromoteScheduledException, 0, 1) \
|
||||
|
@ -502,7 +502,6 @@ void MacroAssembler::Abort(BailoutReason reason) {
|
||||
}
|
||||
#endif
|
||||
|
||||
Push(rax);
|
||||
Move(kScratchRegister, Smi::FromInt(static_cast<int>(reason)),
|
||||
Assembler::RelocInfoNone());
|
||||
Push(kScratchRegister);
|
||||
@ -3442,39 +3441,6 @@ void MacroAssembler::TaggedToI(Register result_reg,
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::Throw(BailoutReason reason) {
|
||||
#ifdef DEBUG
|
||||
const char* msg = GetBailoutReason(reason);
|
||||
if (msg != NULL) {
|
||||
RecordComment("Throw message: ");
|
||||
RecordComment(msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
Push(rax);
|
||||
Push(Smi::FromInt(reason));
|
||||
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::kHiddenThrowMessage, 1);
|
||||
} else {
|
||||
CallRuntime(Runtime::kHiddenThrowMessage, 1);
|
||||
}
|
||||
// Control will not return here.
|
||||
int3();
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::ThrowIf(Condition cc, BailoutReason reason) {
|
||||
Label L;
|
||||
j(NegateCondition(cc), &L);
|
||||
Throw(reason);
|
||||
// will not return here
|
||||
bind(&L);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::LoadInstanceDescriptors(Register map,
|
||||
Register descriptors) {
|
||||
movp(descriptors, FieldOperand(map, Map::kDescriptorsOffset));
|
||||
|
@ -1072,12 +1072,6 @@ class MacroAssembler: public Assembler {
|
||||
// Propagate an uncatchable exception out of the current JS stack.
|
||||
void ThrowUncatchable(Register value);
|
||||
|
||||
// Throw a message string as an exception.
|
||||
void Throw(BailoutReason reason);
|
||||
|
||||
// Throw a message string as an exception if a condition is not true.
|
||||
void ThrowIf(Condition cc, BailoutReason reason);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Inline caching support
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user