Reviewers: Rodolph Perfetta (ARM),
Description:
A64: Implement Peek/PokePair
Implement PeekPair and PokePair in the macro assembler, and remove some TODO
comments.
BUG=
Please review this at https://codereview.chromium.org/152673002/
SVN Base: https://v8.googlecode.com/svn/branches/experimental/a64
Affected files (+36, -7 lines):
M src/a64/code-stubs-a64.cc
M src/a64/full-codegen-a64.cc
M src/a64/macro-assembler-a64.h
M src/a64/macro-assembler-a64.cc
Index: src/a64/code-stubs-a64.cc
diff --git a/src/a64/code-stubs-a64.cc b/src/a64/code-stubs-a64.cc
index
401d5a8d4eae1c2a4302f1dcb6367c1e6bd80857..594860ce8e87e6e6d36562da1204410238e4c3ab
100644
--- a/src/a64/code-stubs-a64.cc
+++ b/src/a64/code-stubs-a64.cc
@@ -6357,9 +6357,7 @@ void
StoreArrayLiteralElementStub::Generate(MacroAssembler* masm) {
Register array = x1;
Register array_map = x2;
Register array_index_smi = x4;
- // TODO(jbramley): Implement PeekPair and use it here.
- __ Peek(array, 1 * kPointerSize);
- __ Peek(array_index_smi, 0 * kPointerSize);
+ __ PeekPair(array_index_smi, array, 0);
__ Ldr(array_map, FieldMemOperand(array, JSObject::kMapOffset));
Label double_elements, smi_element, fast_elements, slow_elements;
Index: src/a64/full-codegen-a64.cc
diff --git a/src/a64/full-codegen-a64.cc b/src/a64/full-codegen-a64.cc
index
19738cd208e4bfefeb196c9a7e7f776cc7447e6f..090ddc457e6dd734b0a87b9093a705bc3bc58fcc
100644
--- a/src/a64/full-codegen-a64.cc
+++ b/src/a64/full-codegen-a64.cc
@@ -1191,8 +1191,7 @@ void
FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS);
__ Bind(&loop);
// Load the current count to x0, load the length to x1.
- // TODO(jbramley): Consider making something like PeekPair.
- __ Ldp(x0, x1, MemOperand(jssp));
+ __ PeekPair(x0, x1, 0);
__ Cmp(x0, x1); // Compare to the array length.
__ B(hs, loop_statement.break_label());
@@ -2494,8 +2493,7 @@ void FullCodeGenerator::VisitCall(Call* expr) {
// The runtime call returns a pair of values in x0 (function) and
// x1 (receiver). Touch up the stack with the right values.
- // TODO(jbramley): Consider adding PokePair.
- __ Stp(x1, x0, MemOperand(jssp, arg_count * kPointerSize));
+ __ PokePair(x1, x0, arg_count * kPointerSize);
}
// Record source position for debugger.
Index: src/a64/macro-assembler-a64.cc
diff --git a/src/a64/macro-assembler-a64.cc b/src/a64/macro-assembler-a64.cc
index
3b7ff1b4bce0ca922a7cadf2af0718019566675c..6cfede05cdbf21b72db3f01eda7faa25fdbf0449
100644
--- a/src/a64/macro-assembler-a64.cc
+++ b/src/a64/macro-assembler-a64.cc
@@ -784,6 +784,24 @@ void MacroAssembler::Peek(const CPURegister& dst,
const Operand& offset) {
}
+void MacroAssembler::PokePair(const CPURegister& src1,
+ const CPURegister& src2,
+ int offset) {
+ ASSERT(AreSameSizeAndType(src1, src2));
+ ASSERT((offset >= 0) && ((offset % src1.SizeInBytes()) == 0));
+ Stp(src1, src2, MemOperand(StackPointer(), offset));
+}
+
+
+void MacroAssembler::PeekPair(const CPURegister& dst1,
+ const CPURegister& dst2,
+ int offset) {
+ ASSERT(AreSameSizeAndType(dst1, dst2));
+ ASSERT((offset >= 0) && ((offset % dst1.SizeInBytes()) == 0));
+ Ldp(dst1, dst2, MemOperand(StackPointer(), offset));
+}
+
+
void MacroAssembler::PushCalleeSavedRegisters() {
// Ensure that the macro-assembler doesn't use any scratch registers.
InstructionAccurateScope scope(this);
Index: src/a64/macro-assembler-a64.h
diff --git a/src/a64/macro-assembler-a64.h b/src/a64/macro-assembler-a64.h
index
efd76435f4abc04ce874d3ad49dd8b173073ca04..3e7f86c40b12b12563a497ee172622ce315f12cf
100644
--- a/src/a64/macro-assembler-a64.h
+++ b/src/a64/macro-assembler-a64.h
@@ -539,6 +539,21 @@ class MacroAssembler : public Assembler {
// csp must be aligned to 16 bytes.
void Peek(const CPURegister& dst, const Operand& offset);
+ // Poke 'src1' and 'src2' onto the stack. The values written will be
adjacent
+ // with 'src2' at a higher address than 'src1'. The offset is in bytes.
+ //
+ // If the current stack pointer (according to StackPointer()) is csp,
then
+ // csp must be aligned to 16 bytes.
+ void PokePair(const CPURegister& src1, const CPURegister& src2, int
offset);
+
+ // Peek at two values on the stack, and put them in 'dst1' and 'dst2'.
The
+ // values peeked will be adjacent, with the value in 'dst2' being from a
+ // higher address than 'dst1'. The offset is in bytes.
+ //
+ // If the current stack pointer (according to StackPointer()) is csp,
then
+ // csp must be aligned to 16 bytes.
+ void PeekPair(const CPURegister& dst1, const CPURegister& dst2, int
offset);
+
// Claim or drop stack space without actually accessing memory.
//
// In debug mode, both of these will write invalid data into the claimed
or
--
--
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/groups/opt_out.