Reviewers: Yang, loislo, yurys,

Message:
Yang, could you please take a look.

Description:
Support LiveEdit on Arm64

BUG=368580
LOG=Y

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

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

Affected files (+35, -12 lines):
  M src/arm64/debug-arm64.cc
  M src/objects.h
  M test/mjsunit/mjsunit.status


Index: src/arm64/debug-arm64.cc
diff --git a/src/arm64/debug-arm64.cc b/src/arm64/debug-arm64.cc
index 556231602e697d4f46f3e11d7a2ce2e7be9fe4a8..43ebd36df1017352a2d9675906d277933fec1fa9 100644
--- a/src/arm64/debug-arm64.cc
+++ b/src/arm64/debug-arm64.cc
@@ -131,6 +131,14 @@ static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
   {
     FrameScope scope(masm, StackFrame::INTERNAL);

+    // Load padding words on stack.
+    __ ldr(scratch, Smi::FromInt(LiveEdit::kFramePaddingValue));
+    for (int i = 0; i < LiveEdit::kFramePaddingInitialSize; i++) {
+      __ push(scratch);
+    }
+    __ ldr(scratch, Smi::FromInt(LiveEdit::kFramePaddingInitialSize));
+    __ push(scratch);
+
     // Any live values (object_regs and non_object_regs) in caller-saved
// registers (or lr) need to be stored on the stack so that their values are
     // safely preserved for a call into C code.
@@ -200,6 +208,9 @@ static void Generate_DebugBreakCallHelper(MacroAssembler* masm,
       __ Bfxil(reg, scratch, 32, 32);
     }

+    // Don't bother removing padding bytes pushed on the stack
+    // as the frame is going to be restored right away.
+
     // Leave the internal frame.
   }

@@ -341,16 +352,37 @@ void DebugCodegen::GenerateSlotDebugBreak(MacroAssembler* masm) {


 void DebugCodegen::GeneratePlainReturnLiveEdit(MacroAssembler* masm) {
-  masm->Abort(kLiveEditFrameDroppingIsNotSupportedOnARM64);
+  __ Ret();
 }


 void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
-  masm->Abort(kLiveEditFrameDroppingIsNotSupportedOnARM64);
+  ExternalReference restarter_frame_function_slot =
+      ExternalReference::debug_restarter_frame_function_pointer_address(
+          masm->isolate());
+  __ mov(x1, xzr);
+  __ Mov(ip0, restarter_frame_function_slot);
+  __ str(x1, MemOperand(ip0, 0));
+
+  // We do not know our frame height, but set sp based on fp.
+  __ sub(jssp, fp, Operand(kPointerSize));
+
+  __ Pop(x1, fp, lr);  // Function, Frame, Return address.
+
+  // Load context from the function.
+  __ ldr(cp, FieldMemOperand(x1, JSFunction::kContextOffset));
+
+  // Get function code.
+  __ ldr(ip0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset));
+  __ ldr(ip0, FieldMemOperand(ip0, SharedFunctionInfo::kCodeOffset));
+  __ add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag));
+
+  // Re-run JSFunction, x1 is function, cp is context.
+  __ Jump(ip0);
 }


-const bool LiveEdit::kFrameDropperSupported = false;
+const bool LiveEdit::kFrameDropperSupported = true;

 } }  // namespace v8::internal

Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index df57f6eaa1db925aaf3565181835de01ea3c24ab..5240a70c205357020f940dedfe6ca71f71209f83 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1157,8 +1157,6 @@ template <class C> inline bool Is(Object* obj);
V(kLetBindingReInitialization, "Let binding re-initialization") \ V(kLhsHasBeenClobbered, "lhs has been clobbered") \ V(kLiveBytesCountOverflowChunkSize, "Live Bytes Count overflow chunk size") \ - V(kLiveEditFrameDroppingIsNotSupportedOnARM64, \ - "LiveEdit frame dropping is not supported on arm64") \ V(kLiveEdit, "LiveEdit") \ V(kLookupVariableInCountOperation, \ "Lookup variable in count operation") \
Index: test/mjsunit/mjsunit.status
diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status
index 34ea1d56c0e68963b2fb2eb87a512d2d574aa57f..0aff3aa8302a99fed91d9e0f51afd0f55a47245a 100644
--- a/test/mjsunit/mjsunit.status
+++ b/test/mjsunit/mjsunit.status
@@ -204,13 +204,6 @@
   'regress/regress-2185-2': [PASS, TIMEOUT],
   'whitespaces': [PASS, TIMEOUT, SLOW],

-  # Stack manipulations in LiveEdit is not implemented for this arch.
-  'debug-liveedit-check-stack': [SKIP],
-  'debug-liveedit-stack-padding': [SKIP],
-  'debug-liveedit-restart-frame': [SKIP],
-  'debug-liveedit-double-call': [SKIP],
-  'harmony/generators-debug-liveedit': [SKIP],
-
   # BUG(v8:3147). It works on other architectures by accident.
   'regress/regress-conditional-position': [FAIL],



--
--
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