Reviewers: Rico,

Description:
Don't use eax on x64. :)

TBR=ricow

Please review this at http://codereview.chromium.org/6312122/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/x64/lithium-codegen-x64.cc
  M src/x64/lithium-x64.cc


Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index 12d912c396f1a146b1326628f20dbbd91d90681b..cb58f802a2fca9d6da951985d223bb2ca4124857 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -1446,7 +1446,19 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {


 void LCodeGen::DoLoadElements(LLoadElements* instr) {
-  Abort("Unimplemented: %s", "DoLoadElements");
+  ASSERT(instr->result()->Equals(instr->InputAt(0)));
+  Register reg = ToRegister(instr->InputAt(0));
+  __ movq(reg, FieldOperand(reg, JSObject::kElementsOffset));
+  if (FLAG_debug_code) {
+    NearLabel done;
+    __ Cmp(FieldOperand(reg, HeapObject::kMapOffset),
+           Factory::fixed_array_map());
+    __ j(equal, &done);
+    __ Cmp(FieldOperand(reg, HeapObject::kMapOffset),
+           Factory::fixed_cow_array_map());
+    __ Check(equal, "Check for fast elements failed.");
+    __ bind(&done);
+  }
 }


@@ -1529,7 +1541,7 @@ void LCodeGen::CallKnownFunction(Handle<JSFunction> function,
     __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
   }

-  // Set eax to arguments count if adaption is not needed. Assumes that eax
+  // Set rax to arguments count if adaption is not needed. Assumes that rax
   // is available to write to at this point.
   if (!function->NeedsArgumentsAdaption()) {
     __ Set(rax, arity);
@@ -1554,7 +1566,7 @@ void LCodeGen::CallKnownFunction(Handle<JSFunction> function,


 void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) {
-  ASSERT(ToRegister(instr->result()).is(eax));
+  ASSERT(ToRegister(instr->result()).is(rax));
   __ Move(rdi, instr->function());
   CallKnownFunction(instr->function(), instr->arity(), instr);
 }
Index: src/x64/lithium-x64.cc
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
index c20a619a0148606bec7f8c1cc449ec039f7395bb..92869dcc85ac12689d7014b48373facfba413ec4 100644
--- a/src/x64/lithium-x64.cc
+++ b/src/x64/lithium-x64.cc
@@ -1325,8 +1325,7 @@ LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) {


 LInstruction* LChunkBuilder::DoFixedArrayLength(HFixedArrayLength* instr) {
-  Abort("Unimplemented: %s", "DoFixedArrayLength");
-  return NULL;
+
 }


@@ -1523,8 +1522,8 @@ LInstruction* LChunkBuilder::DoLoadFunctionPrototype(


 LInstruction* LChunkBuilder::DoLoadElements(HLoadElements* instr) {
-  Abort("Unimplemented: %s", "DoLoadElements");
-  return NULL;
+  LOperand* input = UseRegisterAtStart(instr->value());
+  return DefineSameAsFirst(new LLoadElements(input));
 }




--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to