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

Unified Diff: src/arm/lithium-codegen-arm.cc

Issue 7350021: Crankshaft support for FixedDoubleArrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix ia32 build Created 9 years, 5 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
Index: src/arm/lithium-codegen-arm.cc
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
index dc93aea3461da251a785470be020995d790024b0..237d88cf50f9c0a623f131f4a631810d2417a460 100644
--- a/src/arm/lithium-codegen-arm.cc
+++ b/src/arm/lithium-codegen-arm.cc
@@ -2433,6 +2433,44 @@ void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) {
}
+void LCodeGen::DoLoadKeyedFastDoubleElement(
+ LLoadKeyedFastDoubleElement* instr) {
+ Register elements = ToRegister(instr->elements());
+ bool key_is_constant = instr->key()->IsConstantOperand();
+ Register key = no_reg;
+ DwVfpRegister result = ToDoubleRegister(instr->result());
+ Register scratch1 = scratch0();
Mads Ager (chromium) 2011/07/19 08:03:51 scratch1 -> scratch?
danno 2011/07/19 12:50:17 Done.
+
+ int shift_size =
+ ElementsKindToShiftSize(JSObject::FAST_DOUBLE_ELEMENTS);
+ int constant_key = 0;
+ if (key_is_constant) {
+ constant_key = ToInteger32(LConstantOperand::cast(instr->key()));
+ if (constant_key & 0xF0000000) {
+ Abort("array index constant value too big.");
+ }
+ } else {
+ key = ToRegister(instr->key());
+ }
+
+ Operand operand(key_is_constant ? Operand(constant_key * (1 << shift_size))
Mads Ager (chromium) 2011/07/19 08:03:51 Use "operand = expression" instead of "operand(exp
danno 2011/07/19 12:50:17 Done.
+ : Operand(key, LSL, shift_size));
+ __ add(elements, elements, operand);
Alexandre 2011/07/18 16:22:14 If key is constant this add instruction can be mer
Mads Ager (chromium) 2011/07/19 08:03:51 I'm fine with tweaking stuff like this later. I th
danno 2011/07/19 12:50:17 Done.
+
+ if (instr->hydrogen()->RequiresHoleCheck()) {
+ int offset =
+ FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32);
+ __ ldr(scratch1, FieldMemOperand(elements, offset));
+ __ cmp(scratch1, Operand(kHoleNanUpper32));
+ DeoptimizeIf(eq, instr->environment());
+ }
+
+ __ add(elements, elements,
+ Operand(FixedDoubleArray::kHeaderSize - kSmiTagMask));
Mads Ager (chromium) 2011/07/19 08:03:51 kSmiTagMask -> kHeapObjectTag?
danno 2011/07/19 12:50:17 Done.
+ __ vldr(result, elements, 0);
+}
+
+
void LCodeGen::DoLoadKeyedSpecializedArrayElement(
LLoadKeyedSpecializedArrayElement* instr) {
Register external_pointer = ToRegister(instr->external_pointer());
@@ -3243,6 +3281,43 @@ void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) {
}
+void LCodeGen::DoStoreKeyedFastDoubleElement(
+ LStoreKeyedFastDoubleElement* instr) {
+ DwVfpRegister value = ToDoubleRegister(instr->value());
+ Register elements = ToRegister(instr->elements());
+ Register key = no_reg;
+ bool key_is_constant = instr->key()->IsConstantOperand();
+ int constant_key = 0;
+ Label not_nan;
+
+ // Calculate the effective address of the slot in the array to store the
+ // double value.
+ if (key_is_constant) {
+ constant_key = ToInteger32(LConstantOperand::cast(instr->key()));
+ if (constant_key & 0xF0000000) {
+ Abort("array index constant value too big.");
+ }
+ } else {
+ key = ToRegister(instr->key());
+ }
+ int shift_size = ElementsKindToShiftSize(JSObject::FAST_DOUBLE_ELEMENTS);
+ Operand operand(key_is_constant ? Operand(constant_key * (1 << shift_size))
Mads Ager (chromium) 2011/07/19 08:03:51 I would use '=' here.
danno 2011/07/19 12:50:17 Done.
+ : Operand(key, LSL, shift_size));
+ __ add(elements, elements, operand);
Alexandre 2011/07/18 16:22:14 If the key is constant, these two add instructions
Mads Ager (chromium) 2011/07/19 08:03:51 Instead of writing to elements here, can you use t
danno 2011/07/19 12:50:17 Done.
danno 2011/07/19 12:50:17 Done.
+ __ add(elements, elements,
+ Operand(FixedDoubleArray::kHeaderSize - kSmiTagMask));
Mads Ager (chromium) 2011/07/19 08:03:51 kHeapObjectTag
danno 2011/07/19 12:50:17 Done.
+
+ // Check for NaN. All NaNs must be canonicalized.
+ __ VFPCompareAndSetFlags(value, value);
+ __ b(vc, &not_nan);
+
+ __ Vmov(value, FixedDoubleArray::canonical_not_the_hole_nan_as_double());
Alexandre 2011/07/18 16:22:14 You can spare the previous branch by making this v
danno 2011/07/19 12:50:17 Done.
+
+ __ bind(&not_nan);
+ __ vstr(value, elements, 0);
+}
+
+
void LCodeGen::DoStoreKeyedSpecializedArrayElement(
LStoreKeyedSpecializedArrayElement* instr) {
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/hydrogen.cc » ('j') | src/hydrogen-instructions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698