X64: Fix bug in RandomPositiveSmi (doesn't save rsi before calling C-code).
Review URL: http://codereview.chromium.org/160519 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2614 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
0e11fbcd79
commit
e05ea61528
@ -3434,6 +3434,7 @@ void CodeGenerator::GenerateGetFramePointer(ZoneList<Expression*>* args) {
|
|||||||
void CodeGenerator::GenerateRandomPositiveSmi(ZoneList<Expression*>* args) {
|
void CodeGenerator::GenerateRandomPositiveSmi(ZoneList<Expression*>* args) {
|
||||||
ASSERT(args->length() == 0);
|
ASSERT(args->length() == 0);
|
||||||
frame_->SpillAll();
|
frame_->SpillAll();
|
||||||
|
__ push(rsi);
|
||||||
|
|
||||||
// Make sure the frame is aligned like the OS expects.
|
// Make sure the frame is aligned like the OS expects.
|
||||||
static const int kFrameAlignment = OS::ActivationFrameAlignment();
|
static const int kFrameAlignment = OS::ActivationFrameAlignment();
|
||||||
@ -3446,11 +3447,12 @@ void CodeGenerator::GenerateRandomPositiveSmi(ZoneList<Expression*>* args) {
|
|||||||
// Call V8::RandomPositiveSmi().
|
// Call V8::RandomPositiveSmi().
|
||||||
__ Call(FUNCTION_ADDR(V8::RandomPositiveSmi), RelocInfo::RUNTIME_ENTRY);
|
__ Call(FUNCTION_ADDR(V8::RandomPositiveSmi), RelocInfo::RUNTIME_ENTRY);
|
||||||
|
|
||||||
// Restore stack pointer from callee-saved register edi.
|
// Restore stack pointer from callee-saved register.
|
||||||
if (kFrameAlignment > 0) {
|
if (kFrameAlignment > 0) {
|
||||||
__ movq(rsp, rbx);
|
__ movq(rsp, rbx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__ pop(rsi);
|
||||||
Result result = allocator_->Allocate(rax);
|
Result result = allocator_->Allocate(rax);
|
||||||
frame_->Push(&result);
|
frame_->Push(&result);
|
||||||
}
|
}
|
||||||
@ -6807,6 +6809,7 @@ void FloatingPointHelper::LoadFloatOperands(MacroAssembler* masm) {
|
|||||||
__ bind(&done);
|
__ bind(&done);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FloatingPointHelper::LoadFloatOperands(MacroAssembler* masm,
|
void FloatingPointHelper::LoadFloatOperands(MacroAssembler* masm,
|
||||||
Register lhs,
|
Register lhs,
|
||||||
Register rhs) {
|
Register rhs) {
|
||||||
@ -6841,6 +6844,7 @@ void FloatingPointHelper::LoadFloatOperands(MacroAssembler* masm,
|
|||||||
__ bind(&done);
|
__ bind(&done);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FloatingPointHelper::CheckFloatOperands(MacroAssembler* masm,
|
void FloatingPointHelper::CheckFloatOperands(MacroAssembler* masm,
|
||||||
Label* non_float) {
|
Label* non_float) {
|
||||||
Label test_other, done;
|
Label test_other, done;
|
||||||
@ -6878,6 +6882,7 @@ const char* GenericBinaryOpStub::GetName() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GenericBinaryOpStub::GenerateSmiCode(MacroAssembler* masm, Label* slow) {
|
void GenericBinaryOpStub::GenerateSmiCode(MacroAssembler* masm, Label* slow) {
|
||||||
// Perform fast-case smi code for the operation (rax <op> rbx) and
|
// Perform fast-case smi code for the operation (rax <op> rbx) and
|
||||||
// leave result in register rax.
|
// leave result in register rax.
|
||||||
@ -7018,7 +7023,6 @@ void GenericBinaryOpStub::GenerateSmiCode(MacroAssembler* masm, Label* slow) {
|
|||||||
|
|
||||||
void GenericBinaryOpStub::Generate(MacroAssembler* masm) {
|
void GenericBinaryOpStub::Generate(MacroAssembler* masm) {
|
||||||
Label call_runtime;
|
Label call_runtime;
|
||||||
|
|
||||||
if (flags_ == SMI_CODE_IN_STUB) {
|
if (flags_ == SMI_CODE_IN_STUB) {
|
||||||
// The fast case smi code wasn't inlined in the stub caller
|
// The fast case smi code wasn't inlined in the stub caller
|
||||||
// code. Generate it here to speed up common operations.
|
// code. Generate it here to speed up common operations.
|
||||||
|
Loading…
Reference in New Issue
Block a user