Revision: 18955
Author: [email protected]
Date: Thu Jan 30 17:02:05 2014 UTC
Log: A64: Todos - peek/poke and branch generator
Fix some todos: add peek and poke support for fp registers and extend
BranchGenerator for branching on heap numbers.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/150513002
http://code.google.com/p/v8/source/detail?r=18955
Modified:
/branches/experimental/a64/src/a64/assembler-a64.h
/branches/experimental/a64/src/a64/lithium-a64.cc
/branches/experimental/a64/src/a64/lithium-codegen-a64.cc
/branches/experimental/a64/src/a64/lithium-codegen-a64.h
/branches/experimental/a64/src/a64/macro-assembler-a64.cc
/branches/experimental/a64/src/a64/macro-assembler-a64.h
=======================================
--- /branches/experimental/a64/src/a64/assembler-a64.h Thu Jan 30 16:31:19
2014 UTC
+++ /branches/experimental/a64/src/a64/assembler-a64.h Thu Jan 30 17:02:05
2014 UTC
@@ -1970,7 +1970,7 @@
#endif
private:
- // TODO(jbramley): [GOOGJSE-238] W16 uses next_literal_pool_check_ and
+ // TODO(jbramley): VIXL uses next_literal_pool_check_ and
// literal_pool_monitor_ to determine when to consider emitting a literal
// pool. V8 doesn't use them, so they should either not be here at all,
or
// should replace or be merged with next_buffer_check_ and
=======================================
--- /branches/experimental/a64/src/a64/lithium-a64.cc Thu Jan 30 15:11:19
2014 UTC
+++ /branches/experimental/a64/src/a64/lithium-a64.cc Thu Jan 30 17:02:05
2014 UTC
@@ -2123,7 +2123,7 @@
LOperand* value;
if (instr->NeedsWriteBarrier()) {
// TODO(all): Replace these constraints when RecordWriteStub has been
- // rewritten. See GOOGJSE-586.
+ // rewritten.
context = UseRegisterAndClobber(instr->context());
value = UseRegisterAndClobber(instr->value());
} else {
=======================================
--- /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Thu Jan 30
16:31:19 2014 UTC
+++ /branches/experimental/a64/src/a64/lithium-codegen-a64.cc Thu Jan 30
17:02:05 2014 UTC
@@ -196,6 +196,25 @@
};
+// Test the input and branch if it is a heap number.
+class BranchIfHeapNumber : public BranchGenerator {
+ public:
+ BranchIfHeapNumber(LCodeGen* codegen, const Register& value)
+ : BranchGenerator(codegen), value_(value) { }
+
+ virtual void Emit(Label* label) const {
+ __ JumpIfHeapNumber(value_, label);
+ }
+
+ virtual void EmitInverted(Label* label) const {
+ __ JumpIfNotHeapNumber(value_, label);
+ }
+
+ private:
+ const Register& value_;
+};
+
+
void LCodeGen::WriteTranslation(LEnvironment* environment,
Translation* translation) {
if (environment == NULL) return;
@@ -603,8 +622,7 @@
int count = 0;
while (!iterator.Done()) {
FPRegister value =
FPRegister::FromAllocationIndex(iterator.Current());
- // TODO(jbramley): Make Poke support FPRegisters.
- __ Str(value, MemOperand(__ StackPointer(), count * kDoubleSize));
+ __ Poke(value, count * kDoubleSize);
iterator.Advance();
count++;
}
@@ -1222,6 +1240,14 @@
}
+template<class InstrType>
+void LCodeGen::EmitBranchIfHeapNumber(InstrType instr,
+ const Register& value) {
+ BranchIfHeapNumber branch(this, value);
+ EmitBranchGeneric(instr, branch);
+}
+
+
void LCodeGen::DoGap(LGap* gap) {
for (int i = LGap::FIRST_INNER_POSITION;
i <= LGap::LAST_INNER_POSITION;
@@ -2922,9 +2948,8 @@
__ B(instr->TrueLabel(chunk_));
}
__ JumpIfSmi(value, instr->TrueLabel(chunk_));
- // TODO(jbramley): Add an EmitBranch helper for this.
- __ JumpForHeapNumber(value, NoReg,
- instr->TrueLabel(chunk_),
instr->FalseLabel(chunk_));
+
+ EmitBranchIfHeapNumber(instr, value);
}
}
@@ -4422,8 +4447,7 @@
int count = 0;
while (!iterator.Done()) {
FPRegister value =
FPRegister::FromAllocationIndex(iterator.Current());
- // TODO(jbramley): Make Peek support FPRegisters.
- __ Ldr(value, MemOperand(__ StackPointer(), count * kDoubleSize));
+ __ Peek(value, count * kDoubleSize);
iterator.Advance();
count++;
}
=======================================
--- /branches/experimental/a64/src/a64/lithium-codegen-a64.h Thu Jan 30
16:31:19 2014 UTC
+++ /branches/experimental/a64/src/a64/lithium-codegen-a64.h Thu Jan 30
17:02:05 2014 UTC
@@ -211,6 +211,10 @@
const FPRegister& value,
const FPRegister& scratch);
+ template<class InstrType>
+ void EmitBranchIfHeapNumber(InstrType instr,
+ const Register& value);
+
// Emits optimized code to deep-copy the contents of statically known
object
// graphs (e.g. object literal boilerplate). Expects a pointer to the
// allocated destination object in the result register, and a pointer to
the
=======================================
--- /branches/experimental/a64/src/a64/macro-assembler-a64.cc Thu Jan 30
16:31:19 2014 UTC
+++ /branches/experimental/a64/src/a64/macro-assembler-a64.cc Thu Jan 30
17:02:05 2014 UTC
@@ -760,7 +760,7 @@
}
-void MacroAssembler::Poke(const Register& src, const Operand& offset) {
+void MacroAssembler::Poke(const CPURegister& src, const Operand& offset) {
if (offset.IsImmediate()) {
ASSERT(offset.immediate() >= 0);
} else if (emit_debug_code()) {
@@ -772,7 +772,7 @@
}
-void MacroAssembler::Peek(const Register& dst, const Operand& offset) {
+void MacroAssembler::Peek(const CPURegister& dst, const Operand& offset) {
if (offset.IsImmediate()) {
ASSERT(offset.immediate() >= 0);
} else if (emit_debug_code()) {
@@ -2663,7 +2663,7 @@
}
-// TODO(jbramley): Check that we're handling FP correctly [GOOGJSE-33].
+// TODO(jbramley): Check that we're handling the frame pointer correctly.
void MacroAssembler::EnterExitFrame(bool save_doubles,
const Register& scratch,
int extra_space) {
=======================================
--- /branches/experimental/a64/src/a64/macro-assembler-a64.h Thu Jan 30
16:31:19 2014 UTC
+++ /branches/experimental/a64/src/a64/macro-assembler-a64.h Thu Jan 30
17:02:05 2014 UTC
@@ -531,13 +531,13 @@
//
// If the current stack pointer (according to StackPointer()) is csp,
then
// csp must be aligned to 16 bytes.
- void Poke(const Register& src, const Operand& offset);
+ void Poke(const CPURegister& src, const Operand& offset);
// Peek at a value on the stack, and put it in 'dst'. The offset is in
bytes.
//
// If the current stack pointer (according to StackPointer()) is csp,
then
// csp must be aligned to 16 bytes.
- void Peek(const Register& dst, const Operand& offset);
+ void Peek(const CPURegister& dst, const Operand& offset);
// Claim or drop stack space without actually accessing memory.
//
--
--
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.