Revision: 6914
Author: [email protected]
Date: Wed Feb 23 05:26:28 2011
Log: X64 Crankshaft: Add DoOuterContext to x64 lithium.
Review URL: http://codereview.chromium.org/6570008
http://code.google.com/p/v8/source/detail?r=6914

Modified:
 /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc
 /branches/bleeding_edge/src/x64/lithium-x64.cc
 /branches/bleeding_edge/src/x64/lithium-x64.h

=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Wed Feb 23 03:29:11 2011 +++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Wed Feb 23 05:26:28 2011
@@ -2203,6 +2203,15 @@
   Register result = ToRegister(instr->result());
   __ movq(result, Operand(rbp, StandardFrameConstants::kContextOffset));
 }
+
+
+void LCodeGen::DoOuterContext(LOuterContext* instr) {
+  Register context = ToRegister(instr->context());
+  Register result = ToRegister(instr->result());
+  __ movq(result,
+         Operand(context, Context::SlotOffset(Context::CLOSURE_INDEX)));
+  __ movq(result, FieldOperand(result, JSFunction::kContextOffset));
+}


 void LCodeGen::DoGlobalObject(LGlobalObject* instr) {
=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.cc      Wed Feb 23 03:29:11 2011
+++ /branches/bleeding_edge/src/x64/lithium-x64.cc      Wed Feb 23 05:26:28 2011
@@ -1190,8 +1190,8 @@


 LInstruction* LChunkBuilder::DoOuterContext(HOuterContext* instr) {
-  Abort("Unimplemented: DoOuterContext");
-  return NULL;
+  LOperand* context = UseRegisterAtStart(instr->value());
+  return DefineAsRegister(new LOuterContext(context));
 }


=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.h       Wed Feb 23 03:19:50 2011
+++ /branches/bleeding_edge/src/x64/lithium-x64.h       Wed Feb 23 05:26:28 2011
@@ -129,6 +129,7 @@
   V(NumberUntagD)                               \
   V(ObjectLiteral)                              \
   V(OsrEntry)                                   \
+  V(OuterContext)                               \
   V(Parameter)                                  \
   V(PixelArrayLength)                           \
   V(Power)                                      \
@@ -1280,6 +1281,18 @@
 };


+class LOuterContext: public LTemplateInstruction<1, 1, 0> {
+ public:
+  explicit LOuterContext(LOperand* context) {
+    inputs_[0] = context;
+  }
+
+  DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
+
+  LOperand* context() { return InputAt(0); }
+};
+
+
 class LGlobalObject: public LTemplateInstruction<1, 0, 0> {
  public:
   DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")

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

Reply via email to