Fix the previously ineffective assert checking the number of arguments passed to

a runtime entry in the VM.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26826 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
regis@google.com 2013-08-28 23:07:14 +00:00
parent 97ca1b9544
commit 8171570100
30 changed files with 243 additions and 184 deletions

View file

@ -2532,8 +2532,9 @@ void Assembler::LeaveCallRuntimeFrame() {
}
void Assembler::CallRuntime(const RuntimeEntry& entry) {
entry.Call(this);
void Assembler::CallRuntime(const RuntimeEntry& entry,
intptr_t argument_count) {
entry.Call(this, argument_count);
}

View file

@ -699,7 +699,7 @@ class Assembler : public ValueObject {
void EnterCallRuntimeFrame(intptr_t frame_space);
void LeaveCallRuntimeFrame();
void CallRuntime(const RuntimeEntry& entry);
void CallRuntime(const RuntimeEntry& entry, intptr_t argument_count);
// Set up a Dart frame on entry with a frame pointer and PC information to
// enable easy access to the RawInstruction object of code corresponding

View file

@ -2200,8 +2200,9 @@ void Assembler::LeaveCallRuntimeFrame() {
}
void Assembler::CallRuntime(const RuntimeEntry& entry) {
entry.Call(this);
void Assembler::CallRuntime(const RuntimeEntry& entry,
intptr_t argument_count) {
entry.Call(this, argument_count);
}

View file

@ -670,7 +670,7 @@ class Assembler : public ValueObject {
void EnterCallRuntimeFrame(intptr_t frame_space);
void LeaveCallRuntimeFrame();
void CallRuntime(const RuntimeEntry& entry);
void CallRuntime(const RuntimeEntry& entry, intptr_t argument_count);
/*
* Loading and comparing classes of objects.

View file

@ -729,8 +729,9 @@ void Assembler::TryAllocate(const Class& cls,
}
void Assembler::CallRuntime(const RuntimeEntry& entry) {
entry.Call(this);
void Assembler::CallRuntime(const RuntimeEntry& entry,
intptr_t argument_count) {
entry.Call(this, argument_count);
}

View file

@ -1080,7 +1080,7 @@ class Assembler : public ValueObject {
const Address& dest,
const Object& value);
void CallRuntime(const RuntimeEntry& entry);
void CallRuntime(const RuntimeEntry& entry, intptr_t argument_count);
// Set up a Dart frame on entry with a frame pointer and PC information to
// enable easy access to the RawInstruction object of code corresponding

View file

@ -2372,8 +2372,9 @@ void Assembler::LeaveCallRuntimeFrame() {
}
void Assembler::CallRuntime(const RuntimeEntry& entry) {
entry.Call(this);
void Assembler::CallRuntime(const RuntimeEntry& entry,
intptr_t argument_count) {
entry.Call(this, argument_count);
}

View file

@ -689,7 +689,7 @@ class Assembler : public ValueObject {
void LeaveCallRuntimeFrame();
void CallRuntime(const RuntimeEntry& entry);
void CallRuntime(const RuntimeEntry& entry, intptr_t argument_count);
/*
* Loading and comparing classes of objects.

View file

@ -285,6 +285,7 @@ class FlowGraphCompiler : public ValueObject {
void GenerateCallRuntime(intptr_t token_pos,
intptr_t deopt_id,
const RuntimeEntry& entry,
intptr_t argument_count,
LocationSummary* locs);
void GenerateCall(intptr_t token_pos,

View file

@ -603,7 +603,7 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t token_pos,
__ PushList((1 << R1) | (1 << R2));
__ LoadObject(R0, test_cache);
__ Push(R0);
GenerateCallRuntime(token_pos, deopt_id, kInstanceofRuntimeEntry, locs);
GenerateCallRuntime(token_pos, deopt_id, kInstanceofRuntimeEntry, 5, locs);
// Pop the parameters supplied to the runtime entry. The result of the
// instanceof runtime call will be left as the result of the operation.
__ Drop(5);
@ -685,6 +685,7 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos,
GenerateCallRuntime(token_pos,
deopt_id,
kMalformedTypeErrorRuntimeEntry,
3,
locs);
// We should never return here.
__ bkpt(0);
@ -711,7 +712,7 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos,
__ PushObject(dst_name); // Push the name of the destination.
__ LoadObject(R0, test_cache);
__ Push(R0);
GenerateCallRuntime(token_pos, deopt_id, kTypeCheckRuntimeEntry, locs);
GenerateCallRuntime(token_pos, deopt_id, kTypeCheckRuntimeEntry, 6, locs);
// Pop the parameters supplied to the runtime entry. The result of the
// type check runtime call is the checked value.
__ Drop(6);
@ -1256,8 +1257,9 @@ void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id,
void FlowGraphCompiler::GenerateCallRuntime(intptr_t token_pos,
intptr_t deopt_id,
const RuntimeEntry& entry,
intptr_t argument_count,
LocationSummary* locs) {
__ CallRuntime(entry);
__ CallRuntime(entry, argument_count);
AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos);
RecordSafepoint(locs);
if (deopt_id != Isolate::kNoDeoptId) {

View file

@ -618,6 +618,7 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t token_pos,
GenerateCallRuntime(token_pos,
deopt_id,
kInstanceofRuntimeEntry,
5,
locs);
// Pop the parameters supplied to the runtime entry. The result of the
// instanceof runtime call will be left as the result of the operation.
@ -705,6 +706,7 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos,
GenerateCallRuntime(token_pos,
deopt_id,
kMalformedTypeErrorRuntimeEntry,
3,
locs);
// We should never return here.
__ int3();
@ -731,7 +733,7 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos,
__ PushObject(dst_name); // Push the name of the destination.
__ LoadObject(EAX, test_cache);
__ pushl(EAX);
GenerateCallRuntime(token_pos, deopt_id, kTypeCheckRuntimeEntry, locs);
GenerateCallRuntime(token_pos, deopt_id, kTypeCheckRuntimeEntry, 6, locs);
// Pop the parameters supplied to the runtime entry. The result of the
// type check runtime call is the checked value.
__ Drop(6);
@ -1263,8 +1265,9 @@ void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id,
void FlowGraphCompiler::GenerateCallRuntime(intptr_t token_pos,
intptr_t deopt_id,
const RuntimeEntry& entry,
intptr_t argument_count,
LocationSummary* locs) {
__ CallRuntime(entry);
__ CallRuntime(entry, argument_count);
AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos);
RecordSafepoint(locs);
if (deopt_id != Isolate::kNoDeoptId) {

View file

@ -607,7 +607,7 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t token_pos,
__ sw(A1, Address(SP, 1 * kWordSize)); // Push type arguments.
__ LoadObject(A0, test_cache);
__ sw(A0, Address(SP, 0 * kWordSize));
GenerateCallRuntime(token_pos, deopt_id, kInstanceofRuntimeEntry, locs);
GenerateCallRuntime(token_pos, deopt_id, kInstanceofRuntimeEntry, 5, locs);
// Pop the parameters supplied to the runtime entry. The result of the
// instanceof runtime call will be left as the result of the operation.
__ lw(T0, Address(SP, 5 * kWordSize));
@ -698,6 +698,7 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos,
GenerateCallRuntime(token_pos,
deopt_id,
kMalformedTypeErrorRuntimeEntry,
3,
locs);
// We should never return here.
__ break_(0);
@ -733,7 +734,7 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos,
__ LoadObject(T0, test_cache);
__ sw(T0, Address(SP, 0 * kWordSize));
GenerateCallRuntime(token_pos, deopt_id, kTypeCheckRuntimeEntry, locs);
GenerateCallRuntime(token_pos, deopt_id, kTypeCheckRuntimeEntry, 6, locs);
// Pop the parameters supplied to the runtime entry. The result of the
// type check runtime call is the checked value.
__ lw(A0, Address(SP, 6 * kWordSize));
@ -1300,8 +1301,9 @@ void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id,
void FlowGraphCompiler::GenerateCallRuntime(intptr_t token_pos,
intptr_t deopt_id,
const RuntimeEntry& entry,
intptr_t argument_count,
LocationSummary* locs) {
__ CallRuntime(entry);
__ CallRuntime(entry, argument_count);
AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos);
RecordSafepoint(locs);
if (deopt_id != Isolate::kNoDeoptId) {

View file

@ -615,6 +615,7 @@ void FlowGraphCompiler::GenerateInstanceOf(intptr_t token_pos,
GenerateCallRuntime(token_pos,
deopt_id,
kInstanceofRuntimeEntry,
5,
locs);
// Pop the parameters supplied to the runtime entry. The result of the
// instanceof runtime call will be left as the result of the operation.
@ -699,6 +700,7 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos,
GenerateCallRuntime(token_pos,
deopt_id,
kMalformedTypeErrorRuntimeEntry,
3,
locs);
// We should never return here.
__ int3();
@ -725,7 +727,7 @@ void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos,
__ PushObject(dst_name); // Push the name of the destination.
__ LoadObject(RAX, test_cache);
__ pushq(RAX);
GenerateCallRuntime(token_pos, deopt_id, kTypeCheckRuntimeEntry, locs);
GenerateCallRuntime(token_pos, deopt_id, kTypeCheckRuntimeEntry, 6, locs);
// Pop the parameters supplied to the runtime entry. The result of the
// type check runtime call is the checked value.
__ Drop(6);
@ -1258,8 +1260,9 @@ void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id,
void FlowGraphCompiler::GenerateCallRuntime(intptr_t token_pos,
intptr_t deopt_id,
const RuntimeEntry& entry,
intptr_t argument_count,
LocationSummary* locs) {
__ CallRuntime(entry);
__ CallRuntime(entry, argument_count);
AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos);
RecordSafepoint(locs);
if (deopt_id != Isolate::kNoDeoptId) {

View file

@ -249,6 +249,7 @@ static void EmitAssertBoolean(Register reg,
compiler->GenerateCallRuntime(token_pos,
deopt_id,
kConditionTypeErrorRuntimeEntry,
1,
locs);
// We should never return here.
__ bkpt(0);
@ -1799,7 +1800,7 @@ void GuardFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ Push(field_reg);
__ Push(value_reg);
__ CallRuntime(kUpdateFieldCidRuntimeEntry);
__ CallRuntime(kUpdateFieldCidRuntimeEntry, 2);
__ Drop(2); // Drop the field and the value.
}
@ -1952,6 +1953,7 @@ void AllocateObjectWithBoundsCheckInstr::EmitNativeCode(
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kAllocateObjectWithBoundsCheckRuntimeEntry,
3,
locs());
__ Drop(3);
ASSERT(locs()->out().reg() == R0);
@ -1999,6 +2001,7 @@ void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kInstantiateTypeRuntimeEntry,
2,
locs());
__ Drop(2); // Drop instantiator and uninstantiated type.
__ Pop(result_reg); // Pop instantiated type.
@ -2045,6 +2048,7 @@ void InstantiateTypeArgumentsInstr::EmitNativeCode(
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kInstantiateTypeArgumentsRuntimeEntry,
2,
locs());
__ Drop(2); // Drop instantiator and uninstantiated type arguments.
__ Pop(result_reg); // Pop instantiated type arguments.
@ -2180,6 +2184,7 @@ void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kCloneContextRuntimeEntry,
1,
locs());
__ Drop(1); // Remove argument.
__ Pop(result); // Get result (cloned context).
@ -2251,6 +2256,7 @@ class CheckStackOverflowSlowPath : public SlowPathCode {
compiler->GenerateCallRuntime(instruction_->token_pos(),
instruction_->deopt_id(),
kStackOverflowRuntimeEntry,
0,
instruction_->locs());
if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) {
@ -4185,7 +4191,7 @@ void InvokeMathCFunctionInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// Args must be in D0 and D1, so move arg from Q1(== D3:D2) to D1.
__ vmovd(D1, D2);
}
__ CallRuntime(TargetFunction());
__ CallRuntime(TargetFunction(), InputCount());
__ Bind(&skip_call);
}
@ -4434,6 +4440,7 @@ void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kThrowRuntimeEntry,
1,
locs());
__ bkpt(0);
}
@ -4448,6 +4455,7 @@ void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kReThrowRuntimeEntry,
2,
locs());
__ bkpt(0);
}

View file

@ -197,6 +197,7 @@ static void EmitAssertBoolean(Register reg,
compiler->GenerateCallRuntime(token_pos,
deopt_id,
kConditionTypeErrorRuntimeEntry,
1,
locs);
// We should never return here.
__ int3();
@ -1887,7 +1888,7 @@ void GuardFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ pushl(field_reg);
__ pushl(value_reg);
__ CallRuntime(kUpdateFieldCidRuntimeEntry);
__ CallRuntime(kUpdateFieldCidRuntimeEntry, 2);
__ Drop(2); // Drop the field and the value.
}
@ -2041,6 +2042,7 @@ void AllocateObjectWithBoundsCheckInstr::EmitNativeCode(
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kAllocateObjectWithBoundsCheckRuntimeEntry,
3,
locs());
__ Drop(3);
ASSERT(locs()->out().reg() == EAX);
@ -2087,6 +2089,7 @@ void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kInstantiateTypeRuntimeEntry,
2,
locs());
__ Drop(2); // Drop instantiator and uninstantiated type.
__ popl(result_reg); // Pop instantiated type.
@ -2134,6 +2137,7 @@ void InstantiateTypeArgumentsInstr::EmitNativeCode(
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kInstantiateTypeArgumentsRuntimeEntry,
2,
locs());
__ Drop(2); // Drop instantiator and uninstantiated type arguments.
__ popl(result_reg); // Pop instantiated type arguments.
@ -2271,6 +2275,7 @@ void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kCloneContextRuntimeEntry,
1,
locs());
__ popl(result); // Remove argument.
__ popl(result); // Get result (cloned context).
@ -2337,6 +2342,7 @@ class CheckStackOverflowSlowPath : public SlowPathCode {
compiler->GenerateCallRuntime(instruction_->token_pos(),
instruction_->deopt_id(),
kStackOverflowRuntimeEntry,
0,
instruction_->locs());
if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) {
@ -4243,7 +4249,7 @@ void InvokeMathCFunctionInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// exp is Nan case is handled correctly in the C-library.
}
__ Bind(&do_call);
__ CallRuntime(TargetFunction());
__ CallRuntime(TargetFunction(), InputCount());
__ fstpl(Address(ESP, 0));
__ movsd(locs()->out().fpu_reg(), Address(ESP, 0));
__ Bind(&skip_call);
@ -4780,6 +4786,7 @@ void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kThrowRuntimeEntry,
1,
locs());
__ int3();
}
@ -4794,6 +4801,7 @@ void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kReThrowRuntimeEntry,
2,
locs());
__ int3();
}

View file

@ -252,6 +252,7 @@ static void EmitAssertBoolean(Register reg,
compiler->GenerateCallRuntime(token_pos,
deopt_id,
kConditionTypeErrorRuntimeEntry,
1,
locs);
// We should never return here.
__ break_(0);
@ -1869,7 +1870,7 @@ void GuardFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ addiu(SP, SP, Immediate(-2 * kWordSize));
__ sw(field_reg, Address(SP, 1 * kWordSize));
__ sw(value_reg, Address(SP, 0 * kWordSize));
__ CallRuntime(kUpdateFieldCidRuntimeEntry);
__ CallRuntime(kUpdateFieldCidRuntimeEntry, 2);
__ Drop(2); // Drop the field and the value.
}
@ -2025,6 +2026,7 @@ void AllocateObjectWithBoundsCheckInstr::EmitNativeCode(
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kAllocateObjectWithBoundsCheckRuntimeEntry,
3,
locs());
__ Drop(3);
ASSERT(locs()->out().reg() == V0);
@ -2077,6 +2079,7 @@ void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kInstantiateTypeRuntimeEntry,
2,
locs());
// Pop instantiated type.
__ lw(result_reg, Address(SP, 2 * kWordSize));
@ -2130,6 +2133,7 @@ void InstantiateTypeArgumentsInstr::EmitNativeCode(
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kInstantiateTypeArgumentsRuntimeEntry,
2,
locs());
// Pop instantiated type arguments.
__ lw(result_reg, Address(SP, 2 * kWordSize));
@ -2272,6 +2276,7 @@ void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kCloneContextRuntimeEntry,
1,
locs());
__ lw(result, Address(SP, 1 * kWordSize)); // Get result (cloned context).
__ addiu(SP, SP, Immediate(2 * kWordSize));
@ -2347,6 +2352,7 @@ class CheckStackOverflowSlowPath : public SlowPathCode {
compiler->GenerateCallRuntime(instruction_->token_pos(),
instruction_->deopt_id(),
kStackOverflowRuntimeEntry,
0,
instruction_->locs());
if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) {
@ -3579,7 +3585,7 @@ void InvokeMathCFunctionInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
__ Bind(&do_call);
// double values are passed and returned in vfp registers.
__ CallRuntime(TargetFunction());
__ CallRuntime(TargetFunction(), InputCount());
__ Bind(&skip_call);
}
@ -3830,6 +3836,7 @@ void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kThrowRuntimeEntry,
1,
locs());
__ break_(0);
}
@ -3844,6 +3851,7 @@ void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kReThrowRuntimeEntry,
2,
locs());
__ break_(0);
}

View file

@ -362,6 +362,7 @@ static void EmitAssertBoolean(Register reg,
compiler->GenerateCallRuntime(token_pos,
deopt_id,
kConditionTypeErrorRuntimeEntry,
1,
locs);
// We should never return here.
__ int3();
@ -1832,7 +1833,7 @@ void GuardFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ pushq(field_reg);
__ pushq(value_reg);
__ CallRuntime(kUpdateFieldCidRuntimeEntry);
__ CallRuntime(kUpdateFieldCidRuntimeEntry, 2);
__ Drop(2); // Drop the field and the value.
}
@ -1982,6 +1983,7 @@ void AllocateObjectWithBoundsCheckInstr::EmitNativeCode(
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kAllocateObjectWithBoundsCheckRuntimeEntry,
3,
locs());
__ Drop(3);
ASSERT(locs()->out().reg() == RAX);
@ -2028,6 +2030,7 @@ void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kInstantiateTypeRuntimeEntry,
2,
locs());
__ Drop(2); // Drop instantiator and uninstantiated type.
__ popq(result_reg); // Pop instantiated type.
@ -2075,6 +2078,7 @@ void InstantiateTypeArgumentsInstr::EmitNativeCode(
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kInstantiateTypeArgumentsRuntimeEntry,
2,
locs());
__ Drop(2); // Drop instantiator and uninstantiated type arguments.
__ popq(result_reg); // Pop instantiated type arguments.
@ -2212,6 +2216,7 @@ void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kCloneContextRuntimeEntry,
1,
locs());
__ popq(result); // Remove argument.
__ popq(result); // Get result (cloned context).
@ -2279,6 +2284,7 @@ class CheckStackOverflowSlowPath : public SlowPathCode {
compiler->GenerateCallRuntime(instruction_->token_pos(),
instruction_->deopt_id(),
kStackOverflowRuntimeEntry,
0,
instruction_->locs());
if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) {
@ -4298,7 +4304,7 @@ void InvokeMathCFunctionInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// exp is Nan case is handled correctly in the C-library.
}
__ Bind(&do_call);
__ CallRuntime(TargetFunction());
__ CallRuntime(TargetFunction(), InputCount());
__ movaps(locs()->out().fpu_reg(), XMM0);
__ Bind(&skip_call);
__ leave();
@ -4553,6 +4559,7 @@ void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kThrowRuntimeEntry,
1,
locs());
__ int3();
}
@ -4567,6 +4574,7 @@ void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
kReThrowRuntimeEntry,
2,
locs());
__ int3();
}

View file

@ -23,7 +23,7 @@ typedef void (*RuntimeFunction)(NativeArguments arguments);
class RuntimeEntry : public ValueObject {
public:
RuntimeEntry(const char* name, RuntimeFunction function,
int argument_count, bool is_leaf, bool is_float)
intptr_t argument_count, bool is_leaf, bool is_float)
: name_(name),
function_(function),
argument_count_(argument_count),
@ -33,18 +33,18 @@ class RuntimeEntry : public ValueObject {
const char* name() const { return name_; }
RuntimeFunction function() const { return function_; }
int argument_count() const { return argument_count_; }
intptr_t argument_count() const { return argument_count_; }
bool is_leaf() const { return is_leaf_; }
bool is_float() const { return is_float_; }
uword GetEntryPoint() const { return reinterpret_cast<uword>(function()); }
// Generate code to call the runtime entry.
void Call(Assembler* assembler) const;
void Call(Assembler* assembler, intptr_t argument_count) const;
private:
const char* name_;
const RuntimeFunction function_;
const int argument_count_;
const intptr_t argument_count_;
const bool is_leaf_;
const bool is_float_;

View file

@ -21,7 +21,7 @@ namespace dart {
// SP : points to the arguments and return value array.
// R5 : address of the runtime function to call.
// R4 : number of arguments to the call.
void RuntimeEntry::Call(Assembler* assembler) const {
void RuntimeEntry::Call(Assembler* assembler, intptr_t argument_count) const {
// Compute the effective address. When running under the simulator,
// this is a redirection address that forces the simulator to call
// into the runtime system.
@ -29,23 +29,26 @@ void RuntimeEntry::Call(Assembler* assembler) const {
#if defined(USING_SIMULATOR)
// Redirection to leaf runtime calls supports a maximum of 4 arguments passed
// in registers (maximum 2 double arguments for leaf float runtime calls).
ASSERT(argument_count() >= 0);
ASSERT(argument_count >= 0);
ASSERT(!is_leaf() ||
(!is_float() && (argument_count() <= 4)) ||
(argument_count() <= 2));
(!is_float() && (argument_count <= 4)) ||
(argument_count <= 2));
Simulator::CallKind call_kind =
is_leaf() ? (is_float() ? Simulator::kLeafFloatRuntimeCall
: Simulator::kLeafRuntimeCall)
: Simulator::kRuntimeCall;
entry =
Simulator::RedirectExternalReference(entry, call_kind, argument_count());
Simulator::RedirectExternalReference(entry, call_kind, argument_count);
#endif
if (is_leaf()) {
ASSERT(argument_count == this->argument_count());
ExternalLabel label(name(), entry);
__ BranchLink(&label);
} else {
// Argument count is not checked here, but in the runtime entry for a more
// informative error message.
__ LoadImmediate(R5, entry);
__ LoadImmediate(R4, argument_count());
__ LoadImmediate(R4, argument_count);
__ BranchLink(&StubCode::CallToRuntimeLabel());
}
}

View file

@ -23,14 +23,17 @@ namespace dart {
// EDX : number of arguments to the call.
// For leaf calls the caller is responsible to setup the arguments
// and look for return values based on the C calling convention.
void RuntimeEntry::Call(Assembler* assembler) const {
if (!is_leaf()) {
__ movl(ECX, Immediate(GetEntryPoint()));
__ movl(EDX, Immediate(argument_count()));
__ call(&StubCode::CallToRuntimeLabel());
} else {
void RuntimeEntry::Call(Assembler* assembler, intptr_t argument_count) const {
if (is_leaf()) {
ASSERT(argument_count == this->argument_count());
ExternalLabel label(name(), GetEntryPoint());
__ call(&label);
} else {
// Argument count is not checked here, but in the runtime entry for a more
// informative error message.
__ movl(ECX, Immediate(GetEntryPoint()));
__ movl(EDX, Immediate(argument_count));
__ call(&StubCode::CallToRuntimeLabel());
}
}

View file

@ -21,7 +21,7 @@ namespace dart {
// SP : points to the arguments and return value array.
// S5 : address of the runtime function to call.
// S4 : number of arguments to the call.
void RuntimeEntry::Call(Assembler* assembler) const {
void RuntimeEntry::Call(Assembler* assembler, intptr_t argument_count) const {
// Compute the effective address. When running under the simulator,
// this is a redirection address that forces the simulator to call
// into the runtime system.
@ -29,23 +29,26 @@ void RuntimeEntry::Call(Assembler* assembler) const {
#if defined(USING_SIMULATOR)
// Redirection to leaf runtime calls supports a maximum of 4 arguments passed
// in registers (maximum 2 double arguments for leaf float runtime calls).
ASSERT(argument_count() >= 0);
ASSERT(argument_count >= 0);
ASSERT(!is_leaf() ||
(!is_float() && (argument_count() <= 4)) ||
(argument_count() <= 2));
(!is_float() && (argument_count <= 4)) ||
(argument_count <= 2));
Simulator::CallKind call_kind =
is_leaf() ? (is_float() ? Simulator::kLeafFloatRuntimeCall
: Simulator::kLeafRuntimeCall)
: Simulator::kRuntimeCall;
entry =
Simulator::RedirectExternalReference(entry, call_kind, argument_count());
Simulator::RedirectExternalReference(entry, call_kind, argument_count);
#endif
if (is_leaf()) {
ASSERT(argument_count == this->argument_count());
ExternalLabel label(name(), entry);
__ BranchLink(&label);
} else {
// Argument count is not checked here, but in the runtime entry for a more
// informative error message.
__ LoadImmediate(S5, entry);
__ LoadImmediate(S4, argument_count());
__ LoadImmediate(S4, argument_count);
__ BranchLink(&StubCode::CallToRuntimeLabel());
}
}

View file

@ -20,14 +20,17 @@ namespace dart {
// RSP : points to the arguments and return value array.
// RBX : address of the runtime function to call.
// R10 : number of arguments to the call.
void RuntimeEntry::Call(Assembler* assembler) const {
if (!is_leaf()) {
__ movq(RBX, Immediate(GetEntryPoint()));
__ movq(R10, Immediate(argument_count()));
__ call(&StubCode::CallToRuntimeLabel());
} else {
void RuntimeEntry::Call(Assembler* assembler, intptr_t argument_count) const {
if (is_leaf()) {
ASSERT(argument_count == this->argument_count());
ExternalLabel label(name(), GetEntryPoint());
__ call(&label);
} else {
// Argument count is not checked here, but in the runtime entry for a more
// informative error message.
__ movq(RBX, Immediate(GetEntryPoint()));
__ movq(R10, Immediate(argument_count));
__ call(&StubCode::CallToRuntimeLabel());
}
}

View file

@ -113,7 +113,7 @@ END_LEAF_RUNTIME_ENTRY
void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) {
__ EnterCallRuntimeFrame(0);
// Call the runtime leaf function. R0 already contains the parameter.
__ CallRuntime(kPrintStopMessageRuntimeEntry);
__ CallRuntime(kPrintStopMessageRuntimeEntry, 1);
__ LeaveCallRuntimeFrame();
__ Ret();
}
@ -291,7 +291,7 @@ void StubCode::GenerateCallStaticFunctionStub(Assembler* assembler) {
// Setup space on stack for return value and preserve arguments descriptor.
__ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
__ PushList((1 << R0) | (1 << R4));
__ CallRuntime(kPatchStaticCallRuntimeEntry);
__ CallRuntime(kPatchStaticCallRuntimeEntry, 0);
// Get Code object result and restore arguments descriptor array.
__ PopList((1 << R0) | (1 << R4));
// Remove the stub frame.
@ -313,7 +313,7 @@ void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) {
// Setup space on stack for return value and preserve arguments descriptor.
__ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
__ PushList((1 << R0) | (1 << R4));
__ CallRuntime(kFixCallersTargetRuntimeEntry);
__ CallRuntime(kFixCallersTargetRuntimeEntry, 0);
// Get Code object result and restore arguments descriptor array.
__ PopList((1 << R0) | (1 << R4));
// Remove the stub frame.
@ -377,7 +377,7 @@ void StubCode::GenerateInstanceFunctionLookupStub(Assembler* assembler) {
// R2: Smi-tagged arguments array length.
PushArgumentsArray(assembler);
__ CallRuntime(kInstanceFunctionLookupRuntimeEntry);
__ CallRuntime(kInstanceFunctionLookupRuntimeEntry, 4);
// Remove arguments.
__ Drop(4);
@ -447,7 +447,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
__ mov(R0, ShifterOperand(SP)); // Pass address of saved registers block.
__ ReserveAlignedFrameSpace(0);
__ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry);
__ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 1);
// Result (R0) is stack-size (FP - SP) in bytes.
if (preserve_result) {
@ -468,7 +468,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
__ Push(R1); // Preserve result as first local.
}
__ ReserveAlignedFrameSpace(0);
__ CallRuntime(kDeoptimizeFillFrameRuntimeEntry); // Pass last FP in R0.
__ CallRuntime(kDeoptimizeFillFrameRuntimeEntry, 1); // Pass last FP in R0.
if (preserve_result) {
// Restore result into R1.
__ ldr(R1, Address(FP, kFirstLocalSlotFromFp * kWordSize));
@ -484,7 +484,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
__ Push(R1); // Preserve result, it will be GC-d here.
}
__ PushObject(Smi::ZoneHandle()); // Space for the result.
__ CallRuntime(kDeoptimizeMaterializeRuntimeEntry);
__ CallRuntime(kDeoptimizeMaterializeRuntimeEntry, 0);
// Result tells stub how many bytes to remove from the expression stack
// of the bottom-most frame. They were used as materialization arguments.
__ Pop(R1);
@ -528,7 +528,7 @@ void StubCode::GenerateMegamorphicMissStub(Assembler* assembler) {
// Push arguments descriptor array.
__ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
__ PushList((1 << R4) | (1 << R5) | (1 << R6) | (1 << IP));
__ CallRuntime(kMegamorphicCacheMissHandlerRuntimeEntry);
__ CallRuntime(kMegamorphicCacheMissHandlerRuntimeEntry, 3);
// Remove arguments.
__ Drop(3);
__ Pop(R0); // Get result into R0.
@ -667,7 +667,7 @@ void StubCode::GenerateAllocateArrayStub(Assembler* assembler) {
// Setup space on stack for return value.
// Push array length as Smi and element type.
__ PushList((1 << R1) | (1 << R2) | (1 << IP));
__ CallRuntime(kAllocateArrayRuntimeEntry);
__ CallRuntime(kAllocateArrayRuntimeEntry, 2);
// Pop arguments; result is popped in IP.
__ PopList((1 << R1) | (1 << R2) | (1 << IP)); // R2 is restored.
__ mov(R0, ShifterOperand(IP));
@ -724,7 +724,7 @@ void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) {
// Preserve arguments descriptor array and read-only function object argument.
__ PushList((1 << R2) | (1 << R4));
__ CallRuntime(kCompileFunctionRuntimeEntry);
__ CallRuntime(kCompileFunctionRuntimeEntry, 1);
// Restore arguments descriptor array and read-only function object argument.
__ PopList((1 << R2) | (1 << R4));
// Restore R0.
@ -759,7 +759,7 @@ void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) {
__ ldr(R2, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
PushArgumentsArray(assembler);
__ CallRuntime(kInvokeNonClosureRuntimeEntry);
__ CallRuntime(kInvokeNonClosureRuntimeEntry, 2);
// Remove arguments.
__ Drop(2);
__ Pop(R0); // Get result into R0.
@ -982,7 +982,7 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
__ LoadImmediate(R2, reinterpret_cast<intptr_t>(Object::null()));
__ SmiTag(R1);
__ PushList((1 << R1) | (1 << R2));
__ CallRuntime(kAllocateContextRuntimeEntry); // Allocate context.
__ CallRuntime(kAllocateContextRuntimeEntry, 1); // Allocate context.
__ Drop(1); // Pop number of context variables argument.
__ Pop(R0); // Pop the new context object.
// R0: new object
@ -1047,7 +1047,7 @@ void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
__ EnterCallRuntimeFrame(0 * kWordSize);
__ ldr(R0, FieldAddress(CTX, Context::isolate_offset()));
__ CallRuntime(kStoreBufferBlockProcessRuntimeEntry);
__ CallRuntime(kStoreBufferBlockProcessRuntimeEntry, 1);
// Restore callee-saved registers, tear down frame.
__ LeaveCallRuntimeFrame();
__ Ret();
@ -1212,7 +1212,7 @@ void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
__ LoadImmediate(R1, Smi::RawValue(StubCode::kNoInstantiator));
__ PushList((1 << R1) | (1 << R2));
}
__ CallRuntime(kAllocateObjectRuntimeEntry); // Allocate object.
__ CallRuntime(kAllocateObjectRuntimeEntry, 3); // Allocate object.
__ Drop(3); // Pop arguments.
__ Pop(R0); // Pop result (newly allocated object).
// R0: new object
@ -1345,11 +1345,11 @@ void StubCode::GenerateAllocationStubForClosure(Assembler* assembler,
__ Push(R0); // Push type arguments of closure to be allocated or null.
if (is_implicit_instance_closure) {
__ CallRuntime(kAllocateImplicitInstanceClosureRuntimeEntry);
__ CallRuntime(kAllocateImplicitInstanceClosureRuntimeEntry, 3);
__ Drop(2); // Pop arguments (type arguments of object and receiver).
} else {
ASSERT(func.IsNonImplicitClosureFunction());
__ CallRuntime(kAllocateClosureRuntimeEntry);
__ CallRuntime(kAllocateClosureRuntimeEntry, 2);
__ Drop(1); // Pop argument (type arguments of object).
}
__ Drop(1); // Pop function object.
@ -1387,7 +1387,7 @@ void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) {
// R2: Smi-tagged arguments array length.
PushArgumentsArray(assembler);
__ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry);
__ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, 4);
// Remove arguments.
__ Drop(4);
__ Pop(R0); // Get result into R0.
@ -1408,7 +1408,7 @@ void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) {
__ PushList((1 << R5) | (1 << R6)); // Preserve.
__ Push(ic_reg); // Argument.
__ Push(func_reg); // Argument.
__ CallRuntime(kTraceICCallRuntimeEntry);
__ CallRuntime(kTraceICCallRuntimeEntry, 2);
__ Drop(2); // Discard argument;
__ PopList((1 << R5) | (1 << R6)); // Restore.
__ LeaveStubFrame();
@ -1467,7 +1467,7 @@ void StubCode::GenerateNArgsCheckInlineCacheStub(
__ b(&not_stepping, EQ);
__ EnterStubFrame();
__ Push(R5); // Preserve IC data.
__ CallRuntime(kSingleStepHandlerRuntimeEntry);
__ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
__ Pop(R5);
__ LeaveStubFrame();
__ Bind(&not_stepping);
@ -1552,7 +1552,7 @@ void StubCode::GenerateNArgsCheckInlineCacheStub(
}
// Pass IC data object.
__ Push(R5);
__ CallRuntime(handle_ic_miss);
__ CallRuntime(handle_ic_miss, num_args + 1);
// Remove the call arguments pushed earlier, including the IC data object.
__ Drop(num_args + 1);
// Pop returned code object into R0 (null if not found).
@ -1693,7 +1693,7 @@ void StubCode::GenerateZeroArgsUnoptimizedStaticCallStub(Assembler* assembler) {
__ b(&not_stepping, EQ);
__ EnterStubFrame();
__ Push(R5); // Preserve IC data.
__ CallRuntime(kSingleStepHandlerRuntimeEntry);
__ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
__ Pop(R5);
__ LeaveStubFrame();
__ Bind(&not_stepping);
@ -1728,7 +1728,7 @@ void StubCode::GenerateZeroArgsUnoptimizedStaticCallStub(Assembler* assembler) {
// Preserve target function and IC data object.
__ PushList((1 << R1) | (1 << R5));
__ Push(R1); // Pass function.
__ CallRuntime(kCompileFunctionRuntimeEntry);
__ CallRuntime(kCompileFunctionRuntimeEntry, 1);
__ Drop(1); // Discard argument.
__ PopList((1 << R1) | (1 << R5)); // Restore function and IC data.
__ LeaveStubFrame();
@ -1766,7 +1766,7 @@ void StubCode::GenerateBreakpointStaticStub(Assembler* assembler) {
__ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
// Preserve arguments descriptor and make room for result.
__ PushList((1 << R0) | (1 << R5));
__ CallRuntime(kBreakpointStaticHandlerRuntimeEntry);
__ CallRuntime(kBreakpointStaticHandlerRuntimeEntry, 0);
// Pop code object result and restore arguments descriptor.
__ PopList((1 << R0) | (1 << R5));
__ LeaveStubFrame();
@ -1787,7 +1787,7 @@ void StubCode::GenerateBreakpointReturnStub(Assembler* assembler) {
// calling into the runtime.
__ EnterStubFrame();
__ Push(R0);
__ CallRuntime(kBreakpointReturnHandlerRuntimeEntry);
__ CallRuntime(kBreakpointReturnHandlerRuntimeEntry, 0);
__ Pop(R0);
__ LeaveStubFrame();
@ -1805,7 +1805,7 @@ void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) {
// calling into the runtime.
__ EnterStubFrame();
__ Push(R5);
__ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry);
__ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0);
__ Pop(R5);
__ LeaveStubFrame();
@ -2032,7 +2032,7 @@ void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) {
__ PushList((1 << R0) | (1 << R1));
__ PushObject(Symbols::EqualOperator()); // Target's name.
__ Push(R5); // ICData
__ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry); // Clobbers R4, R5.
__ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry, 4); // Clobbers R4, R5.
__ Drop(2);
__ PopList((1 << R0) | (1 << R1));
__ b(&compute_result);
@ -2048,7 +2048,7 @@ void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
__ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
__ Push(IP); // Setup space on stack for return value.
__ Push(R6);
__ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry);
__ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry, 1);
__ Pop(R0); // Discard argument.
__ Pop(R0); // Get Code object
__ Pop(R4); // Restore argument descriptor.
@ -2122,7 +2122,7 @@ void StubCode::GenerateIdenticalWithNumberCheckStub(Assembler* assembler,
__ EnterStubFrame(0);
__ ReserveAlignedFrameSpace(2 * kWordSize);
__ stm(IA, SP, (1 << R0) | (1 << R1));
__ CallRuntime(kBigintCompareRuntimeEntry);
__ CallRuntime(kBigintCompareRuntimeEntry, 2);
// Result in R0, 0 means equal.
__ LeaveStubFrame();
__ cmp(R0, ShifterOperand(0));
@ -2148,7 +2148,7 @@ void StubCode::GenerateUnoptimizedIdenticalWithNumberCheckStub(
__ CompareImmediate(R1, 0);
__ b(&not_stepping, EQ);
__ EnterStubFrame();
__ CallRuntime(kSingleStepHandlerRuntimeEntry);
__ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
__ LeaveStubFrame();
__ Bind(&not_stepping);

View file

@ -51,7 +51,7 @@ static void GenerateCallToCallRuntimeStub(Assembler* assembler,
__ PushObject(smi1); // Push argument 1 smi1.
__ PushObject(smi2); // Push argument 2 smi2.
ASSERT(kTestSmiSubRuntimeEntry.argument_count() == argc);
__ CallRuntime(kTestSmiSubRuntimeEntry); // Call SmiSub runtime func.
__ CallRuntime(kTestSmiSubRuntimeEntry, argc); // Call SmiSub runtime func.
__ AddImmediate(SP, argc * kWordSize);
__ Pop(R0); // Pop return value from return slot.
__ LeaveDartFrame();
@ -86,7 +86,7 @@ static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler,
__ ReserveAlignedFrameSpace(0);
__ LoadObject(R0, smi1); // Set up argument 1 smi1.
__ LoadObject(R1, smi2); // Set up argument 2 smi2.
__ CallRuntime(kTestLeafSmiAddRuntimeEntry); // Call SmiAdd runtime func.
__ CallRuntime(kTestLeafSmiAddRuntimeEntry, 2); // Call SmiAdd runtime func.
__ LeaveDartFrame();
__ Ret(); // Return value is in R0.
}

View file

@ -107,7 +107,7 @@ END_LEAF_RUNTIME_ENTRY
void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) {
__ EnterCallRuntimeFrame(1 * kWordSize);
__ movl(Address(ESP, 0), EAX);
__ CallRuntime(kPrintStopMessageRuntimeEntry);
__ CallRuntime(kPrintStopMessageRuntimeEntry, 1);
__ LeaveCallRuntimeFrame();
__ ret();
}
@ -263,7 +263,7 @@ void StubCode::GenerateCallStaticFunctionStub(Assembler* assembler) {
__ EnterStubFrame();
__ pushl(EDX); // Preserve arguments descriptor array.
__ pushl(raw_null); // Setup space on stack for return value.
__ CallRuntime(kPatchStaticCallRuntimeEntry);
__ CallRuntime(kPatchStaticCallRuntimeEntry, 0);
__ popl(EAX); // Get Code object result.
__ popl(EDX); // Restore arguments descriptor array.
// Remove the stub frame as we are about to jump to the dart function.
@ -286,7 +286,7 @@ void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) {
__ EnterStubFrame();
__ pushl(EDX); // Preserve arguments descriptor array.
__ pushl(raw_null); // Setup space on stack for return value.
__ CallRuntime(kFixCallersTargetRuntimeEntry);
__ CallRuntime(kFixCallersTargetRuntimeEntry, 0);
__ popl(EAX); // Get Code object.
__ popl(EDX); // Restore arguments descriptor array.
__ movl(EAX, FieldAddress(EAX, Code::instructions_offset()));
@ -357,7 +357,7 @@ void StubCode::GenerateInstanceFunctionLookupStub(Assembler* assembler) {
__ movl(EDX, EDI); // Smi-tagged arguments array length.
PushArgumentsArray(assembler);
__ CallRuntime(kInstanceFunctionLookupRuntimeEntry);
__ CallRuntime(kInstanceFunctionLookupRuntimeEntry, 4);
// Remove arguments.
__ Drop(4);
@ -422,7 +422,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
__ movl(ECX, ESP); // Preserve saved registers block.
__ ReserveAlignedFrameSpace(1 * kWordSize);
__ movl(Address(ESP, 0), ECX); // Start of register block.
__ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry);
__ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 1);
// Result (EAX) is stack-size (FP - SP) in bytes.
if (preserve_result) {
@ -443,7 +443,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
}
__ ReserveAlignedFrameSpace(1 * kWordSize);
__ movl(Address(ESP, 0), EBP); // Pass last FP as parameter on stack.
__ CallRuntime(kDeoptimizeFillFrameRuntimeEntry);
__ CallRuntime(kDeoptimizeFillFrameRuntimeEntry, 1);
if (preserve_result) {
// Restore result into EBX.
__ movl(EBX, Address(EBP, kFirstLocalSlotFromFp * kWordSize));
@ -459,7 +459,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
__ pushl(EBX); // Preserve result, it will be GC-d here.
}
__ pushl(Immediate(Smi::RawValue(0))); // Space for the result.
__ CallRuntime(kDeoptimizeMaterializeRuntimeEntry);
__ CallRuntime(kDeoptimizeMaterializeRuntimeEntry, 0);
// Result tells stub how many bytes to remove from the expression stack
// of the bottom-most frame. They were used as materialization arguments.
__ popl(EBX);
@ -511,7 +511,7 @@ void StubCode::GenerateMegamorphicMissStub(Assembler* assembler) {
__ pushl(EAX); // Pass receiver.
__ pushl(ECX); // Pass IC data.
__ pushl(EDX); // Pass arguments descriptor.
__ CallRuntime(kMegamorphicCacheMissHandlerRuntimeEntry);
__ CallRuntime(kMegamorphicCacheMissHandlerRuntimeEntry, 3);
// Discard arguments.
__ popl(EAX);
__ popl(EAX);
@ -662,7 +662,7 @@ void StubCode::GenerateAllocateArrayStub(Assembler* assembler) {
__ pushl(raw_null); // Setup space on stack for return value.
__ pushl(EDX); // Array length as Smi.
__ pushl(ECX); // Element type.
__ CallRuntime(kAllocateArrayRuntimeEntry);
__ CallRuntime(kAllocateArrayRuntimeEntry, 2);
__ popl(EAX); // Pop element type argument.
__ popl(EDX); // Pop array length argument.
__ popl(EAX); // Pop return value from return slot.
@ -719,7 +719,7 @@ void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) {
__ pushl(EDX); // Preserve arguments descriptor array.
__ pushl(ECX); // Preserve read-only function object argument.
__ CallRuntime(kCompileFunctionRuntimeEntry);
__ CallRuntime(kCompileFunctionRuntimeEntry, 1);
__ popl(ECX); // Restore read-only function object argument in ECX.
__ popl(EDX); // Restore arguments descriptor array.
// Restore EAX.
@ -755,7 +755,7 @@ void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) {
__ movl(EDX, FieldAddress(EDX, ArgumentsDescriptor::count_offset()));
PushArgumentsArray(assembler);
__ CallRuntime(kInvokeNonClosureRuntimeEntry);
__ CallRuntime(kInvokeNonClosureRuntimeEntry, 2);
// Remove arguments.
__ Drop(2);
__ popl(EAX); // Get result into EAX.
@ -1004,7 +1004,7 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
__ pushl(raw_null); // Setup space on stack for return value.
__ SmiTag(EDX);
__ pushl(EDX);
__ CallRuntime(kAllocateContextRuntimeEntry); // Allocate context.
__ CallRuntime(kAllocateContextRuntimeEntry, 1); // Allocate context.
__ popl(EAX); // Pop number of context variables argument.
__ popl(EAX); // Pop the new context object.
// EAX: new object
@ -1075,7 +1075,7 @@ void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
__ EnterCallRuntimeFrame(1 * kWordSize);
__ movl(EAX, FieldAddress(CTX, Context::isolate_offset()));
__ movl(Address(ESP, 0), EAX); // Push the isolate as the only argument.
__ CallRuntime(kStoreBufferBlockProcessRuntimeEntry);
__ CallRuntime(kStoreBufferBlockProcessRuntimeEntry, 1);
// Restore callee-saved registers, tear down frame.
__ LeaveCallRuntimeFrame();
__ ret();
@ -1245,7 +1245,7 @@ void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
__ pushl(raw_null); // Push null type arguments.
__ pushl(Immediate(Smi::RawValue(StubCode::kNoInstantiator)));
}
__ CallRuntime(kAllocateObjectRuntimeEntry); // Allocate object.
__ CallRuntime(kAllocateObjectRuntimeEntry, 3); // Allocate object.
__ popl(EAX); // Pop argument (instantiator).
__ popl(EAX); // Pop argument (type arguments of object).
__ popl(EAX); // Pop argument (class of object).
@ -1379,12 +1379,12 @@ void StubCode::GenerateAllocationStubForClosure(Assembler* assembler,
__ pushl(raw_null); // Push null type arguments.
}
if (is_implicit_instance_closure) {
__ CallRuntime(kAllocateImplicitInstanceClosureRuntimeEntry);
__ CallRuntime(kAllocateImplicitInstanceClosureRuntimeEntry, 3);
__ popl(EAX); // Pop argument (type arguments of object).
__ popl(EAX); // Pop receiver.
} else {
ASSERT(func.IsNonImplicitClosureFunction());
__ CallRuntime(kAllocateClosureRuntimeEntry);
__ CallRuntime(kAllocateClosureRuntimeEntry, 2);
__ popl(EAX); // Pop argument (type arguments of object).
}
__ popl(EAX); // Pop function object.
@ -1423,7 +1423,7 @@ void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) {
// EDX: Smi-tagged arguments array length.
PushArgumentsArray(assembler);
__ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry);
__ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, 4);
// Remove arguments.
__ Drop(4);
@ -1446,7 +1446,7 @@ void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) {
__ pushl(ic_reg); // Preserve.
__ pushl(ic_reg); // Argument.
__ pushl(func_reg); // Argument.
__ CallRuntime(kTraceICCallRuntimeEntry);
__ CallRuntime(kTraceICCallRuntimeEntry, 2);
__ popl(EAX); // Discard argument;
__ popl(EAX); // Discard argument;
__ popl(ic_reg); // Restore.
@ -1504,7 +1504,7 @@ void StubCode::GenerateNArgsCheckInlineCacheStub(
__ EnterStubFrame();
__ pushl(ECX);
__ CallRuntime(kSingleStepHandlerRuntimeEntry);
__ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
__ popl(ECX);
__ LeaveFrame();
__ Bind(&not_stepping);
@ -1583,7 +1583,7 @@ void StubCode::GenerateNArgsCheckInlineCacheStub(
__ pushl(EBX);
}
__ pushl(ECX); // Pass IC data object.
__ CallRuntime(handle_ic_miss);
__ CallRuntime(handle_ic_miss, num_args + 1);
// Remove the call arguments pushed earlier, including the IC data object.
for (intptr_t i = 0; i < num_args + 1; i++) {
__ popl(EAX);
@ -1740,7 +1740,7 @@ void StubCode::GenerateZeroArgsUnoptimizedStaticCallStub(Assembler* assembler) {
__ EnterStubFrame();
__ pushl(ECX);
__ CallRuntime(kSingleStepHandlerRuntimeEntry);
__ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
__ popl(ECX);
__ LeaveFrame();
__ Bind(&not_stepping);
@ -1772,7 +1772,7 @@ void StubCode::GenerateZeroArgsUnoptimizedStaticCallStub(Assembler* assembler) {
__ pushl(EDI); // Preserve target function.
__ pushl(ECX); // Preserve IC data object.
__ pushl(EDI); // Pass function.
__ CallRuntime(kCompileFunctionRuntimeEntry);
__ CallRuntime(kCompileFunctionRuntimeEntry, 1);
__ popl(EAX); // Discard argument.
__ popl(ECX); // Restore IC data object.
__ popl(EDI); // Restore target function.
@ -1807,7 +1807,7 @@ void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
const Immediate& raw_null =
Immediate(reinterpret_cast<intptr_t>(Object::null()));
__ pushl(raw_null); // Room for result.
__ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry);
__ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
__ popl(EAX); // Address of original stub.
__ popl(EDX); // Restore arguments.
__ popl(ECX);
@ -1826,7 +1826,7 @@ void StubCode::GenerateBreakpointStaticStub(Assembler* assembler) {
const Immediate& raw_null =
Immediate(reinterpret_cast<intptr_t>(Object::null()));
__ pushl(raw_null); // Room for result.
__ CallRuntime(kBreakpointStaticHandlerRuntimeEntry);
__ CallRuntime(kBreakpointStaticHandlerRuntimeEntry, 0);
__ popl(EAX); // Code object.
__ popl(ECX); // Restore ICData.
__ LeaveFrame();
@ -1850,7 +1850,7 @@ void StubCode::GenerateBreakpointReturnStub(Assembler* assembler) {
// calling into the runtime.
__ EnterStubFrame();
__ pushl(EAX);
__ CallRuntime(kBreakpointReturnHandlerRuntimeEntry);
__ CallRuntime(kBreakpointReturnHandlerRuntimeEntry, 0);
__ popl(EAX);
__ LeaveFrame();
@ -1870,7 +1870,7 @@ void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) {
// calling into the runtime.
__ EnterStubFrame();
__ pushl(ECX);
__ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry);
__ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0);
__ popl(ECX);
__ LeaveFrame();
@ -2123,7 +2123,7 @@ void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) {
__ pushl(EAX); // arg 1
__ PushObject(Symbols::EqualOperator()); // Target's name.
__ pushl(ECX); // ICData
__ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry);
__ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry, 4);
__ Drop(4);
__ LeaveFrame();
@ -2141,7 +2141,7 @@ void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
__ pushl(EDX);
__ pushl(raw_null); // Setup space on stack for return value.
__ pushl(EDI);
__ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry);
__ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry, 1);
__ popl(EAX); // Discard argument.
__ popl(EAX); // Get Code object
__ popl(EDX); // Restore argument descriptor.
@ -2211,7 +2211,7 @@ void StubCode::GenerateIdenticalWithNumberCheckStub(Assembler* assembler,
__ ReserveAlignedFrameSpace(2 * kWordSize);
__ movl(Address(ESP, 1 * kWordSize), left);
__ movl(Address(ESP, 0 * kWordSize), right);
__ CallRuntime(kBigintCompareRuntimeEntry);
__ CallRuntime(kBigintCompareRuntimeEntry, 2);
// Result in EAX, 0 means equal.
__ LeaveFrame();
__ cmpl(EAX, Immediate(0));
@ -2238,7 +2238,7 @@ void StubCode::GenerateUnoptimizedIdenticalWithNumberCheckStub(
__ j(EQUAL, &not_stepping, Assembler::kNearJump);
__ EnterStubFrame();
__ CallRuntime(kSingleStepHandlerRuntimeEntry);
__ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
__ LeaveFrame();
__ Bind(&not_stepping);

View file

@ -51,7 +51,7 @@ static void GenerateCallToCallRuntimeStub(Assembler* assembler,
__ PushObject(smi1); // Push argument 1 smi1.
__ PushObject(smi2); // Push argument 2 smi2.
ASSERT(kTestSmiSubRuntimeEntry.argument_count() == argc);
__ CallRuntime(kTestSmiSubRuntimeEntry); // Call SmiSub runtime func.
__ CallRuntime(kTestSmiSubRuntimeEntry, argc); // Call SmiSub runtime func.
__ AddImmediate(ESP, Immediate(argc * kWordSize));
__ popl(EAX); // Pop return value from return slot.
__ leave();
@ -88,7 +88,7 @@ static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler,
__ movl(Address(ESP, 0), EAX); // Push argument 1 smi1.
__ LoadObject(EAX, smi2);
__ movl(Address(ESP, kWordSize), EAX); // Push argument 2 smi2.
__ CallRuntime(kTestLeafSmiAddRuntimeEntry); // Call SmiAdd runtime func.
__ CallRuntime(kTestLeafSmiAddRuntimeEntry, 2); // Call SmiAdd runtime func.
__ leave();
__ ret(); // Return value is in EAX.
}

View file

@ -125,7 +125,7 @@ END_LEAF_RUNTIME_ENTRY
void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) {
__ EnterCallRuntimeFrame(0);
// Call the runtime leaf function. A0 already contains the parameter.
__ CallRuntime(kPrintStopMessageRuntimeEntry);
__ CallRuntime(kPrintStopMessageRuntimeEntry, 1);
__ LeaveCallRuntimeFrame();
__ Ret();
}
@ -328,7 +328,7 @@ void StubCode::GenerateCallStaticFunctionStub(Assembler* assembler) {
__ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
__ sw(TMP, Address(SP, 0 * kWordSize));
__ CallRuntime(kPatchStaticCallRuntimeEntry);
__ CallRuntime(kPatchStaticCallRuntimeEntry, 0);
__ TraceSimMsg("CallStaticFunctionStub return");
// Get Code object result and restore arguments descriptor array.
@ -357,7 +357,7 @@ void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) {
__ sw(S4, Address(SP, 1 * kWordSize));
__ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
__ sw(TMP, Address(SP, 0 * kWordSize));
__ CallRuntime(kFixCallersTargetRuntimeEntry);
__ CallRuntime(kFixCallersTargetRuntimeEntry, 0);
// Get Code object result and restore arguments descriptor array.
__ lw(T0, Address(SP, 0 * kWordSize));
__ lw(S4, Address(SP, 1 * kWordSize));
@ -438,7 +438,7 @@ void StubCode::GenerateInstanceFunctionLookupStub(Assembler* assembler) {
PushArgumentsArray(assembler);
__ TraceSimMsg("InstanceFunctionLookupStub return");
__ CallRuntime(kInstanceFunctionLookupRuntimeEntry);
__ CallRuntime(kInstanceFunctionLookupRuntimeEntry, 4);
__ lw(V0, Address(SP, 4 * kWordSize)); // Get result into V0.
__ addiu(SP, SP, Immediate(5 * kWordSize)); // Remove arguments.
@ -521,7 +521,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
__ mov(A0, SP); // Pass address of saved registers block.
__ ReserveAlignedFrameSpace(1 * kWordSize);
__ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry);
__ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 1);
// Result (V0) is stack-size (FP - SP) in bytes, incl. the return address.
if (preserve_result) {
@ -549,7 +549,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
__ Push(T1); // Preserve result as first local.
}
__ ReserveAlignedFrameSpace(1 * kWordSize);
__ CallRuntime(kDeoptimizeFillFrameRuntimeEntry); // Pass last FP in A0.
__ CallRuntime(kDeoptimizeFillFrameRuntimeEntry, 1); // Pass last FP in A0.
if (preserve_result) {
// Restore result into T1.
__ lw(T1, Address(FP, kFirstLocalSlotFromFp * kWordSize));
@ -569,7 +569,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
__ Push(T1); // Preserve result, it will be GC-d here.
}
__ PushObject(Smi::ZoneHandle()); // Space for the result.
__ CallRuntime(kDeoptimizeMaterializeRuntimeEntry);
__ CallRuntime(kDeoptimizeMaterializeRuntimeEntry, 0);
// Result tells stub how many bytes to remove from the expression stack
// of the bottom-most frame. They were used as materialization arguments.
__ Pop(T1);
@ -621,7 +621,7 @@ void StubCode::GenerateMegamorphicMissStub(Assembler* assembler) {
__ sw(S5, Address(SP, 1 * kWordSize));
__ sw(S4, Address(SP, 0 * kWordSize));
__ CallRuntime(kMegamorphicCacheMissHandlerRuntimeEntry);
__ CallRuntime(kMegamorphicCacheMissHandlerRuntimeEntry, 3);
__ lw(T0, Address(SP, 3 * kWordSize)); // Get result.
__ lw(S4, Address(SP, 4 * kWordSize)); // Restore argument descriptor.
@ -768,7 +768,7 @@ void StubCode::GenerateAllocateArrayStub(Assembler* assembler) {
__ sw(TMP, Address(SP, 2 * kWordSize));
__ sw(A1, Address(SP, 1 * kWordSize));
__ sw(A0, Address(SP, 0 * kWordSize));
__ CallRuntime(kAllocateArrayRuntimeEntry);
__ CallRuntime(kAllocateArrayRuntimeEntry, 2);
__ TraceSimMsg("AllocateArrayStub return");
// Pop arguments; result is popped in IP.
__ lw(V0, Address(SP, 2 * kWordSize));
@ -838,7 +838,7 @@ void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) {
__ addiu(SP, SP, Immediate(-2 * kWordSize));
__ sw(S4, Address(SP, 1 * kWordSize));
__ sw(T2, Address(SP, 0 * kWordSize));
__ CallRuntime(kCompileFunctionRuntimeEntry);
__ CallRuntime(kCompileFunctionRuntimeEntry, 1);
__ TraceSimMsg("GenerateCallClosureFunctionStub return");
// Restore arguments descriptor array and read-only function object argument.
__ lw(T2, Address(SP, 0 * kWordSize));
@ -888,7 +888,7 @@ void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) {
// TOS + 5: PC marker (0 for stub).
// TOS + 6: Last argument of caller.
// ....
__ CallRuntime(kInvokeNonClosureRuntimeEntry);
__ CallRuntime(kInvokeNonClosureRuntimeEntry, 2);
__ lw(V0, Address(SP, 2 * kWordSize)); // Get result into V0.
__ addiu(SP, SP, Immediate(3 * kWordSize)); // Remove arguments.
@ -1129,7 +1129,7 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
__ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
__ sw(TMP, Address(SP, 1 * kWordSize)); // Store null.
__ sw(T1, Address(SP, 0 * kWordSize));
__ CallRuntime(kAllocateContextRuntimeEntry); // Allocate context.
__ CallRuntime(kAllocateContextRuntimeEntry, 1); // Allocate context.
__ lw(V0, Address(SP, 1 * kWordSize)); // Get the new context.
__ addiu(SP, SP, Immediate(2 * kWordSize)); // Pop argument and return.
@ -1206,7 +1206,7 @@ void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
__ EnterCallRuntimeFrame(1 * kWordSize);
__ lw(A0, FieldAddress(CTX, Context::isolate_offset()));
__ CallRuntime(kStoreBufferBlockProcessRuntimeEntry);
__ CallRuntime(kStoreBufferBlockProcessRuntimeEntry, 1);
__ TraceSimMsg("UpdateStoreBufferStub return");
// Restore callee-saved registers, tear down frame.
__ LeaveCallRuntimeFrame();
@ -1379,7 +1379,7 @@ void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
__ sw(T7, Address(SP, 1 * kWordSize));
__ sw(T1, Address(SP, 0 * kWordSize));
}
__ CallRuntime(kAllocateObjectRuntimeEntry); // Allocate object.
__ CallRuntime(kAllocateObjectRuntimeEntry, 3); // Allocate object.
__ TraceSimMsg("AllocationStubForClass return");
// Pop result (newly allocated object).
__ lw(V0, Address(SP, 3 * kWordSize));
@ -1518,11 +1518,11 @@ void StubCode::GenerateAllocationStubForClosure(Assembler* assembler,
__ sw(T2, Address(SP, 0 * kWordSize));
if (is_implicit_instance_closure) {
__ CallRuntime(kAllocateImplicitInstanceClosureRuntimeEntry);
__ CallRuntime(kAllocateImplicitInstanceClosureRuntimeEntry, 3);
__ TraceSimMsg("AllocationStubForClosure return");
} else {
ASSERT(func.IsNonImplicitClosureFunction());
__ CallRuntime(kAllocateClosureRuntimeEntry);
__ CallRuntime(kAllocateClosureRuntimeEntry, 2);
__ TraceSimMsg("AllocationStubForClosure return");
}
__ lw(V0, Address(SP, (num_slots - 1) * kWordSize)); // Pop function object.
@ -1565,7 +1565,7 @@ void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) {
// A1: Smi-tagged arguments array length.
PushArgumentsArray(assembler);
__ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry);
__ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, 4);
__ lw(V0, Address(SP, 4 * kWordSize)); // Get result into V0.
__ LeaveStubFrameAndReturn();
@ -1587,7 +1587,7 @@ void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) {
__ sw(S5, Address(SP, 2 * kWordSize));
__ sw(ic_reg, Address(SP, 1 * kWordSize)); // Argument.
__ sw(func_reg, Address(SP, 0 * kWordSize)); // Argument.
__ CallRuntime(kTraceICCallRuntimeEntry);
__ CallRuntime(kTraceICCallRuntimeEntry, 2);
__ lw(S5, Address(SP, 2 * kWordSize));
__ lw(T0, Address(SP, 3 * kWordSize));
__ addiu(SP, SP, Immediate(4 * kWordSize)); // Discard argument;
@ -1650,7 +1650,7 @@ void StubCode::GenerateNArgsCheckInlineCacheStub(
__ addiu(SP, SP, Immediate(-2 * kWordSize));
__ sw(S5, Address(SP, 1 * kWordSize)); // Preserve IC data.
__ sw(RA, Address(SP, 0 * kWordSize)); // Return address.
__ CallRuntime(kSingleStepHandlerRuntimeEntry);
__ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
__ lw(RA, Address(SP, 0 * kWordSize));
__ lw(S5, Address(SP, 1 * kWordSize));
__ addiu(SP, SP, Immediate(2 * kWordSize));
@ -1751,7 +1751,7 @@ void StubCode::GenerateNArgsCheckInlineCacheStub(
}
// Pass IC data object.
__ sw(S5, Address(SP, (num_slots - num_args - 4) * kWordSize));
__ CallRuntime(handle_ic_miss);
__ CallRuntime(handle_ic_miss, num_args + 1);
__ TraceSimMsg("NArgsCheckInlineCacheStub return");
// Pop returned code object into T3 (null if not found).
// Restore arguments descriptor array and IC data array.
@ -1904,7 +1904,7 @@ void StubCode::GenerateZeroArgsUnoptimizedStaticCallStub(Assembler* assembler) {
__ addiu(SP, SP, Immediate(-2 * kWordSize));
__ sw(S5, Address(SP, 1 * kWordSize)); // Preserve IC data.
__ sw(RA, Address(SP, 0 * kWordSize)); // Return address.
__ CallRuntime(kSingleStepHandlerRuntimeEntry);
__ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
__ lw(RA, Address(SP, 0 * kWordSize));
__ lw(S5, Address(SP, 1 * kWordSize));
__ addiu(SP, SP, Immediate(2 * kWordSize));
@ -1945,7 +1945,7 @@ void StubCode::GenerateZeroArgsUnoptimizedStaticCallStub(Assembler* assembler) {
__ sw(S5, Address(SP, 2 * kWordSize)); // Preserve IC data.
__ sw(T3, Address(SP, 1 * kWordSize)); // Preserve function.
__ sw(T3, Address(SP, 0 * kWordSize)); // Function argument.
__ CallRuntime(kCompileFunctionRuntimeEntry);
__ CallRuntime(kCompileFunctionRuntimeEntry, 1);
__ lw(T3, Address(SP, 1 * kWordSize)); // Restore function.
__ lw(S5, Address(SP, 2 * kWordSize)); // Restore IC data.
__ addiu(SP, SP, Immediate(3 * kWordSize));
@ -1988,7 +1988,7 @@ void StubCode::GenerateBreakpointStaticStub(Assembler* assembler) {
__ sw(S5, Address(SP, 1 * kWordSize));
__ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
__ sw(TMP, Address(SP, 0 * kWordSize));
__ CallRuntime(kBreakpointStaticHandlerRuntimeEntry);
__ CallRuntime(kBreakpointStaticHandlerRuntimeEntry, 0);
// Pop code object result and restore arguments descriptor.
__ lw(T0, Address(SP, 0 * kWordSize));
__ lw(S5, Address(SP, 1 * kWordSize));
@ -2012,7 +2012,7 @@ void StubCode::GenerateBreakpointReturnStub(Assembler* assembler) {
// calling into the runtime.
__ EnterStubFrame();
__ Push(V0);
__ CallRuntime(kBreakpointReturnHandlerRuntimeEntry);
__ CallRuntime(kBreakpointReturnHandlerRuntimeEntry, 0);
__ Pop(V0);
__ LeaveStubFrame();
@ -2030,7 +2030,7 @@ void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) {
__ TraceSimMsg("BreakpointDynamicStub");
__ EnterStubFrame();
__ Push(S5);
__ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry);
__ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0);
__ Pop(S5);
__ LeaveStubFrame();
@ -2285,7 +2285,7 @@ void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) {
__ LoadObject(TMP1, Symbols::EqualOperator()); // Target's name.
__ sw(TMP1, Address(SP, 1 * kWordSize));
__ sw(T0, Address(SP, 0 * kWordSize)); // ICData.
__ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry);
__ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry, 4);
__ lw(A0, Address(SP, 2 * kWordSize));
__ lw(A1, Address(SP, 3 * kWordSize));
__ b(&compute_result);
@ -2305,7 +2305,7 @@ void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
__ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
__ sw(TMP, Address(SP, 1 * kWordSize));
__ sw(T0, Address(SP, 0 * kWordSize));
__ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry);
__ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry, 1);
__ TraceSimMsg("OptimizeFunctionStub return");
__ lw(T0, Address(SP, 1 * kWordSize)); // Get Code object
__ lw(S4, Address(SP, 2 * kWordSize)); // Restore argument descriptor.
@ -2392,7 +2392,7 @@ void StubCode::GenerateIdenticalWithNumberCheckStub(Assembler* assembler,
__ sw(right, Address(SP, 0 * kWordSize));
__ mov(A0, left);
__ mov(A1, right);
__ CallRuntime(kBigintCompareRuntimeEntry);
__ CallRuntime(kBigintCompareRuntimeEntry, 2);
__ TraceSimMsg("IdenticalWithNumberCheckStub return");
// Result in V0, 0 means equal.
__ LeaveStubFrame();
@ -2422,7 +2422,7 @@ void StubCode::GenerateUnoptimizedIdenticalWithNumberCheckStub(
// Call single step callback in debugger.
__ addiu(SP, SP, Immediate(-1 * kWordSize));
__ sw(RA, Address(SP, 0 * kWordSize)); // Return address.
__ CallRuntime(kSingleStepHandlerRuntimeEntry);
__ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
__ lw(RA, Address(SP, 0 * kWordSize));
__ addiu(SP, SP, Immediate(1 * kWordSize));
__ Bind(&not_stepping);

View file

@ -51,7 +51,7 @@ static void GenerateCallToCallRuntimeStub(Assembler* assembler,
__ PushObject(smi1); // Push argument 1 smi1.
__ PushObject(smi2); // Push argument 2 smi2.
ASSERT(kTestSmiSubRuntimeEntry.argument_count() == argc);
__ CallRuntime(kTestSmiSubRuntimeEntry); // Call SmiSub runtime func.
__ CallRuntime(kTestSmiSubRuntimeEntry, argc); // Call SmiSub runtime func.
__ addiu(SP, SP, Immediate(argc * kWordSize));
__ Pop(V0); // Pop return value from return slot.
__ LeaveDartFrameAndReturn();
@ -85,7 +85,7 @@ static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler,
__ ReserveAlignedFrameSpace(0);
__ LoadObject(A0, smi1); // Set up argument 1 smi1.
__ LoadObject(A1, smi2); // Set up argument 2 smi2.
__ CallRuntime(kTestLeafSmiAddRuntimeEntry); // Call SmiAdd runtime func.
__ CallRuntime(kTestLeafSmiAddRuntimeEntry, 2); // Call SmiAdd runtime func.
__ LeaveDartFrameAndReturn(); // Return value is in V0.
}

View file

@ -109,7 +109,7 @@ END_LEAF_RUNTIME_ENTRY
void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) {
__ EnterCallRuntimeFrame(0);
// Call the runtime leaf function. RDI already contains the parameter.
__ CallRuntime(kPrintStopMessageRuntimeEntry);
__ CallRuntime(kPrintStopMessageRuntimeEntry, 1);
__ LeaveCallRuntimeFrame();
__ ret();
}
@ -260,7 +260,7 @@ void StubCode::GenerateCallStaticFunctionStub(Assembler* assembler) {
__ EnterStubFrame();
__ pushq(R10); // Preserve arguments descriptor array.
__ pushq(raw_null); // Setup space on stack for return value.
__ CallRuntime(kPatchStaticCallRuntimeEntry);
__ CallRuntime(kPatchStaticCallRuntimeEntry, 0);
__ popq(RAX); // Get Code object result.
__ popq(R10); // Restore arguments descriptor array.
// Remove the stub frame as we are about to jump to the dart function.
@ -281,7 +281,7 @@ void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) {
__ EnterStubFrame();
__ pushq(R10); // Preserve arguments descriptor array.
__ pushq(raw_null); // Setup space on stack for return value.
__ CallRuntime(kFixCallersTargetRuntimeEntry);
__ CallRuntime(kFixCallersTargetRuntimeEntry, 0);
__ popq(RAX); // Get Code object.
__ popq(R10); // Restore arguments descriptor array.
__ movq(RAX, FieldAddress(RAX, Code::instructions_offset()));
@ -350,7 +350,7 @@ void StubCode::GenerateInstanceFunctionLookupStub(Assembler* assembler) {
__ movq(R10, R13); // Smi-tagged arguments array length.
PushArgumentsArray(assembler);
__ CallRuntime(kInstanceFunctionLookupRuntimeEntry);
__ CallRuntime(kInstanceFunctionLookupRuntimeEntry, 4);
// Remove arguments.
__ Drop(4);
@ -414,7 +414,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
__ movq(RDI, RSP); // Pass address of saved registers block.
__ ReserveAlignedFrameSpace(0);
__ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry);
__ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 1);
// Result (RAX) is stack-size (FP - SP) in bytes.
if (preserve_result) {
@ -435,7 +435,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
}
__ ReserveAlignedFrameSpace(0);
__ movq(RDI, RBP); // Pass last FP as parameter in RDI.
__ CallRuntime(kDeoptimizeFillFrameRuntimeEntry);
__ CallRuntime(kDeoptimizeFillFrameRuntimeEntry, 1);
if (preserve_result) {
// Restore result into RBX.
__ movq(RBX, Address(RBP, kFirstLocalSlotFromFp * kWordSize));
@ -451,7 +451,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
__ pushq(RBX); // Preserve result, it will be GC-d here.
}
__ pushq(Immediate(Smi::RawValue(0))); // Space for the result.
__ CallRuntime(kDeoptimizeMaterializeRuntimeEntry);
__ CallRuntime(kDeoptimizeMaterializeRuntimeEntry, 0);
// Result tells stub how many bytes to remove from the expression stack
// of the bottom-most frame. They were used as materialization arguments.
__ popq(RBX);
@ -503,7 +503,7 @@ void StubCode::GenerateMegamorphicMissStub(Assembler* assembler) {
__ pushq(RAX); // Receiver.
__ pushq(RBX); // IC data.
__ pushq(R10); // Arguments descriptor.
__ CallRuntime(kMegamorphicCacheMissHandlerRuntimeEntry);
__ CallRuntime(kMegamorphicCacheMissHandlerRuntimeEntry, 3);
// Discard arguments.
__ popq(RAX);
__ popq(RAX);
@ -648,7 +648,7 @@ void StubCode::GenerateAllocateArrayStub(Assembler* assembler) {
__ pushq(raw_null); // Setup space on stack for return value.
__ pushq(R10); // Array length as Smi.
__ pushq(RBX); // Element type.
__ CallRuntime(kAllocateArrayRuntimeEntry);
__ CallRuntime(kAllocateArrayRuntimeEntry, 2);
__ popq(RAX); // Pop element type argument.
__ popq(R10); // Pop array length argument.
__ popq(RAX); // Pop return value from return slot.
@ -704,7 +704,7 @@ void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) {
__ pushq(R10); // Preserve arguments descriptor array.
__ pushq(RBX); // Preserve read-only function object argument.
__ CallRuntime(kCompileFunctionRuntimeEntry);
__ CallRuntime(kCompileFunctionRuntimeEntry, 1);
__ popq(RBX); // Restore read-only function object argument in RBX.
__ popq(R10); // Restore arguments descriptor array.
// Restore RAX.
@ -740,7 +740,7 @@ void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) {
__ movq(R10, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
PushArgumentsArray(assembler);
__ CallRuntime(kInvokeNonClosureRuntimeEntry);
__ CallRuntime(kInvokeNonClosureRuntimeEntry, 2);
// Remove arguments.
__ Drop(2);
@ -991,7 +991,7 @@ void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
__ pushq(raw_null); // Setup space on stack for the return value.
__ SmiTag(R10);
__ pushq(R10); // Push number of context variables.
__ CallRuntime(kAllocateContextRuntimeEntry); // Allocate context.
__ CallRuntime(kAllocateContextRuntimeEntry, 1); // Allocate context.
__ popq(RAX); // Pop number of context variables argument.
__ popq(RAX); // Pop the new context object.
// RAX: new object
@ -1057,7 +1057,7 @@ void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
// Setup frame, push callee-saved registers.
__ EnterCallRuntimeFrame(0);
__ movq(RDI, FieldAddress(CTX, Context::isolate_offset()));
__ CallRuntime(kStoreBufferBlockProcessRuntimeEntry);
__ CallRuntime(kStoreBufferBlockProcessRuntimeEntry, 1);
__ LeaveCallRuntimeFrame();
__ ret();
}
@ -1227,7 +1227,7 @@ void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
__ pushq(raw_null); // Push null type arguments.
__ pushq(Immediate(Smi::RawValue(StubCode::kNoInstantiator)));
}
__ CallRuntime(kAllocateObjectRuntimeEntry); // Allocate object.
__ CallRuntime(kAllocateObjectRuntimeEntry, 3); // Allocate object.
__ popq(RAX); // Pop argument (instantiator).
__ popq(RAX); // Pop argument (type arguments of object).
__ popq(RAX); // Pop argument (class of object).
@ -1363,12 +1363,12 @@ void StubCode::GenerateAllocationStubForClosure(Assembler* assembler,
__ pushq(raw_null); // Push null type arguments.
}
if (is_implicit_instance_closure) {
__ CallRuntime(kAllocateImplicitInstanceClosureRuntimeEntry);
__ CallRuntime(kAllocateImplicitInstanceClosureRuntimeEntry, 3);
__ popq(RAX); // Pop type arguments.
__ popq(RAX); // Pop receiver.
} else {
ASSERT(func.IsNonImplicitClosureFunction());
__ CallRuntime(kAllocateClosureRuntimeEntry);
__ CallRuntime(kAllocateClosureRuntimeEntry, 2);
__ popq(RAX); // Pop type arguments.
}
__ popq(RAX); // Pop the function object.
@ -1405,7 +1405,7 @@ void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) {
__ movq(R10, R13); // Smi-tagged arguments array length.
PushArgumentsArray(assembler);
__ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry);
__ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, 4);
// Remove arguments.
__ Drop(4);
@ -1428,7 +1428,7 @@ void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) {
__ pushq(ic_reg); // Preserve.
__ pushq(ic_reg); // Argument.
__ pushq(func_reg); // Argument.
__ CallRuntime(kTraceICCallRuntimeEntry);
__ CallRuntime(kTraceICCallRuntimeEntry, 2);
__ popq(RAX); // Discard argument;
__ popq(RAX); // Discard argument;
__ popq(ic_reg); // Restore.
@ -1485,7 +1485,7 @@ void StubCode::GenerateNArgsCheckInlineCacheStub(
__ j(EQUAL, &not_stepping, Assembler::kNearJump);
__ EnterStubFrame();
__ pushq(RBX);
__ CallRuntime(kSingleStepHandlerRuntimeEntry);
__ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
__ popq(RBX);
__ LeaveFrame();
__ Bind(&not_stepping);
@ -1561,7 +1561,7 @@ void StubCode::GenerateNArgsCheckInlineCacheStub(
__ pushq(RCX);
}
__ pushq(RBX); // Pass IC data object.
__ CallRuntime(handle_ic_miss);
__ CallRuntime(handle_ic_miss, num_args + 1);
// Remove the call arguments pushed earlier, including the IC data object.
for (intptr_t i = 0; i < num_args + 1; i++) {
__ popq(RAX);
@ -1716,7 +1716,7 @@ void StubCode::GenerateZeroArgsUnoptimizedStaticCallStub(Assembler* assembler) {
__ j(EQUAL, &not_stepping, Assembler::kNearJump);
__ EnterStubFrame();
__ pushq(RBX); // Preserve IC data object.
__ CallRuntime(kSingleStepHandlerRuntimeEntry);
__ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
__ popq(RBX);
__ LeaveFrame();
__ Bind(&not_stepping);
@ -1750,7 +1750,7 @@ void StubCode::GenerateZeroArgsUnoptimizedStaticCallStub(Assembler* assembler) {
__ pushq(R13); // Preserve target function.
__ pushq(RBX); // Preserve IC data object.
__ pushq(R13); // Pass function.
__ CallRuntime(kCompileFunctionRuntimeEntry);
__ CallRuntime(kCompileFunctionRuntimeEntry, 1);
__ popq(RAX); // Discard argument.
__ popq(RBX); // Restore IC data object.
__ popq(R13); // Restore target function.
@ -1786,7 +1786,7 @@ void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
const Immediate& raw_null =
Immediate(reinterpret_cast<intptr_t>(Object::null()));
__ pushq(raw_null); // Room for result.
__ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry);
__ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
__ popq(RAX); // Address of original.
__ popq(R10); // Restore arguments.
__ popq(RBX);
@ -1803,7 +1803,7 @@ void StubCode::GenerateBreakpointStaticStub(Assembler* assembler) {
__ EnterStubFrame();
__ pushq(RBX); // Preserve IC data for unoptimized call.
__ pushq(raw_null); // Room for result.
__ CallRuntime(kBreakpointStaticHandlerRuntimeEntry);
__ CallRuntime(kBreakpointStaticHandlerRuntimeEntry, 0);
__ popq(RAX); // Code object.
__ popq(RBX); // Restore IC data.
__ LeaveFrame();
@ -1822,7 +1822,7 @@ void StubCode::GenerateBreakpointStaticStub(Assembler* assembler) {
void StubCode::GenerateBreakpointReturnStub(Assembler* assembler) {
__ EnterStubFrame();
__ pushq(RAX);
__ CallRuntime(kBreakpointReturnHandlerRuntimeEntry);
__ CallRuntime(kBreakpointReturnHandlerRuntimeEntry, 0);
__ popq(RAX);
__ LeaveFrame();
@ -1837,7 +1837,7 @@ void StubCode::GenerateBreakpointReturnStub(Assembler* assembler) {
void StubCode::GenerateBreakpointDynamicStub(Assembler* assembler) {
__ EnterStubFrame();
__ pushq(RBX);
__ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry);
__ CallRuntime(kBreakpointDynamicHandlerRuntimeEntry, 0);
__ popq(RBX);
__ LeaveFrame();
@ -2089,7 +2089,7 @@ void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) {
__ pushq(RAX); // arg 1
__ PushObject(Symbols::EqualOperator()); // Target's name.
__ pushq(RBX); // ICData
__ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry);
__ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry, 4);
__ Drop(4);
__ LeaveFrame();
@ -2106,7 +2106,7 @@ void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
__ pushq(R10);
__ pushq(raw_null); // Setup space on stack for return value.
__ pushq(RDI);
__ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry);
__ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry, 1);
__ popq(RAX); // Disard argument.
__ popq(RAX); // Get Code object.
__ popq(R10); // Restore argument descriptor.
@ -2171,7 +2171,7 @@ void StubCode::GenerateIdenticalWithNumberCheckStub(Assembler* assembler,
__ ReserveAlignedFrameSpace(0);
__ movq(RDI, left);
__ movq(RSI, right);
__ CallRuntime(kBigintCompareRuntimeEntry);
__ CallRuntime(kBigintCompareRuntimeEntry, 2);
// Result in RAX, 0 means equal.
__ LeaveFrame();
__ cmpq(RAX, Immediate(0));
@ -2197,7 +2197,7 @@ void StubCode::GenerateUnoptimizedIdenticalWithNumberCheckStub(
__ cmpq(RAX, Immediate(0));
__ j(EQUAL, &not_stepping, Assembler::kNearJump);
__ EnterStubFrame();
__ CallRuntime(kSingleStepHandlerRuntimeEntry);
__ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
__ LeaveFrame();
__ Bind(&not_stepping);

View file

@ -51,7 +51,7 @@ static void GenerateCallToCallRuntimeStub(Assembler* assembler,
__ PushObject(smi1); // Push argument 1 smi1.
__ PushObject(smi2); // Push argument 2 smi2.
ASSERT(kTestSmiSubRuntimeEntry.argument_count() == argc);
__ CallRuntime(kTestSmiSubRuntimeEntry); // Call SmiSub runtime func.
__ CallRuntime(kTestSmiSubRuntimeEntry, argc); // Call SmiSub runtime func.
__ AddImmediate(RSP, Immediate(argc * kWordSize));
__ popq(RAX); // Pop return value from return slot.
__ leave();
@ -86,7 +86,7 @@ static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler,
__ ReserveAlignedFrameSpace(0);
__ LoadObject(RDI, smi1); // Set up argument 1 smi1.
__ LoadObject(RSI, smi2); // Set up argument 2 smi2.
__ CallRuntime(kTestLeafSmiAddRuntimeEntry); // Call SmiAdd runtime func.
__ CallRuntime(kTestLeafSmiAddRuntimeEntry, 2); // Call SmiAdd runtime func.
__ leave();
__ ret(); // Return value is in RAX.
}