Version 2.2.9
Allow Object.create to be called with a function (issue 697).
Fixed bug with Date.parse returning a non-NaN value when called on a non date string (issue 696).
Allow unaligned memory accesses on ARM targets that support it (by Subrato K De of CodeAurora <subratokde@codeaurora.org>).
C++ API for retrieving JavaScript stack trace information.
git-svn-id: http://v8.googlecode.com/svn/trunk@4627 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
index e9bdfe5..6680af9 100644
--- a/src/arm/full-codegen-arm.cc
+++ b/src/arm/full-codegen-arm.cc
@@ -738,15 +738,10 @@
// Load the key.
__ mov(r0, Operand(key_literal->handle()));
- // Push both as arguments to ic.
- __ Push(r1, r0);
-
- // Call keyed load IC. It has all arguments on the stack and the key in r0.
+ // Call keyed load IC. It has arguments key and receiver in r0 and r1.
Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
__ Call(ic, RelocInfo::CODE_TARGET);
-
- // Drop key and object left on the stack by IC, and push the result.
- DropAndApply(2, context, r0);
+ Apply(context, r0);
}
}
@@ -935,8 +930,16 @@
}
break;
case KEYED_PROPERTY:
- VisitForValue(prop->obj(), kStack);
- VisitForValue(prop->key(), kStack);
+ // We need the key and receiver on both the stack and in r0 and r1.
+ if (expr->is_compound()) {
+ VisitForValue(prop->obj(), kStack);
+ VisitForValue(prop->key(), kAccumulator);
+ __ ldr(r1, MemOperand(sp, 0));
+ __ push(r0);
+ } else {
+ VisitForValue(prop->obj(), kStack);
+ VisitForValue(prop->key(), kStack);
+ }
break;
}
@@ -1005,8 +1008,7 @@
void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
- // Call keyed load IC. It has all arguments on the stack and the key in r0.
- __ ldr(r0, MemOperand(sp, 0));
+ // Call keyed load IC. It has arguments key and receiver in r0 and r1.
Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
__ Call(ic, RelocInfo::CODE_TARGET);
}
@@ -1171,10 +1173,10 @@
// Drop receiver left on the stack by IC.
DropAndApply(1, context_, r0);
} else {
- VisitForValue(expr->key(), kStack);
+ VisitForValue(expr->key(), kAccumulator);
+ __ pop(r1);
EmitKeyedPropertyLoad(expr);
- // Drop key and receiver left on the stack by IC.
- DropAndApply(2, context_, r0);
+ Apply(context_, r0);
}
}
@@ -1246,24 +1248,31 @@
// Call to a keyed property, use keyed load IC followed by function
// call.
VisitForValue(prop->obj(), kStack);
- VisitForValue(prop->key(), kStack);
+ VisitForValue(prop->key(), kAccumulator);
// Record source code position for IC call.
SetSourcePosition(prop->position());
- // Call keyed load IC. It has all arguments on the stack and the key in
- // r0.
- __ ldr(r0, MemOperand(sp, 0));
+ if (prop->is_synthetic()) {
+ __ pop(r1); // We do not need to keep the receiver.
+ } else {
+ __ ldr(r1, MemOperand(sp, 0)); // Keep receiver, to call function on.
+ }
+
Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
__ Call(ic, RelocInfo::CODE_TARGET);
- // Load receiver object into r1.
if (prop->is_synthetic()) {
+ // Push result (function).
+ __ push(r0);
+ // Push Global receiver.
__ ldr(r1, CodeGenerator::GlobalObject());
__ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
+ __ push(r1);
} else {
- __ ldr(r1, MemOperand(sp, kPointerSize));
+ // Pop receiver.
+ __ pop(r1);
+ // Push result (function).
+ __ push(r0);
+ __ push(r1);
}
- // Overwrite (object, key) with (function, receiver).
- __ str(r0, MemOperand(sp, kPointerSize));
- __ str(r1, MemOperand(sp));
EmitCallWithStub(expr);
}
} else {
@@ -1552,7 +1561,9 @@
if (assign_type == NAMED_PROPERTY) {
EmitNamedPropertyLoad(prop);
} else {
- VisitForValue(prop->key(), kStack);
+ VisitForValue(prop->key(), kAccumulator);
+ __ ldr(r1, MemOperand(sp, 0));
+ __ push(r0);
EmitKeyedPropertyLoad(prop);
}
}