A64: Tidy up a few TODOs.
authorbaptiste.afsa@arm.com <baptiste.afsa@arm.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 11 Mar 2014 17:31:40 +0000 (17:31 +0000)
committerbaptiste.afsa@arm.com <baptiste.afsa@arm.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 11 Mar 2014 17:31:40 +0000 (17:31 +0000)
R=ulan@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19815 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/a64/assembler-a64.h
src/a64/macro-assembler-a64.cc
src/a64/macro-assembler-a64.h

index 3087e88..999b01a 100644 (file)
@@ -846,9 +846,6 @@ class Assembler : public AssemblerBase {
     return SizeOfCodeGeneratedSince(label) / kInstructionSize;
   }
 
-  // TODO(all): Initialize these constants related with code patching.
-  // TODO(all): Set to -1 to hopefully crash if mistakenly used.
-
   // Number of instructions generated for the return sequence in
   // FullCodeGenerator::EmitReturnSequence.
   static const int kJSRetSequenceInstructions = 7;
index aa61f58..4b6b8eb 100644 (file)
@@ -1758,11 +1758,13 @@ void MacroAssembler::GetBuiltinFunction(Register target,
 }
 
 
-void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) {
-  ASSERT(!target.is(x1));
-  GetBuiltinFunction(x1, id);
+void MacroAssembler::GetBuiltinEntry(Register target,
+                                     Register function,
+                                     Builtins::JavaScript id) {
+  ASSERT(!AreAliased(target, function));
+  GetBuiltinFunction(function, id);
   // Load the code entry point from the builtins object.
-  Ldr(target, FieldMemOperand(x1, JSFunction::kCodeEntryOffset));
+  Ldr(target, FieldMemOperand(function, JSFunction::kCodeEntryOffset));
 }
 
 
@@ -1773,7 +1775,8 @@ void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
   // You can't call a builtin without a valid frame.
   ASSERT(flag == JUMP_FUNCTION || has_frame());
 
-  GetBuiltinEntry(x2, id);
+  // Get the builtin entry in x2 and setup the function object in x1.
+  GetBuiltinEntry(x2, x1, id);
   if (flag == CALL_FUNCTION) {
     call_wrapper.BeforeCall(CallSize(x2));
     Call(x2);
index f5fa14f..a9cf189 100644 (file)
@@ -1047,7 +1047,6 @@ class MacroAssembler : public Assembler {
     CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles);
   }
 
-  // TODO(all): Why does this variant save FP regs unconditionally?
   void CallRuntimeSaveDoubles(Runtime::FunctionId id) {
     const Runtime::Function* function = Runtime::FunctionForId(id);
     CallRuntime(function, function->nargs, kSaveFPRegs);
@@ -1110,9 +1109,10 @@ class MacroAssembler : public Assembler {
                      const CallWrapper& call_wrapper = NullCallWrapper());
 
   // Store the code object for the given builtin in the target register and
-  // setup the function in x1.
-  // TODO(all): Can we use another register than x1?
-  void GetBuiltinEntry(Register target, Builtins::JavaScript id);
+  // setup the function in the function register.
+  void GetBuiltinEntry(Register target,
+                       Register function,
+                       Builtins::JavaScript id);
 
   // Store the function for the given builtin in the target register.
   void GetBuiltinFunction(Register target, Builtins::JavaScript id);