Port r21203 (eaa92e4)
TEST=mjsunit/array-shift,mjsunit/array-shift2,mjsunit/array-shift3
BUG=
R=plind44@gmail.com
Review URL: https://codereview.chromium.org/
275883002
Patch from Balazs Kilvady <kilvadyb@homejinni.com>.
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21229
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
}
+void ArrayShiftStub::InitializeInterfaceDescriptor(
+ CodeStubInterfaceDescriptor* descriptor) {
+ static Register registers[] = { a0 };
+ descriptor->register_param_count_ = 1;
+ descriptor->register_params_ = registers;
+ descriptor->deoptimization_handler_ =
+ Builtins::c_function_address(Builtins::c_ArrayShift);
+}
+
+
void BinaryOpICStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
static Register registers[] = { a1, a0 };
}
+void LCodeGen::DoArrayShift(LArrayShift* instr) {
+ ASSERT(ToRegister(instr->context()).is(cp));
+ ASSERT(ToRegister(instr->object()).is(a0));
+ ASSERT(ToRegister(instr->result()).is(v0));
+ ArrayShiftStub stub(isolate(), instr->hydrogen()->kind());
+ CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+}
+
+
void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
Register object = ToRegister(instr->object());
Register temp = ToRegister(instr->temp());
}
+LInstruction* LChunkBuilder::DoArrayShift(HArrayShift* instr) {
+ LOperand* object = UseFixed(instr->object(), a0);
+ LOperand* context = UseFixed(instr->context(), cp);
+ LArrayShift* result = new(zone()) LArrayShift(context, object);
+ return MarkAsCall(DefineFixed(result, v0), instr, CANNOT_DEOPTIMIZE_EAGERLY);
+}
+
+
LInstruction* LChunkBuilder::DoTrapAllocationMemento(
HTrapAllocationMemento* instr) {
LOperand* object = UseRegister(instr->object());
V(ArgumentsLength) \
V(ArithmeticD) \
V(ArithmeticT) \
+ V(ArrayShift) \
V(BitI) \
V(BoundsCheck) \
V(Branch) \
};
+class LArrayShift V8_FINAL : public LTemplateInstruction<1, 2, 0> {
+ public:
+ LArrayShift(LOperand* context, LOperand* object) {
+ inputs_[0] = context;
+ inputs_[1] = object;
+ }
+
+ LOperand* context() const { return inputs_[0]; }
+ LOperand* object() const { return inputs_[1]; }
+
+ DECLARE_CONCRETE_INSTRUCTION(ArrayShift, "array-shift")
+ DECLARE_HYDROGEN_ACCESSOR(ArrayShift)
+};
+
+
class LTrapAllocationMemento V8_FINAL : public LTemplateInstruction<0, 1, 1> {
public:
LTrapAllocationMemento(LOperand* object,