Reviewers: Rodolph Perfetta (ARM),

Description:
A64: Implement LDeclareGlobals.

BUG=none

Please review this at https://codereview.chromium.org/135963003/

SVN Base: https://v8.googlecode.com/svn/branches/experimental/a64

Affected files (+22, -1 lines):
  M src/a64/lithium-a64.h
  M src/a64/lithium-a64.cc
  M src/a64/lithium-codegen-a64.cc


Index: src/a64/lithium-a64.cc
diff --git a/src/a64/lithium-a64.cc b/src/a64/lithium-a64.cc
index 0d9b44c47c613d3c00a358319c0b1104e1c05d00..1620222c9c28aa7fd04bd4fbf4c96ac7a8e67fa3 100644
--- a/src/a64/lithium-a64.cc
+++ b/src/a64/lithium-a64.cc
@@ -1322,7 +1322,7 @@ LInstruction* LChunkBuilder::DoDebugBreak(HDebugBreak* instr) {


 LInstruction* LChunkBuilder::DoDeclareGlobals(HDeclareGlobals* instr) {
-  UNIMPLEMENTED_INSTRUCTION();
+  return MarkAsCall(new(zone()) LDeclareGlobals, instr);
 }


Index: src/a64/lithium-a64.h
diff --git a/src/a64/lithium-a64.h b/src/a64/lithium-a64.h
index f011364d1e42555bc081981e3773b094868e7127..8f40726ce06ca9c12ae1fb651f885933fad34c8e 100644
--- a/src/a64/lithium-a64.h
+++ b/src/a64/lithium-a64.h
@@ -90,6 +90,7 @@ class LCodeGen;
   V(Context)                                    \
   V(DateField)                                  \
   V(DebugBreak)                                 \
+  V(DeclareGlobals)                             \
   V(Deoptimize)                                 \
   V(DivI)                                       \
   V(DoubleToI)                                  \
@@ -1190,6 +1191,13 @@ class LDebugBreak: public LTemplateInstruction<0, 0, 0> {
 };


+class LDeclareGlobals: public LTemplateInstruction<0, 0, 0> {
+ public:
+  DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals")
+  DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals)
+};
+
+
 class LDeoptimize: public LTemplateInstruction<0, 0, 0> {
  public:
   DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
Index: src/a64/lithium-codegen-a64.cc
diff --git a/src/a64/lithium-codegen-a64.cc b/src/a64/lithium-codegen-a64.cc
index 7ab8cb71cdc7223b82dfbb74b4eb97b122b1450f..32c5a4ef9024832cb05652deb8836bccd3f46b1a 100644
--- a/src/a64/lithium-codegen-a64.cc
+++ b/src/a64/lithium-codegen-a64.cc
@@ -4337,6 +4337,19 @@ void LCodeGen::DoDebugBreak(LDebugBreak* instr) {
 }


+void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
+  Register scratch1 = x5;
+  Register scratch2 = x6;
+  ASSERT(instr->IsMarkedAsCall());
+
+  ASM_UNIMPLEMENTED_BREAK("DoDeclareGlobals");
+  __ LoadHeapObject(scratch1, instr->hydrogen()->pairs());
+  __ Mov(scratch2, Operand(Smi::FromInt(instr->hydrogen()->flags())));
+  __ Push(cp, scratch1, scratch2);  // The context is the first argument.
+  CallRuntime(Runtime::kDeclareGlobals, 3, instr);
+}
+
+
 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) {
   PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
   __ CallRuntimeSaveDoubles(Runtime::kStackGuard);


--
--
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/groups/opt_out.

Reply via email to