Reviewers: jochen,

Message:
PTAL.

Description:
A64: Implement pre-aging support for A64.

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

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

Affected files (+22, -9 lines):
  M src/a64/builtins-a64.cc
  M src/a64/macro-assembler-a64.h
  M src/a64/macro-assembler-a64.cc


Index: src/a64/builtins-a64.cc
diff --git a/src/a64/builtins-a64.cc b/src/a64/builtins-a64.cc
index 92a28b321fe5aa8c7d62e0654a9189547ab821c3..403bb5fa8e82d487815d607580a830668adbb6ff 100644
--- a/src/a64/builtins-a64.cc
+++ b/src/a64/builtins-a64.cc
@@ -839,7 +839,8 @@ void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) {
     __ Push(x0, x1, fp, lr);
__ Mov(x1, Operand(ExternalReference::isolate_address(masm->isolate())));
     __ CallCFunction(
- ExternalReference::get_make_code_young_function(masm->isolate()), 2);
+        ExternalReference::get_mark_code_as_executed_function(
+            masm->isolate()), 2);
     __ Pop(lr, fp, x1, x0);

// Perform prologue operations usually performed by the young code stub.
Index: src/a64/macro-assembler-a64.cc
diff --git a/src/a64/macro-assembler-a64.cc b/src/a64/macro-assembler-a64.cc
index 5087de05316f4c70bc1e9e4e388d3d3e9329e0e2..921e051b9e77deb31d8484b793c7f125a02e17db 100644
--- a/src/a64/macro-assembler-a64.cc
+++ b/src/a64/macro-assembler-a64.cc
@@ -2594,8 +2594,12 @@ void MacroAssembler::Prologue(PrologueFrameMode frame_mode) {
     __ Push(lr, fp, cp, Tmp0());
     __ Add(fp, jssp, StandardFrameConstants::kFixedFrameSizeFromFp);
   } else {
-    TODO_UNIMPLEMENTED("Prologue: Support IsCodePreAgingActive().");
-    __ EmitFrameSetupForCodeAgePatching();
+    if (isolate()->IsCodePreAgingActive()) {
+      Code* stub = Code::GetPreAgedCodeAgeStub(isolate());
+      EmitCodeAgeSequence(this, stub);
+    } else {
+      __ EmitFrameSetupForCodeAgePatching();
+    }
   }
 }

@@ -4657,6 +4661,14 @@ void MacroAssembler::EmitFrameSetupForCodeAgePatching() {
 }


+
+void MacroAssembler::EmitCodeAgeSequence(Code* stub) {
+ InstructionAccurateScope scope(this, kCodeAgeSequenceSize / kInstructionSize);
+  ASSERT(jssp.Is(StackPointer()));
+  EmitCodeAgeSequence(this, stub);
+}
+
+
 #undef __
 #define __ assm->

@@ -4679,7 +4691,7 @@ void MacroAssembler::EmitFrameSetupForCodeAgePatching(Assembler * assm) {
 }


-void MacroAssembler::EmitCodeAgeSequence(PatchingAssembler * assm,
+void MacroAssembler::EmitCodeAgeSequence(Assembler * assm,
                                          Code * stub) {
   Label start;
   __ bind(&start);
Index: src/a64/macro-assembler-a64.h
diff --git a/src/a64/macro-assembler-a64.h b/src/a64/macro-assembler-a64.h
index a03667b3e38ab1fc4fb6887b2f0c67acc3be9337..24a90b1e4bb7c15955f5b6086f14844ce5d924cf 100644
--- a/src/a64/macro-assembler-a64.h
+++ b/src/a64/macro-assembler-a64.h
@@ -1944,7 +1944,7 @@ class MacroAssembler : public Assembler {
   //
   // This function takes an Assembler so it can be called from either a
   // MacroAssembler or a PatchingAssembler context.
-  static void EmitFrameSetupForCodeAgePatching(Assembler * assm);
+  static void EmitFrameSetupForCodeAgePatching(Assembler* assm);

   // Call EmitFrameSetupForCodeAgePatching from a MacroAssembler context.
   void EmitFrameSetupForCodeAgePatching();
@@ -1953,13 +1953,13 @@ class MacroAssembler : public Assembler {
// generated by this sequence is expected to replace the code generated by
   // EmitFrameSetupForCodeAgePatching, and represents an old function.
   //
- // It never makes sense to call this other than in a patching context, so this
-  // method only accepts a PatchingAssembler.
-  //
// If stub is NULL, this function generates the code age sequence but omits // the stub address that is normally embedded in the instruction stream. This
   // can be used by debug code to verify code age sequences.
-  static void EmitCodeAgeSequence(PatchingAssembler * assm, Code * stub);
+  static void EmitCodeAgeSequence(Assembler* assm, Code* stub);
+
+  // Call EmitCodeAgeSequence from a MacroAssembler context.
+  void EmitCodeAgeSequence(Code* stub);

   // Return true if the sequence is a young sequence geneated by
// EmitFrameSetupForCodeAgePatching. Otherwise, this method asserts that the


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