Revision: 21730
Author:   [email protected]
Date:     Tue Jun 10 08:09:56 2014 UTC
Log:      X87: Preliminary support for block contexts in hydrogen.

Port r21684.

Origin message:
   Preliminary support for block contexts in hydrogen.

   Patch from Steven Keuchel <[email protected]>;

   BUG=v8:2198
   LOG=N
   TEST=mjsunit/harmony/block-let-crankshaft.js
[email protected]

Review URL: https://codereview.chromium.org/315233002

Patch from Chunyang Dai <[email protected]>.
http://code.google.com/p/v8/source/detail?r=21730

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

=======================================
--- /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc Wed Jun 4 14:57:51 2014 UTC +++ /branches/bleeding_edge/src/x87/lithium-codegen-x87.cc Tue Jun 10 08:09:56 2014 UTC
@@ -5678,6 +5678,21 @@
   __ bind(deferred->exit());
   __ bind(&done);
 }
+
+
+void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) {
+  Register context = ToRegister(instr->context());
+  __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context);
+}
+
+
+void LCodeGen::DoAllocateBlockContext(LAllocateBlockContext* instr) {
+  Handle<ScopeInfo> scope_info = instr->scope_info();
+  __ Push(scope_info);
+  __ push(ToRegister(instr->function()));
+  CallRuntime(Runtime::kHiddenPushBlockContext, 2, instr);
+  RecordSafepoint(Safepoint::kNoLazyDeopt);
+}


 #undef __
=======================================
--- /branches/bleeding_edge/src/x87/lithium-x87.cc Tue Jun 3 08:12:43 2014 UTC +++ /branches/bleeding_edge/src/x87/lithium-x87.cc Tue Jun 10 08:09:56 2014 UTC
@@ -2637,6 +2637,22 @@
   LInstruction* result = DefineSameAsFirst(load);
   return AssignPointerMap(result);
 }
+
+
+LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) {
+  LOperand* context = UseRegisterAtStart(instr->context());
+  return new(zone()) LStoreFrameContext(context);
+}
+
+
+LInstruction* LChunkBuilder::DoAllocateBlockContext(
+    HAllocateBlockContext* instr) {
+  LOperand* context = UseFixed(instr->context(), esi);
+  LOperand* function = UseRegisterAtStart(instr->function());
+  LAllocateBlockContext* result =
+      new(zone()) LAllocateBlockContext(context, function);
+  return MarkAsCall(DefineFixed(result, esi), instr);
+}


 } }  // namespace v8::internal
=======================================
--- /branches/bleeding_edge/src/x87/lithium-x87.h Tue Jun 3 15:45:38 2014 UTC +++ /branches/bleeding_edge/src/x87/lithium-x87.h Tue Jun 10 08:09:56 2014 UTC
@@ -20,6 +20,7 @@
 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V)    \
   V(AccessArgumentsAt)                          \
   V(AddI)                                       \
+  V(AllocateBlockContext)                       \
   V(Allocate)                                   \
   V(ApplyArguments)                             \
   V(ArgumentsElements)                          \
@@ -138,6 +139,7 @@
   V(StackCheck)                                 \
   V(StoreCodeEntry)                             \
   V(StoreContextSlot)                           \
+  V(StoreFrameContext)                          \
   V(StoreGlobalCell)                            \
   V(StoreKeyed)                                 \
   V(StoreKeyedGeneric)                          \
@@ -2669,6 +2671,35 @@
 };


+class LStoreFrameContext: public LTemplateInstruction<0, 1, 0> {
+ public:
+  explicit LStoreFrameContext(LOperand* context) {
+    inputs_[0] = context;
+  }
+
+  LOperand* context() { return inputs_[0]; }
+
+  DECLARE_CONCRETE_INSTRUCTION(StoreFrameContext, "store-frame-context")
+};
+
+
+class LAllocateBlockContext: public LTemplateInstruction<1, 2, 0> {
+ public:
+  LAllocateBlockContext(LOperand* context, LOperand* function) {
+    inputs_[0] = context;
+    inputs_[1] = function;
+  }
+
+  LOperand* context() { return inputs_[0]; }
+  LOperand* function() { return inputs_[1]; }
+
+  Handle<ScopeInfo> scope_info() { return hydrogen()->scope_info(); }
+
+ DECLARE_CONCRETE_INSTRUCTION(AllocateBlockContext, "allocate-block-context")
+  DECLARE_HYDROGEN_ACCESSOR(AllocateBlockContext)
+};
+
+
 class LChunkBuilder;
 class LPlatformChunk V8_FINAL : public LChunk {
  public:

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to