Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1246)

Unified Diff: runtime/vm/flow_graph_compiler_mips.cc

Issue 1270803003: VM: More abstract interface for generating stub calls. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_mips.cc
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
index 8dd9ab1af090b2ed985f280bc1dafa4358fe84c1..a717323119304c2d4bcb728ed2d35f68a1c8958d 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -193,7 +193,7 @@ void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler,
ASSERT(deopt_env() != NULL);
- __ BranchLink(&StubCode::DeoptimizeLabel());
+ __ BranchLink(*StubCode::Deoptimize_entry());
set_pc_offset(assem->CodeSize());
#undef __
}
@@ -233,14 +233,14 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateCallSubtypeTestStub(
if (test_kind == kTestTypeOneArg) {
ASSERT(type_arguments_reg == kNoRegister);
__ LoadImmediate(A1, reinterpret_cast<int32_t>(Object::null()));
- __ BranchLink(&StubCode::Subtype1TestCacheLabel());
+ __ BranchLink(*StubCode::Subtype1TestCache_entry());
} else if (test_kind == kTestTypeTwoArgs) {
ASSERT(type_arguments_reg == kNoRegister);
__ LoadImmediate(A1, reinterpret_cast<int32_t>(Object::null()));
- __ BranchLink(&StubCode::Subtype2TestCacheLabel());
+ __ BranchLink(*StubCode::Subtype2TestCache_entry());
} else if (test_kind == kTestTypeThreeArgs) {
ASSERT(type_arguments_reg == A1);
- __ BranchLink(&StubCode::Subtype3TestCacheLabel());
+ __ BranchLink(*StubCode::Subtype3TestCache_entry());
} else {
UNREACHABLE();
}
@@ -936,7 +936,7 @@ void FlowGraphCompiler::CopyParameters() {
__ Bind(&wrong_num_arguments);
if (function.IsClosureFunction()) {
__ LeaveDartFrame(); // The arguments are still on the stack.
- __ Branch(&StubCode::CallClosureNoSuchMethodLabel());
+ __ Branch(*StubCode::CallClosureNoSuchMethod_entry());
// The noSuchMethod call may return to the caller, but not here.
} else if (check_correct_named_args) {
__ Stop("Wrong arguments");
@@ -1033,7 +1033,7 @@ void FlowGraphCompiler::EmitFrameEntry() {
T1, Immediate(GetOptimizationThreshold()), &dont_branch);
ASSERT(function_reg == T0);
- __ Branch(&StubCode::OptimizeFunctionLabel());
+ __ Branch(*StubCode::OptimizeFunction_entry());
__ Bind(&dont_branch);
@@ -1100,7 +1100,7 @@ void FlowGraphCompiler::CompileGraph() {
__ Bind(&wrong_num_arguments);
if (function.IsClosureFunction()) {
__ LeaveDartFrame(); // The arguments are still on the stack.
- __ Branch(&StubCode::CallClosureNoSuchMethodLabel());
+ __ Branch(*StubCode::CallClosureNoSuchMethod_entry());
// The noSuchMethod call may return to the caller, but not here.
} else {
__ Stop("Wrong number of arguments");
@@ -1155,20 +1155,20 @@ void FlowGraphCompiler::CompileGraph() {
// Emit function patching code. This will be swapped with the first 5 bytes
// at entry point.
patch_code_pc_offset_ = assembler()->CodeSize();
- __ BranchPatchable(&StubCode::FixCallersTargetLabel());
+ __ BranchPatchable(*StubCode::FixCallersTarget_entry());
if (is_optimizing()) {
lazy_deopt_pc_offset_ = assembler()->CodeSize();
- __ Branch(&StubCode::DeoptimizeLazyLabel());
+ __ Branch(*StubCode::DeoptimizeLazy_entry());
}
}
void FlowGraphCompiler::GenerateCall(intptr_t token_pos,
- const ExternalLabel* label,
+ const StubEntry& stub_entry,
RawPcDescriptors::Kind kind,
LocationSummary* locs) {
- __ BranchLinkPatchable(label);
+ __ BranchLinkPatchable(stub_entry);
AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos);
RecordSafepoint(locs);
}
@@ -1176,10 +1176,10 @@ void FlowGraphCompiler::GenerateCall(intptr_t token_pos,
void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id,
intptr_t token_pos,
- const ExternalLabel* label,
+ const StubEntry& stub_entry,
RawPcDescriptors::Kind kind,
LocationSummary* locs) {
- __ BranchLinkPatchable(label);
+ __ BranchLinkPatchable(stub_entry);
AddCurrentDescriptor(kind, deopt_id, token_pos);
RecordSafepoint(locs);
// Marks either the continuation point in unoptimized code or the
@@ -1239,7 +1239,7 @@ void FlowGraphCompiler::EmitEdgeCounter() {
void FlowGraphCompiler::EmitOptimizedInstanceCall(
- ExternalLabel* target_label,
+ const StubEntry& stub_entry,
const ICData& ic_data,
intptr_t argument_count,
intptr_t deopt_id,
@@ -1257,14 +1257,14 @@ void FlowGraphCompiler::EmitOptimizedInstanceCall(
__ LoadUniqueObject(S5, ic_data);
GenerateDartCall(deopt_id,
token_pos,
- target_label,
+ stub_entry,
RawPcDescriptors::kIcCall,
locs);
__ Drop(argument_count);
}
-void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label,
+void FlowGraphCompiler::EmitInstanceCall(const StubEntry& stub_entry,
const ICData& ic_data,
intptr_t argument_count,
intptr_t deopt_id,
@@ -1275,7 +1275,7 @@ void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label,
__ LoadUniqueObject(S5, ic_data);
GenerateDartCall(deopt_id,
token_pos,
- target_label,
+ stub_entry,
RawPcDescriptors::kIcCall,
locs);
__ Comment("InstanceCall return");
@@ -1304,7 +1304,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall(
__ LoadObject(cacheR, cache);
if (FLAG_use_megamorphic_stub) {
- __ BranchLink(&StubCode::MegamorphicLookupLabel());
+ __ BranchLink(*StubCode::MegamorphicLookup_entry());
} else {
StubCode::EmitMegamorphicLookup(assembler(), receiverR, cacheR, targetR);
}
@@ -1332,13 +1332,12 @@ void FlowGraphCompiler::EmitUnoptimizedStaticCall(
intptr_t token_pos,
LocationSummary* locs,
const ICData& ic_data) {
- const uword label_address =
- StubCode::UnoptimizedStaticCallEntryPoint(ic_data.NumArgsTested());
- ExternalLabel target_label(label_address);
+ const StubEntry* stub_entry =
+ StubCode::UnoptimizedStaticCallEntry(ic_data.NumArgsTested());
__ LoadObject(S5, ic_data);
GenerateDartCall(deopt_id,
token_pos,
- &target_label,
+ *stub_entry,
RawPcDescriptors::kUnoptStaticCall,
locs);
__ Drop(argument_count);
@@ -1358,7 +1357,7 @@ void FlowGraphCompiler::EmitOptimizedStaticCall(
// we can record the outgoing edges to other code.
GenerateDartCall(deopt_id,
token_pos,
- &StubCode::CallStaticFunctionLabel(),
+ *StubCode::CallStaticFunction_entry(),
RawPcDescriptors::kOther,
locs);
AddStaticCallTarget(function);
@@ -1382,10 +1381,10 @@ Condition FlowGraphCompiler::EmitEqualityRegConstCompare(
__ sw(TMP, Address(SP, 0 * kWordSize));
if (is_optimizing()) {
__ BranchLinkPatchable(
- &StubCode::OptimizedIdenticalWithNumberCheckLabel());
+ *StubCode::OptimizedIdenticalWithNumberCheck_entry());
} else {
__ BranchLinkPatchable(
- &StubCode::UnoptimizedIdenticalWithNumberCheckLabel());
+ *StubCode::UnoptimizedIdenticalWithNumberCheck_entry());
}
if (token_pos != Scanner::kNoSourcePos) {
AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
@@ -1416,10 +1415,10 @@ Condition FlowGraphCompiler::EmitEqualityRegRegCompare(Register left,
__ sw(right, Address(SP, 0 * kWordSize));
if (is_optimizing()) {
__ BranchLinkPatchable(
- &StubCode::OptimizedIdenticalWithNumberCheckLabel());
+ *StubCode::OptimizedIdenticalWithNumberCheck_entry());
} else {
__ BranchLinkPatchable(
- &StubCode::UnoptimizedIdenticalWithNumberCheckLabel());
+ *StubCode::UnoptimizedIdenticalWithNumberCheck_entry());
}
if (token_pos != Scanner::kNoSourcePos) {
AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
@@ -1574,7 +1573,7 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
// that we can record the outgoing edges to other code.
GenerateDartCall(deopt_id,
token_index,
- &StubCode::CallStaticFunctionLabel(),
+ *StubCode::CallStaticFunction_entry(),
RawPcDescriptors::kOther,
locs);
const Function& function = Function::Handle(zone(), ic_data.GetTargetAt(0));
@@ -1614,7 +1613,7 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
// that we can record the outgoing edges to other code.
GenerateDartCall(deopt_id,
token_index,
- &StubCode::CallStaticFunctionLabel(),
+ *StubCode::CallStaticFunction_entry(),
RawPcDescriptors::kOther,
locs);
const Function& function = *sorted[i].target;
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698