Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1213)

Unified Diff: src/x64/codegen-x64.cc

Issue 1862001: X64: Use allocation with no scratch registers to avoid push/pop. (Closed)
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/codegen-x64.cc
diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc
index 9d171940cf72dd1efe1e505fc6c5262857f98695..a6f856ee77c91183d6b6baffb7b527f1327ac9d6 100644
--- a/src/x64/codegen-x64.cc
+++ b/src/x64/codegen-x64.cc
@@ -5969,7 +5969,7 @@ void DeferredInlineBinaryOperation::Generate() {
|| (op_ ==Token::SUB)
|| (op_ == Token::MUL)
|| (op_ == Token::DIV)) {
- Label call_runtime, after_alloc_failure;
+ Label call_runtime;
Label left_smi, right_smi, load_right, do_op;
__ JumpIfSmi(left_, &left_smi);
__ CompareRoot(FieldOperand(left_, HeapObject::kMapOffset),
@@ -5987,9 +5987,7 @@ void DeferredInlineBinaryOperation::Generate() {
__ Integer32ToSmi(left_, left_);
if (mode_ == OVERWRITE_LEFT) {
Label alloc_failure;
- __ push(left_);
- __ AllocateHeapNumber(dst_, left_, &after_alloc_failure);
- __ pop(left_);
+ __ AllocateHeapNumber(dst_, no_reg, &call_runtime);
}
__ bind(&load_right);
@@ -6002,9 +6000,7 @@ void DeferredInlineBinaryOperation::Generate() {
__ movq(dst_, right_);
} else if (mode_ == NO_OVERWRITE) {
Label alloc_failure;
- __ push(left_);
- __ AllocateHeapNumber(dst_, left_, &after_alloc_failure);
- __ pop(left_);
+ __ AllocateHeapNumber(dst_, no_reg, &call_runtime);
}
__ jmp(&do_op);
@@ -6014,9 +6010,7 @@ void DeferredInlineBinaryOperation::Generate() {
__ Integer32ToSmi(right_, right_);
if (mode_ == OVERWRITE_RIGHT || mode_ == NO_OVERWRITE) {
Label alloc_failure;
- __ push(left_);
- __ AllocateHeapNumber(dst_, left_, &after_alloc_failure);
- __ pop(left_);
+ __ AllocateHeapNumber(dst_, no_reg, &call_runtime);
}
__ bind(&do_op);
@@ -6030,8 +6024,6 @@ void DeferredInlineBinaryOperation::Generate() {
__ movsd(FieldOperand(dst_, HeapNumber::kValueOffset), xmm0);
__ jmp(&done);
- __ bind(&after_alloc_failure);
- __ pop(left_);
__ bind(&call_runtime);
}
GenericBinaryOpStub stub(op_, mode_, NO_SMI_CODE_IN_STUB);
« no previous file with comments | « no previous file | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698