Commit 47523739 authored by whesse@chromium.org's avatar whesse@chromium.org

X64 Crankshaft: Implement LValueOf and (dummy) LArgumentsObject.

Review URL: http://codereview.chromium.org/6542011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6850 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e79bfcaf
......@@ -1918,8 +1918,10 @@ LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
// There are no real uses of the arguments object (we bail out in all other
// cases).
// There are no real uses of the arguments object.
// arguments.length and element access are supported directly on
// stack arguments, and any real arguments object use causes a bailout.
// So this value is never used.
return NULL;
}
......
......@@ -1974,8 +1974,10 @@ LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
// There are no real uses of the arguments object (we bail out in all other
// cases).
// There are no real uses of the arguments object.
// arguments.length and element access are supported directly on
// stack arguments, and any real arguments object use causes a bailout.
// So this value is never used.
return NULL;
}
......
......@@ -929,7 +929,19 @@ void LCodeGen::DoPixelArrayLength(LPixelArrayLength* instr) {
void LCodeGen::DoValueOf(LValueOf* instr) {
Abort("Unimplemented: %s", "DoValueOf");
Register input = ToRegister(instr->InputAt(0));
Register result = ToRegister(instr->result());
ASSERT(input.is(result));
NearLabel done;
// If the object is a smi return the object.
__ JumpIfSmi(input, &done);
// If the object is not a value type, return the object.
__ CmpObjectType(input, JS_VALUE_TYPE, kScratchRegister);
__ j(not_equal, &done);
__ movq(result, FieldOperand(input, JSValue::kValueOffset));
__ bind(&done);
}
......
......@@ -1465,8 +1465,9 @@ LInstruction* LChunkBuilder::DoPixelArrayLength(HPixelArrayLength* instr) {
LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) {
Abort("Unimplemented: %s", "DoValueOf");
return NULL;
LOperand* object = UseRegister(instr->value());
LValueOf* result = new LValueOf(object);
return AssignEnvironment(DefineSameAsFirst(result));
}
......@@ -1830,7 +1831,10 @@ LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
LInstruction* LChunkBuilder::DoArgumentsObject(HArgumentsObject* instr) {
Abort("Unimplemented: %s", "DoArgumentsObject");
// There are no real uses of the arguments object.
// arguments.length and element access are supported directly on
// stack arguments, and any real arguments object use causes a bailout.
// So this value is never used.
return NULL;
}
......
......@@ -1005,11 +1005,10 @@ class LFixedArrayLength: public LTemplateInstruction<1, 1, 0> {
};
class LValueOf: public LTemplateInstruction<1, 1, 1> {
class LValueOf: public LTemplateInstruction<1, 1, 0> {
public:
LValueOf(LOperand* value, LOperand* temp) {
explicit LValueOf(LOperand* value) {
inputs_[0] = value;
temps_[0] = temp;
}
DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment