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;
}
-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));
}
// 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);
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);
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);