Reviewers: ulan, jochen,
Description:
ARM64: Add and use SmiTagAndPush.
In some cases, this allows SmiTag and Push to be combined into a single
operation.
BUG=
Please review this at https://codereview.chromium.org/311133003/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+23, -12 lines):
M src/arm64/debug-arm64.cc
M src/arm64/full-codegen-arm64.cc
M src/arm64/lithium-codegen-arm64.cc
M src/arm64/macro-assembler-arm64.h
M src/arm64/macro-assembler-arm64-inl.h
Index: src/arm64/debug-arm64.cc
diff --git a/src/arm64/debug-arm64.cc b/src/arm64/debug-arm64.cc
index
b945a6e9d57baec3c824bb56dba100faf66bd408..be2d50275b8cf82c94e255c4f09c52a2f242cc51
100644
--- a/src/arm64/debug-arm64.cc
+++ b/src/arm64/debug-arm64.cc
@@ -157,9 +157,9 @@ static void
Generate_DebugBreakCallHelper(MacroAssembler* masm,
while (!non_object_list.IsEmpty()) {
// Store each non-object register as two SMIs.
Register reg = Register(non_object_list.PopLowestIndex());
- __ Push(reg);
- __ Poke(wzr, 0);
- __ Push(reg.W(), wzr);
+ __ Lsr(scratch, reg, 32);
+ __ SmiTagAndPush(scratch, reg);
+
// Stack:
// jssp[12]: reg[63:32]
// jssp[8]: 0x00000000 (SMI tag & padding)
Index: src/arm64/full-codegen-arm64.cc
diff --git a/src/arm64/full-codegen-arm64.cc
b/src/arm64/full-codegen-arm64.cc
index
cc225d24ed88cb80ae614c6708b60f37cdd2f0ef..e24f62aa1044f8ecf31c47324f03e21012f4a9a6
100644
--- a/src/arm64/full-codegen-arm64.cc
+++ b/src/arm64/full-codegen-arm64.cc
@@ -1175,11 +1175,8 @@ void
FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
FieldMemOperand(x2,
DescriptorArray::kEnumCacheBridgeCacheOffset));
// Set up the four remaining stack slots.
- __ Push(x0); // Map.
- __ Mov(x0, Smi::FromInt(0));
- // Push enumeration cache, enumeration cache length (as smi) and zero.
- __ SmiTag(x1);
- __ Push(x2, x1, x0);
+ __ Push(x0, x2); // Map, enumeration cache.
+ __ SmiTagAndPush(x1, xzr); // Enum cache length, zero (both as smis).
__ B(&loop);
__ Bind(&no_descriptors);
Index: src/arm64/lithium-codegen-arm64.cc
diff --git a/src/arm64/lithium-codegen-arm64.cc
b/src/arm64/lithium-codegen-arm64.cc
index
ea63bae4b15ef987efd65e833e3f52fecdf6ea9c..47a5d81907a9c042011138920545efa412fa1a05
100644
--- a/src/arm64/lithium-codegen-arm64.cc
+++ b/src/arm64/lithium-codegen-arm64.cc
@@ -5493,8 +5493,7 @@ void
LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) {
// Push the index as a smi. This is safe because of the checks in
// DoStringCharCodeAt above.
Register index = ToRegister(instr->index());
- __ SmiTag(index);
- __ Push(index);
+ __ SmiTagAndPush(index);
CallRuntimeFromDeferred(Runtime::kHiddenStringCharCodeAt, 2, instr,
instr->context());
@@ -5543,8 +5542,7 @@ void
LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) {
__ Mov(result, 0);
PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
- __ SmiTag(char_code);
- __ Push(char_code);
+ __ SmiTagAndPush(char_code);
CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr,
instr->context());
__ StoreToSafepointRegisterSlot(x0, result);
}
Index: src/arm64/macro-assembler-arm64-inl.h
diff --git a/src/arm64/macro-assembler-arm64-inl.h
b/src/arm64/macro-assembler-arm64-inl.h
index
b5e1824d2eb4387a812c8aba620757fde3466ea3..0f8a18d9cf124a662b7750cc7249287bab6d7021
100644
--- a/src/arm64/macro-assembler-arm64-inl.h
+++ b/src/arm64/macro-assembler-arm64-inl.h
@@ -1350,6 +1350,18 @@ void MacroAssembler::SmiUntagToFloat(FPRegister dst,
}
+void MacroAssembler::SmiTagAndPush(Register src) {
+ STATIC_ASSERT((kSmiShift == 32) && (kSmiTag == 0));
+ Push(src.W(), wzr);
+}
+
+
+void MacroAssembler::SmiTagAndPush(Register src1, Register src2) {
+ STATIC_ASSERT((kSmiShift == 32) && (kSmiTag == 0));
+ Push(src1.W(), wzr, src2.W(), wzr);
+}
+
+
void MacroAssembler::JumpIfSmi(Register value,
Label* smi_label,
Label* not_smi_label) {
Index: src/arm64/macro-assembler-arm64.h
diff --git a/src/arm64/macro-assembler-arm64.h
b/src/arm64/macro-assembler-arm64.h
index
320681b6afbedb35d70e7f57bf15f565173b2680..551c0ea232e958565e354a2089f3fdb49af2e311
100644
--- a/src/arm64/macro-assembler-arm64.h
+++ b/src/arm64/macro-assembler-arm64.h
@@ -869,6 +869,10 @@ class MacroAssembler : public Assembler {
Register src,
UntagMode mode = kNotSpeculativeUntag);
+ // Tag and push in one step.
+ inline void SmiTagAndPush(Register src);
+ inline void SmiTagAndPush(Register src1, Register src2);
+
// Compute the absolute value of 'smi' and leave the result in 'smi'
// register. If 'smi' is the most negative SMI, the absolute value cannot
// be represented as a SMI and a jump to 'slow' is done.
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.