Review URL: http://codereview.chromium.org/652118
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3937 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
dfb73e9508
commit
43d074985a
@ -61,10 +61,10 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm,
|
||||
ASSERT(extra_args == NO_EXTRA_ARGUMENTS);
|
||||
}
|
||||
|
||||
// JumpToRuntime expects r0 to contain the number of arguments
|
||||
// JumpToExternalReference expects r0 to contain the number of arguments
|
||||
// including the receiver and the extra arguments.
|
||||
__ add(r0, r0, Operand(num_extra_args + 1));
|
||||
__ JumpToRuntime(ExternalReference(id));
|
||||
__ JumpToExternalReference(ExternalReference(id));
|
||||
}
|
||||
|
||||
|
||||
|
@ -4511,7 +4511,7 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) {
|
||||
__ bind(&gc);
|
||||
__ push(cp);
|
||||
__ push(r3);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kNewClosure), 2, 1);
|
||||
__ TailCallRuntime(Runtime::kNewClosure, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -4561,7 +4561,7 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
|
||||
|
||||
// Need to collect. Call into runtime system.
|
||||
__ bind(&gc);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kNewContext), 1, 1);
|
||||
__ TailCallRuntime(Runtime::kNewContext, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -4623,8 +4623,7 @@ void FastCloneShallowArrayStub::Generate(MacroAssembler* masm) {
|
||||
__ Ret();
|
||||
|
||||
__ bind(&slow_case);
|
||||
ExternalReference runtime(Runtime::kCreateArrayLiteralShallow);
|
||||
__ TailCallRuntime(runtime, 3, 1);
|
||||
__ TailCallRuntime(Runtime::kCreateArrayLiteralShallow, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -6197,7 +6196,7 @@ void StackCheckStub::Generate(MacroAssembler* masm) {
|
||||
// argument, so give it a Smi.
|
||||
__ mov(r0, Operand(Smi::FromInt(0)));
|
||||
__ push(r0);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kStackGuard), 1, 1);
|
||||
__ TailCallRuntime(Runtime::kStackGuard, 1, 1);
|
||||
|
||||
__ StubReturn(1);
|
||||
}
|
||||
@ -6806,7 +6805,7 @@ void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
|
||||
// by calling the runtime system.
|
||||
__ bind(&slow);
|
||||
__ push(r1);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kGetArgumentsProperty), 1, 1);
|
||||
__ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -6909,7 +6908,7 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
|
||||
|
||||
// Do the runtime call to allocate the arguments object.
|
||||
__ bind(&runtime);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kNewArgumentsFast), 3, 1);
|
||||
__ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -7353,7 +7352,7 @@ void SubStringStub::Generate(MacroAssembler* masm) {
|
||||
|
||||
// Just jump to runtime to create the sub string.
|
||||
__ bind(&runtime);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kSubString), 3, 1);
|
||||
__ TailCallRuntime(Runtime::kSubString, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -7444,7 +7443,7 @@ void StringCompareStub::Generate(MacroAssembler* masm) {
|
||||
// Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
|
||||
// tagged as a small integer.
|
||||
__ bind(&runtime);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1);
|
||||
__ TailCallRuntime(Runtime::kStringCompare, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -7658,7 +7657,7 @@ void StringAddStub::Generate(MacroAssembler* masm) {
|
||||
|
||||
// Just jump to runtime to add the two strings.
|
||||
__ bind(&string_add_runtime);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kStringAdd), 2, 1);
|
||||
__ TailCallRuntime(Runtime::kStringAdd, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -494,7 +494,8 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
|
||||
__ stm(db_w, sp, r2.bit() | r3.bit());
|
||||
|
||||
// Perform tail call to the entry.
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kLoadIC_Miss)), 2, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss));
|
||||
__ TailCallExternalReference(ref, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -531,7 +532,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
|
||||
__ ldm(ia, sp, r2.bit() | r3.bit());
|
||||
__ stm(db_w, sp, r2.bit() | r3.bit());
|
||||
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kKeyedLoadIC_Miss)), 2, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kKeyedLoadIC_Miss));
|
||||
__ TailCallExternalReference(ref, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -545,7 +547,7 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
|
||||
__ ldm(ia, sp, r2.bit() | r3.bit());
|
||||
__ stm(db_w, sp, r2.bit() | r3.bit());
|
||||
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kGetProperty), 2, 1);
|
||||
__ TailCallRuntime(Runtime::kGetProperty, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -662,7 +664,7 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
|
||||
__ push(r0); // key
|
||||
|
||||
// Perform tail call to the entry.
|
||||
__ TailCallRuntime(ExternalReference(
|
||||
__ TailCallExternalReference(ExternalReference(
|
||||
IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1);
|
||||
|
||||
__ bind(&slow);
|
||||
@ -681,7 +683,8 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
|
||||
__ ldm(ia, sp, r2.bit() | r3.bit());
|
||||
__ stm(db_w, sp, r0.bit() | r2.bit() | r3.bit());
|
||||
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kKeyedStoreIC_Miss)), 3, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss));
|
||||
__ TailCallExternalReference(ref, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -695,7 +698,7 @@ void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) {
|
||||
__ ldm(ia, sp, r1.bit() | r3.bit()); // r0 == value, r1 == key, r3 == object
|
||||
__ stm(db_w, sp, r0.bit() | r1.bit() | r3.bit());
|
||||
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3, 1);
|
||||
__ TailCallRuntime(Runtime::kSetProperty, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -854,7 +857,8 @@ void StoreIC::GenerateMiss(MacroAssembler* masm) {
|
||||
__ stm(db_w, sp, r2.bit() | r0.bit());
|
||||
|
||||
// Perform tail call to the entry.
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_Miss)), 3, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_Miss));
|
||||
__ TailCallExternalReference(ref, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -897,7 +901,8 @@ void StoreIC::GenerateArrayLength(MacroAssembler* masm) {
|
||||
__ push(receiver);
|
||||
__ push(value);
|
||||
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_ArrayLength)), 2, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_ArrayLength));
|
||||
__ TailCallExternalReference(ref, 2, 1);
|
||||
|
||||
__ bind(&miss);
|
||||
|
||||
|
@ -1234,19 +1234,26 @@ void MacroAssembler::CallExternalReference(const ExternalReference& ext,
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::TailCallRuntime(const ExternalReference& ext,
|
||||
int num_arguments,
|
||||
int result_size) {
|
||||
void MacroAssembler::TailCallExternalReference(const ExternalReference& ext,
|
||||
int num_arguments,
|
||||
int result_size) {
|
||||
// TODO(1236192): Most runtime routines don't need the number of
|
||||
// arguments passed in because it is constant. At some point we
|
||||
// should remove this need and make the runtime routine entry code
|
||||
// smarter.
|
||||
mov(r0, Operand(num_arguments));
|
||||
JumpToRuntime(ext);
|
||||
JumpToExternalReference(ext);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpToRuntime(const ExternalReference& builtin) {
|
||||
void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
|
||||
int num_arguments,
|
||||
int result_size) {
|
||||
TailCallExternalReference(ExternalReference(fid), num_arguments, result_size);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) {
|
||||
#if defined(__thumb__)
|
||||
// Thumb mode builtin.
|
||||
ASSERT((reinterpret_cast<intptr_t>(builtin.address()) & 1) == 1);
|
||||
|
@ -333,7 +333,6 @@ class MacroAssembler: public Assembler {
|
||||
void StubReturn(int argc);
|
||||
|
||||
// Call a runtime routine.
|
||||
// Eventually this should be used for all C calls.
|
||||
void CallRuntime(Runtime::Function* f, int num_arguments);
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
@ -344,14 +343,19 @@ class MacroAssembler: public Assembler {
|
||||
int num_arguments);
|
||||
|
||||
// Tail call of a runtime routine (jump).
|
||||
// Like JumpToRuntime, but also takes care of passing the number
|
||||
// Like JumpToExternalReference, but also takes care of passing the number
|
||||
// of parameters.
|
||||
void TailCallRuntime(const ExternalReference& ext,
|
||||
void TailCallExternalReference(const ExternalReference& ext,
|
||||
int num_arguments,
|
||||
int result_size);
|
||||
|
||||
// Convenience function: tail call a runtime routine (jump).
|
||||
void TailCallRuntime(Runtime::FunctionId fid,
|
||||
int num_arguments,
|
||||
int result_size);
|
||||
|
||||
// Jump to a runtime routine.
|
||||
void JumpToRuntime(const ExternalReference& builtin);
|
||||
void JumpToExternalReference(const ExternalReference& builtin);
|
||||
|
||||
// Invoke specified builtin JavaScript function. Adds an entry to
|
||||
// the unresolved list if the name does not resolve.
|
||||
|
@ -297,7 +297,7 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
|
||||
__ push(receiver_reg);
|
||||
__ mov(r2, Operand(Handle<Map>(transition)));
|
||||
__ stm(db_w, sp, r2.bit() | r0.bit());
|
||||
__ TailCallRuntime(
|
||||
__ TailCallExternalReference(
|
||||
ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage)),
|
||||
3, 1);
|
||||
return;
|
||||
@ -529,7 +529,7 @@ class LoadInterceptorCompiler BASE_EMBEDDED {
|
||||
|
||||
ExternalReference ref =
|
||||
ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
|
||||
__ TailCallRuntime(ref, 5, 1);
|
||||
__ TailCallExternalReference(ref, 5, 1);
|
||||
|
||||
__ bind(&cleanup);
|
||||
__ pop(scratch1);
|
||||
@ -549,7 +549,7 @@ class LoadInterceptorCompiler BASE_EMBEDDED {
|
||||
|
||||
ExternalReference ref = ExternalReference(
|
||||
IC_Utility(IC::kLoadPropertyWithInterceptorForLoad));
|
||||
__ TailCallRuntime(ref, 5, 1);
|
||||
__ TailCallExternalReference(ref, 5, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -719,7 +719,7 @@ bool StubCompiler::GenerateLoadCallback(JSObject* object,
|
||||
// Do tail-call to the runtime system.
|
||||
ExternalReference load_callback_property =
|
||||
ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
|
||||
__ TailCallRuntime(load_callback_property, 5, 1);
|
||||
__ TailCallExternalReference(load_callback_property, 5, 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1204,7 +1204,7 @@ Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
|
||||
// Do tail-call to the runtime system.
|
||||
ExternalReference store_callback_property =
|
||||
ExternalReference(IC_Utility(IC::kStoreCallbackProperty));
|
||||
__ TailCallRuntime(store_callback_property, 4, 1);
|
||||
__ TailCallExternalReference(store_callback_property, 4, 1);
|
||||
|
||||
// Handle store cache miss.
|
||||
__ bind(&miss);
|
||||
@ -1251,7 +1251,7 @@ Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
|
||||
// Do tail-call to the runtime system.
|
||||
ExternalReference store_ic_property =
|
||||
ExternalReference(IC_Utility(IC::kStoreInterceptorProperty));
|
||||
__ TailCallRuntime(store_ic_property, 3, 1);
|
||||
__ TailCallExternalReference(store_ic_property, 3, 1);
|
||||
|
||||
// Handle store cache miss.
|
||||
__ bind(&miss);
|
||||
|
@ -63,10 +63,10 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm,
|
||||
ASSERT(extra_args == NO_EXTRA_ARGUMENTS);
|
||||
}
|
||||
|
||||
// JumpToRuntime expects eax to contain the number of arguments
|
||||
// JumpToExternalReference expects eax to contain the number of arguments
|
||||
// including the receiver and the extra arguments.
|
||||
__ add(Operand(eax), Immediate(num_extra_args + 1));
|
||||
__ JumpToRuntime(ExternalReference(id));
|
||||
__ JumpToExternalReference(ExternalReference(id));
|
||||
}
|
||||
|
||||
|
||||
|
@ -7196,7 +7196,7 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) {
|
||||
__ push(esi);
|
||||
__ push(edx);
|
||||
__ push(ecx); // Restore return address.
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kNewClosure), 2, 1);
|
||||
__ TailCallRuntime(Runtime::kNewClosure, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -7240,7 +7240,7 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
|
||||
|
||||
// Need to collect. Call into runtime system.
|
||||
__ bind(&gc);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kNewContext), 1, 1);
|
||||
__ TailCallRuntime(Runtime::kNewContext, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -7295,8 +7295,7 @@ void FastCloneShallowArrayStub::Generate(MacroAssembler* masm) {
|
||||
__ ret(3 * kPointerSize);
|
||||
|
||||
__ bind(&slow_case);
|
||||
ExternalReference runtime(Runtime::kCreateArrayLiteralShallow);
|
||||
__ TailCallRuntime(runtime, 3, 1);
|
||||
__ TailCallRuntime(Runtime::kCreateArrayLiteralShallow, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -8248,7 +8247,7 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) {
|
||||
__ bind(&runtime_call_clear_stack);
|
||||
__ fstp(0);
|
||||
__ bind(&runtime_call);
|
||||
__ TailCallRuntime(ExternalReference(RuntimeFunction()), 1, 1);
|
||||
__ TailCallExternalReference(ExternalReference(RuntimeFunction()), 1, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -8912,7 +8911,7 @@ void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
|
||||
__ pop(ebx); // Return address.
|
||||
__ push(edx);
|
||||
__ push(ebx);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kGetArgumentsProperty), 1, 1);
|
||||
__ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -9013,7 +9012,7 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
|
||||
|
||||
// Do the runtime call to allocate the arguments object.
|
||||
__ bind(&runtime);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kNewArgumentsFast), 3, 1);
|
||||
__ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -9022,10 +9021,10 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
|
||||
// time or if regexp entry in generated code is turned off runtime switch or
|
||||
// at compilation.
|
||||
#ifndef V8_NATIVE_REGEXP
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kRegExpExec), 4, 1);
|
||||
__ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
|
||||
#else // V8_NATIVE_REGEXP
|
||||
if (!FLAG_regexp_entry_native) {
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kRegExpExec), 4, 1);
|
||||
__ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -9347,7 +9346,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
|
||||
|
||||
// Do the runtime call to execute the regexp.
|
||||
__ bind(&runtime);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kRegExpExec), 4, 1);
|
||||
__ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
|
||||
#endif // V8_NATIVE_REGEXP
|
||||
}
|
||||
|
||||
@ -9416,7 +9415,7 @@ void NumberToStringStub::Generate(MacroAssembler* masm) {
|
||||
|
||||
__ bind(&runtime);
|
||||
// Handle number to string in the runtime system if not found in the cache.
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kNumberToString), 1, 1);
|
||||
__ TailCallRuntime(Runtime::kNumberToString, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -9701,7 +9700,7 @@ void StackCheckStub::Generate(MacroAssembler* masm) {
|
||||
__ push(eax);
|
||||
|
||||
// Do tail-call to runtime routine.
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kStackGuard), 1, 1);
|
||||
__ TailCallRuntime(Runtime::kStackGuard, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -9862,9 +9861,7 @@ void ApiGetterEntryStub::Generate(MacroAssembler* masm) {
|
||||
__ LeaveExitFrame(ExitFrame::MODE_NORMAL);
|
||||
__ ret(0);
|
||||
__ bind(&promote_scheduled_exception);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kPromoteScheduledException),
|
||||
0,
|
||||
1);
|
||||
__ TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -10493,7 +10490,7 @@ void StringAddStub::Generate(MacroAssembler* masm) {
|
||||
|
||||
// Just jump to runtime to add the two strings.
|
||||
__ bind(&string_add_runtime);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kStringAdd), 2, 1);
|
||||
__ TailCallRuntime(Runtime::kStringAdd, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -10903,7 +10900,7 @@ void SubStringStub::Generate(MacroAssembler* masm) {
|
||||
|
||||
// Just jump to runtime to create the sub string.
|
||||
__ bind(&runtime);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kSubString), 3, 1);
|
||||
__ TailCallRuntime(Runtime::kSubString, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -11019,7 +11016,7 @@ void StringCompareStub::Generate(MacroAssembler* masm) {
|
||||
// Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
|
||||
// tagged as a small integer.
|
||||
__ bind(&runtime);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1);
|
||||
__ TailCallRuntime(Runtime::kStringCompare, 2, 1);
|
||||
}
|
||||
|
||||
#undef __
|
||||
|
@ -610,8 +610,9 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
|
||||
__ push(ecx); // return address
|
||||
|
||||
// Perform tail call to the entry.
|
||||
__ TailCallRuntime(ExternalReference(
|
||||
IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1);
|
||||
ExternalReference ref = ExternalReference(
|
||||
IC_Utility(kKeyedLoadPropertyWithInterceptor));
|
||||
__ TailCallExternalReference(ref, 2, 1);
|
||||
|
||||
__ bind(&slow);
|
||||
GenerateMiss(masm);
|
||||
@ -1262,7 +1263,8 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
|
||||
__ push(ebx); // return address
|
||||
|
||||
// Perform tail call to the entry.
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kLoadIC_Miss)), 2, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss));
|
||||
__ TailCallExternalReference(ref, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -1377,7 +1379,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
|
||||
__ push(ebx); // return address
|
||||
|
||||
// Perform tail call to the entry.
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kKeyedLoadIC_Miss)), 2, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kKeyedLoadIC_Miss));
|
||||
__ TailCallExternalReference(ref, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -1394,7 +1397,7 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
|
||||
__ push(ebx); // return address
|
||||
|
||||
// Perform tail call to the entry.
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kKeyedGetProperty), 2, 1);
|
||||
__ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -1431,7 +1434,8 @@ void StoreIC::GenerateMiss(MacroAssembler* masm) {
|
||||
__ push(ebx);
|
||||
|
||||
// Perform tail call to the entry.
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_Miss)), 3, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_Miss));
|
||||
__ TailCallExternalReference(ref, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -1478,7 +1482,8 @@ void StoreIC::GenerateArrayLength(MacroAssembler* masm) {
|
||||
__ push(value);
|
||||
__ push(scratch); // return address
|
||||
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_ArrayLength)), 2, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_ArrayLength));
|
||||
__ TailCallExternalReference(ref, 2, 1);
|
||||
|
||||
__ bind(&miss);
|
||||
|
||||
@ -1504,7 +1509,7 @@ void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) {
|
||||
__ push(ecx);
|
||||
|
||||
// Do tail-call to runtime routine.
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3, 1);
|
||||
__ TailCallRuntime(Runtime::kSetProperty, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -1523,7 +1528,8 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
|
||||
__ push(ecx);
|
||||
|
||||
// Do tail-call to runtime routine.
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kKeyedStoreIC_Miss)), 3, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss));
|
||||
__ TailCallExternalReference(ref, 3, 1);
|
||||
}
|
||||
|
||||
#undef __
|
||||
|
@ -1186,15 +1186,22 @@ Object* MacroAssembler::TryCallRuntime(Runtime::Function* f,
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::TailCallRuntime(const ExternalReference& ext,
|
||||
int num_arguments,
|
||||
int result_size) {
|
||||
void MacroAssembler::TailCallExternalReference(const ExternalReference& ext,
|
||||
int num_arguments,
|
||||
int result_size) {
|
||||
// TODO(1236192): Most runtime routines don't need the number of
|
||||
// arguments passed in because it is constant. At some point we
|
||||
// should remove this need and make the runtime routine entry code
|
||||
// smarter.
|
||||
Set(eax, Immediate(num_arguments));
|
||||
JumpToRuntime(ext);
|
||||
JumpToExternalReference(ext);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
|
||||
int num_arguments,
|
||||
int result_size) {
|
||||
TailCallExternalReference(ExternalReference(fid), num_arguments, result_size);
|
||||
}
|
||||
|
||||
|
||||
@ -1264,7 +1271,7 @@ Object* MacroAssembler::TryPopHandleScope(Register saved, Register scratch) {
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpToRuntime(const ExternalReference& ext) {
|
||||
void MacroAssembler::JumpToExternalReference(const ExternalReference& ext) {
|
||||
// Set the entry point and jump to the C entry runtime stub.
|
||||
mov(ebx, Immediate(ext));
|
||||
CEntryStub ces(1);
|
||||
|
@ -349,7 +349,6 @@ class MacroAssembler: public Assembler {
|
||||
void StubReturn(int argc);
|
||||
|
||||
// Call a runtime routine.
|
||||
// Eventually this should be used for all C calls.
|
||||
void CallRuntime(Runtime::Function* f, int num_arguments);
|
||||
|
||||
// Call a runtime function, returning the CodeStub object called.
|
||||
@ -367,9 +366,14 @@ class MacroAssembler: public Assembler {
|
||||
Object* TryCallRuntime(Runtime::FunctionId id, int num_arguments);
|
||||
|
||||
// Tail call of a runtime routine (jump).
|
||||
// Like JumpToRuntime, but also takes care of passing the number
|
||||
// of arguments.
|
||||
void TailCallRuntime(const ExternalReference& ext,
|
||||
// Like JumpToExternalReference, but also takes care of passing the number
|
||||
// of parameters.
|
||||
void TailCallExternalReference(const ExternalReference& ext,
|
||||
int num_arguments,
|
||||
int result_size);
|
||||
|
||||
// Convenience function: tail call a runtime routine (jump).
|
||||
void TailCallRuntime(Runtime::FunctionId fid,
|
||||
int num_arguments,
|
||||
int result_size);
|
||||
|
||||
@ -384,7 +388,7 @@ class MacroAssembler: public Assembler {
|
||||
Object* TryPopHandleScope(Register saved, Register scratch);
|
||||
|
||||
// Jump to a runtime routine.
|
||||
void JumpToRuntime(const ExternalReference& ext);
|
||||
void JumpToExternalReference(const ExternalReference& ext);
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -446,7 +446,7 @@ class LoadInterceptorCompiler BASE_EMBEDDED {
|
||||
|
||||
ExternalReference ref =
|
||||
ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
|
||||
__ TailCallRuntime(ref, 5, 1);
|
||||
__ TailCallExternalReference(ref, 5, 1);
|
||||
|
||||
__ bind(&cleanup);
|
||||
__ pop(scratch1);
|
||||
@ -468,7 +468,7 @@ class LoadInterceptorCompiler BASE_EMBEDDED {
|
||||
|
||||
ExternalReference ref = ExternalReference(
|
||||
IC_Utility(IC::kLoadPropertyWithInterceptorForLoad));
|
||||
__ TailCallRuntime(ref, 5, 1);
|
||||
__ TailCallExternalReference(ref, 5, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -907,7 +907,7 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
|
||||
__ push(Immediate(Handle<Map>(transition)));
|
||||
__ push(eax);
|
||||
__ push(scratch);
|
||||
__ TailCallRuntime(
|
||||
__ TailCallExternalReference(
|
||||
ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage)), 3, 1);
|
||||
return;
|
||||
}
|
||||
@ -1587,7 +1587,7 @@ Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
|
||||
// Do tail-call to the runtime system.
|
||||
ExternalReference store_callback_property =
|
||||
ExternalReference(IC_Utility(IC::kStoreCallbackProperty));
|
||||
__ TailCallRuntime(store_callback_property, 4, 1);
|
||||
__ TailCallExternalReference(store_callback_property, 4, 1);
|
||||
|
||||
// Handle store cache miss.
|
||||
__ bind(&miss);
|
||||
@ -1636,7 +1636,7 @@ Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
|
||||
// Do tail-call to the runtime system.
|
||||
ExternalReference store_ic_property =
|
||||
ExternalReference(IC_Utility(IC::kStoreInterceptorProperty));
|
||||
__ TailCallRuntime(store_ic_property, 3, 1);
|
||||
__ TailCallExternalReference(store_ic_property, 3, 1);
|
||||
|
||||
// Handle store cache miss.
|
||||
__ bind(&miss);
|
||||
|
@ -826,14 +826,21 @@ void MacroAssembler::CallRuntime(Runtime::FunctionId fid, int num_arguments) {
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::TailCallRuntime(const ExternalReference& ext,
|
||||
int num_arguments,
|
||||
int result_size) {
|
||||
void MacroAssembler::TailCallExternalReference(const ExternalReference& ext,
|
||||
int num_arguments,
|
||||
int result_size) {
|
||||
UNIMPLEMENTED_MIPS();
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpToRuntime(const ExternalReference& builtin) {
|
||||
void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
|
||||
int num_arguments,
|
||||
int result_size) {
|
||||
TailCallExternalReference(ExternalReference(fid), num_arguments, result_size);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) {
|
||||
UNIMPLEMENTED_MIPS();
|
||||
}
|
||||
|
||||
|
@ -268,21 +268,25 @@ class MacroAssembler: public Assembler {
|
||||
void StubReturn(int argc);
|
||||
|
||||
// Call a runtime routine.
|
||||
// Eventually this should be used for all C calls.
|
||||
void CallRuntime(Runtime::Function* f, int num_arguments);
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid, int num_arguments);
|
||||
|
||||
// Tail call of a runtime routine (jump).
|
||||
// Like JumpToRuntime, but also takes care of passing the number
|
||||
// Like JumpToExternalReference, but also takes care of passing the number
|
||||
// of parameters.
|
||||
void TailCallRuntime(const ExternalReference& ext,
|
||||
void TailCallExternalReference(const ExternalReference& ext,
|
||||
int num_arguments,
|
||||
int result_size);
|
||||
|
||||
// Convenience function: tail call a runtime routine (jump).
|
||||
void TailCallRuntime(Runtime::FunctionId fid,
|
||||
int num_arguments,
|
||||
int result_size);
|
||||
|
||||
// Jump to the builtin routine.
|
||||
void JumpToRuntime(const ExternalReference& builtin);
|
||||
void JumpToExternalReference(const ExternalReference& builtin);
|
||||
|
||||
// Invoke specified builtin JavaScript function. Adds an entry to
|
||||
// the unresolved list if the name does not resolve.
|
||||
|
@ -61,10 +61,10 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm,
|
||||
ASSERT(extra_args == NO_EXTRA_ARGUMENTS);
|
||||
}
|
||||
|
||||
// JumpToRuntime expects rax to contain the number of arguments
|
||||
// JumpToExternalReference expects rax to contain the number of arguments
|
||||
// including the receiver and the extra arguments.
|
||||
__ addq(rax, Immediate(num_extra_args + 1));
|
||||
__ JumpToRuntime(ExternalReference(id), 1);
|
||||
__ JumpToExternalReference(ExternalReference(id), 1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6345,7 +6345,7 @@ void FastNewClosureStub::Generate(MacroAssembler* masm) {
|
||||
__ push(rsi);
|
||||
__ push(rdx);
|
||||
__ push(rcx); // Restore return address.
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kNewClosure), 2, 1);
|
||||
__ TailCallRuntime(Runtime::kNewClosure, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -6387,7 +6387,7 @@ void FastNewContextStub::Generate(MacroAssembler* masm) {
|
||||
|
||||
// Need to collect. Call into runtime system.
|
||||
__ bind(&gc);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kNewContext), 1, 1);
|
||||
__ TailCallRuntime(Runtime::kNewContext, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -6443,8 +6443,7 @@ void FastCloneShallowArrayStub::Generate(MacroAssembler* masm) {
|
||||
__ ret(3 * kPointerSize);
|
||||
|
||||
__ bind(&slow_case);
|
||||
ExternalReference runtime(Runtime::kCreateArrayLiteralShallow);
|
||||
__ TailCallRuntime(runtime, 3, 1);
|
||||
__ TailCallRuntime(Runtime::kCreateArrayLiteralShallow, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -6803,10 +6802,10 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
|
||||
// time or if regexp entry in generated code is turned off runtime switch or
|
||||
// at compilation.
|
||||
#ifndef V8_NATIVE_REGEXP
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kRegExpExec), 4, 1);
|
||||
__ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
|
||||
#else // V8_NATIVE_REGEXP
|
||||
if (!FLAG_regexp_entry_native) {
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kRegExpExec), 4, 1);
|
||||
__ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -7150,7 +7149,7 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
|
||||
|
||||
// Do the runtime call to execute the regexp.
|
||||
__ bind(&runtime);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kRegExpExec), 4, 1);
|
||||
__ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
|
||||
#endif // V8_NATIVE_REGEXP
|
||||
}
|
||||
|
||||
@ -7561,7 +7560,7 @@ void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) {
|
||||
|
||||
// Do the runtime call to allocate the arguments object.
|
||||
__ bind(&runtime);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kNewArgumentsFast), 3, 1);
|
||||
__ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -7618,9 +7617,7 @@ void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) {
|
||||
__ pop(rbx); // Return address.
|
||||
__ push(rdx);
|
||||
__ push(rbx);
|
||||
Runtime::Function* f =
|
||||
Runtime::FunctionForId(Runtime::kGetArgumentsProperty);
|
||||
__ TailCallRuntime(ExternalReference(f), 1, f->result_size);
|
||||
__ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -8109,8 +8106,7 @@ void StackCheckStub::Generate(MacroAssembler* masm) {
|
||||
__ push(rax);
|
||||
|
||||
// Do tail-call to runtime routine.
|
||||
Runtime::Function* f = Runtime::FunctionForId(Runtime::kStackGuard);
|
||||
__ TailCallRuntime(ExternalReference(f), 1, f->result_size);
|
||||
__ TailCallRuntime(Runtime::kStackGuard, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -9108,7 +9104,7 @@ void StringAddStub::Generate(MacroAssembler* masm) {
|
||||
|
||||
// Just jump to runtime to add the two strings.
|
||||
__ bind(&string_add_runtime);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kStringAdd), 2, 1);
|
||||
__ TailCallRuntime(Runtime::kStringAdd, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -9302,7 +9298,7 @@ void SubStringStub::Generate(MacroAssembler* masm) {
|
||||
|
||||
// Just jump to runtime to create the sub string.
|
||||
__ bind(&runtime);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kSubString), 3, 1);
|
||||
__ TailCallRuntime(Runtime::kSubString, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -9422,7 +9418,7 @@ void StringCompareStub::Generate(MacroAssembler* masm) {
|
||||
// Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
|
||||
// tagged as a small integer.
|
||||
__ bind(&runtime);
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1);
|
||||
__ TailCallRuntime(Runtime::kStringCompare, 2, 1);
|
||||
}
|
||||
|
||||
#undef __
|
||||
|
@ -241,7 +241,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
|
||||
__ push(rbx); // return address
|
||||
|
||||
// Perform tail call to the entry.
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kKeyedLoadIC_Miss)), 2, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kKeyedLoadIC_Miss));
|
||||
__ TailCallExternalReference(ref, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -258,7 +259,7 @@ void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
|
||||
__ push(rbx); // return address
|
||||
|
||||
// Perform tail call to the entry.
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kKeyedGetProperty), 2, 1);
|
||||
__ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -608,7 +609,7 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
|
||||
__ push(rdx); // return address
|
||||
|
||||
// Perform tail call to the entry.
|
||||
__ TailCallRuntime(ExternalReference(
|
||||
__ TailCallExternalReference(ExternalReference(
|
||||
IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1);
|
||||
|
||||
__ bind(&slow);
|
||||
@ -631,7 +632,8 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
|
||||
__ push(rcx); // return address
|
||||
|
||||
// Do tail-call to runtime routine.
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kKeyedStoreIC_Miss)), 3, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss));
|
||||
__ TailCallExternalReference(ref, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -650,7 +652,7 @@ void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) {
|
||||
__ push(rcx); // return address
|
||||
|
||||
// Do tail-call to runtime routine.
|
||||
__ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3, 1);
|
||||
__ TailCallRuntime(Runtime::kSetProperty, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -1223,7 +1225,8 @@ void LoadIC::GenerateMiss(MacroAssembler* masm) {
|
||||
__ push(rbx); // return address
|
||||
|
||||
// Perform tail call to the entry.
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kLoadIC_Miss)), 2, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss));
|
||||
__ TailCallExternalReference(ref, 2, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -1385,7 +1388,8 @@ void StoreIC::GenerateMiss(MacroAssembler* masm) {
|
||||
__ push(rbx); // return address
|
||||
|
||||
// Perform tail call to the entry.
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_Miss)), 3, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_Miss));
|
||||
__ TailCallExternalReference(ref, 3, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -1449,7 +1453,8 @@ void StoreIC::GenerateArrayLength(MacroAssembler* masm) {
|
||||
__ push(value);
|
||||
__ push(scratch); // return address
|
||||
|
||||
__ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_ArrayLength)), 2, 1);
|
||||
ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_ArrayLength));
|
||||
__ TailCallExternalReference(ref, 2, 1);
|
||||
|
||||
__ bind(&miss);
|
||||
|
||||
|
@ -396,9 +396,9 @@ void MacroAssembler::CallExternalReference(const ExternalReference& ext,
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::TailCallRuntime(ExternalReference const& ext,
|
||||
int num_arguments,
|
||||
int result_size) {
|
||||
void MacroAssembler::TailCallExternalReference(const ExternalReference& ext,
|
||||
int num_arguments,
|
||||
int result_size) {
|
||||
// ----------- S t a t e -------------
|
||||
// -- rsp[0] : return address
|
||||
// -- rsp[8] : argument num_arguments - 1
|
||||
@ -411,12 +411,19 @@ void MacroAssembler::TailCallRuntime(ExternalReference const& ext,
|
||||
// should remove this need and make the runtime routine entry code
|
||||
// smarter.
|
||||
movq(rax, Immediate(num_arguments));
|
||||
JumpToRuntime(ext, result_size);
|
||||
JumpToExternalReference(ext, result_size);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpToRuntime(const ExternalReference& ext,
|
||||
int result_size) {
|
||||
void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid,
|
||||
int num_arguments,
|
||||
int result_size) {
|
||||
TailCallExternalReference(ExternalReference(fid), num_arguments, result_size);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::JumpToExternalReference(const ExternalReference& ext,
|
||||
int result_size) {
|
||||
// Set the entry point and jump to the C entry runtime stub.
|
||||
movq(rbx, ext);
|
||||
CEntryStub ces(result_size);
|
||||
|
@ -645,7 +645,6 @@ class MacroAssembler: public Assembler {
|
||||
void StubReturn(int argc);
|
||||
|
||||
// Call a runtime routine.
|
||||
// Eventually this should be used for all C calls.
|
||||
void CallRuntime(Runtime::Function* f, int num_arguments);
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
@ -656,14 +655,19 @@ class MacroAssembler: public Assembler {
|
||||
int num_arguments);
|
||||
|
||||
// Tail call of a runtime routine (jump).
|
||||
// Like JumpToRuntime, but also takes care of passing the number
|
||||
// of arguments.
|
||||
void TailCallRuntime(const ExternalReference& ext,
|
||||
// Like JumpToExternalReference, but also takes care of passing the number
|
||||
// of parameters.
|
||||
void TailCallExternalReference(const ExternalReference& ext,
|
||||
int num_arguments,
|
||||
int result_size);
|
||||
|
||||
// Convenience function: tail call a runtime routine (jump).
|
||||
void TailCallRuntime(Runtime::FunctionId fid,
|
||||
int num_arguments,
|
||||
int result_size);
|
||||
|
||||
// Jump to a runtime routine.
|
||||
void JumpToRuntime(const ExternalReference& ext, int result_size);
|
||||
void JumpToExternalReference(const ExternalReference& ext, int result_size);
|
||||
|
||||
// Before calling a C-function from generated code, align arguments on stack.
|
||||
// After aligning the frame, arguments must be stored in esp[0], esp[4],
|
||||
|
@ -236,7 +236,7 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm,
|
||||
__ Push(Handle<Map>(transition));
|
||||
__ push(rax);
|
||||
__ push(scratch);
|
||||
__ TailCallRuntime(
|
||||
__ TailCallExternalReference(
|
||||
ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage)), 3, 1);
|
||||
return;
|
||||
}
|
||||
@ -526,7 +526,7 @@ class LoadInterceptorCompiler BASE_EMBEDDED {
|
||||
|
||||
ExternalReference ref =
|
||||
ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
|
||||
__ TailCallRuntime(ref, 5, 1);
|
||||
__ TailCallExternalReference(ref, 5, 1);
|
||||
|
||||
__ bind(&cleanup);
|
||||
__ pop(scratch1);
|
||||
@ -548,7 +548,7 @@ class LoadInterceptorCompiler BASE_EMBEDDED {
|
||||
|
||||
ExternalReference ref = ExternalReference(
|
||||
IC_Utility(IC::kLoadPropertyWithInterceptorForLoad));
|
||||
__ TailCallRuntime(ref, 5, 1);
|
||||
__ TailCallExternalReference(ref, 5, 1);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -1360,7 +1360,7 @@ Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
|
||||
// Do tail-call to the runtime system.
|
||||
ExternalReference store_callback_property =
|
||||
ExternalReference(IC_Utility(IC::kStoreCallbackProperty));
|
||||
__ TailCallRuntime(store_callback_property, 4, 1);
|
||||
__ TailCallExternalReference(store_callback_property, 4, 1);
|
||||
|
||||
// Handle store cache miss.
|
||||
__ bind(&miss);
|
||||
@ -1438,7 +1438,7 @@ Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
|
||||
// Do tail-call to the runtime system.
|
||||
ExternalReference store_ic_property =
|
||||
ExternalReference(IC_Utility(IC::kStoreInterceptorProperty));
|
||||
__ TailCallRuntime(store_ic_property, 3, 1);
|
||||
__ TailCallExternalReference(store_ic_property, 3, 1);
|
||||
|
||||
// Handle store cache miss.
|
||||
__ bind(&miss);
|
||||
@ -1637,7 +1637,7 @@ bool StubCompiler::GenerateLoadCallback(JSObject* object,
|
||||
// Do tail-call to the runtime system.
|
||||
ExternalReference load_callback_property =
|
||||
ExternalReference(IC_Utility(IC::kLoadCallbackProperty));
|
||||
__ TailCallRuntime(load_callback_property, 5, 1);
|
||||
__ TailCallExternalReference(load_callback_property, 5, 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user