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

Unified Diff: runtime/vm/flow_graph_compiler_arm64.cc

Issue 1247783002: Make array allocation stub shared between isolates. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
Index: runtime/vm/flow_graph_compiler_arm64.cc
diff --git a/runtime/vm/flow_graph_compiler_arm64.cc b/runtime/vm/flow_graph_compiler_arm64.cc
index f951807a88d3c8a0340603702d5871428833540b..9a1262533c9b32b35fc550dcabeccede739ef127 100644
--- a/runtime/vm/flow_graph_compiler_arm64.cc
+++ b/runtime/vm/flow_graph_compiler_arm64.cc
@@ -186,8 +186,7 @@ void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler,
ASSERT(deopt_env() != NULL);
- StubCode* stub_code = compiler->isolate()->stub_code();
- __ BranchLink(&stub_code->DeoptimizeLabel(), PP);
+ __ BranchLink(&StubCode::DeoptimizeLabel(), PP);
set_pc_offset(assem->CodeSize());
#undef __
}
@@ -223,19 +222,18 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateCallSubtypeTestStub(
ASSERT(temp_reg == kNoRegister); // Unused on ARM.
const SubtypeTestCache& type_test_cache =
SubtypeTestCache::ZoneHandle(SubtypeTestCache::New());
- StubCode* stub_code = isolate()->stub_code();
__ LoadUniqueObject(R2, type_test_cache, PP);
if (test_kind == kTestTypeOneArg) {
ASSERT(type_arguments_reg == kNoRegister);
__ LoadObject(R1, Object::null_object(), PP);
- __ BranchLink(&stub_code->Subtype1TestCacheLabel(), PP);
+ __ BranchLink(&StubCode::Subtype1TestCacheLabel(), PP);
} else if (test_kind == kTestTypeTwoArgs) {
ASSERT(type_arguments_reg == kNoRegister);
__ LoadObject(R1, Object::null_object(), PP);
- __ BranchLink(&stub_code->Subtype2TestCacheLabel(), PP);
+ __ BranchLink(&StubCode::Subtype2TestCacheLabel(), PP);
} else if (test_kind == kTestTypeThreeArgs) {
ASSERT(type_arguments_reg == R1);
- __ BranchLink(&stub_code->Subtype3TestCacheLabel(), PP);
+ __ BranchLink(&StubCode::Subtype3TestCacheLabel(), PP);
} else {
UNREACHABLE();
}
@@ -918,8 +916,7 @@ void FlowGraphCompiler::CopyParameters() {
__ Bind(&wrong_num_arguments);
if (function.IsClosureFunction()) {
__ LeaveDartFrame(); // The arguments are still on the stack.
- __ BranchPatchable(
- &isolate()->stub_code()->CallClosureNoSuchMethodLabel());
+ __ BranchPatchable(&StubCode::CallClosureNoSuchMethodLabel());
// The noSuchMethod call may return to the caller, but not here.
} else if (check_correct_named_args) {
__ Stop("Wrong arguments");
@@ -980,7 +977,6 @@ void FlowGraphCompiler::EmitFrameEntry() {
function.IsOptimizable() &&
(!is_optimizing() || may_reoptimize())) {
const Register function_reg = R6;
- StubCode* stub_code = isolate()->stub_code();
new_pp = R13;
// Set up pool pointer in new_pp.
@@ -1005,7 +1001,7 @@ void FlowGraphCompiler::EmitFrameEntry() {
ASSERT(function_reg == R6);
Label dont_optimize;
__ b(&dont_optimize, LT);
- __ Branch(&stub_code->OptimizeFunctionLabel(), new_pp);
+ __ Branch(&StubCode::OptimizeFunctionLabel(), new_pp);
__ Bind(&dont_optimize);
} else if (!flow_graph().IsCompiledForOsr()) {
// We have to load the PP here too because a load of an external label
@@ -1050,7 +1046,6 @@ void FlowGraphCompiler::CompileGraph() {
const int num_fixed_params = function.num_fixed_parameters();
const int num_copied_params = parsed_function().num_copied_params();
const int num_locals = parsed_function().num_stack_locals();
- StubCode* stub_code = isolate()->stub_code();
// We check the number of passed arguments when we have to copy them due to
// the presence of optional parameters.
@@ -1078,8 +1073,7 @@ void FlowGraphCompiler::CompileGraph() {
__ Bind(&wrong_num_arguments);
if (function.IsClosureFunction()) {
__ LeaveDartFrame(); // The arguments are still on the stack.
- __ BranchPatchable(
- &isolate()->stub_code()->CallClosureNoSuchMethodLabel());
+ __ BranchPatchable(&StubCode::CallClosureNoSuchMethodLabel());
// The noSuchMethod call may return to the caller, but not here.
} else {
__ Stop("Wrong number of arguments");
@@ -1135,11 +1129,11 @@ void FlowGraphCompiler::CompileGraph() {
// Emit function patching code. This will be swapped with the first 3
// instructions at entry point.
patch_code_pc_offset_ = assembler()->CodeSize();
- __ BranchPatchable(&stub_code->FixCallersTargetLabel());
+ __ BranchPatchable(&StubCode::FixCallersTargetLabel());
if (is_optimizing()) {
lazy_deopt_pc_offset_ = assembler()->CodeSize();
- __ BranchPatchable(&stub_code->DeoptimizeLazyLabel());
+ __ BranchPatchable(&StubCode::DeoptimizeLazyLabel());
}
}
@@ -1277,8 +1271,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall(
__ LoadObject(cacheR, cache, PP);
if (FLAG_use_megamorphic_stub) {
- StubCode* stub_code = isolate()->stub_code();
- __ BranchLink(&stub_code->MegamorphicLookupLabel(), PP);
+ __ BranchLink(&StubCode::MegamorphicLookupLabel(), PP);
} else {
StubCode::EmitMegamorphicLookup(assembler(), receiverR, cacheR, targetR);
}
@@ -1306,9 +1299,8 @@ void FlowGraphCompiler::EmitUnoptimizedStaticCall(
intptr_t token_pos,
LocationSummary* locs,
const ICData& ic_data) {
- StubCode* stub_code = isolate()->stub_code();
const uword label_address =
- stub_code->UnoptimizedStaticCallEntryPoint(ic_data.NumArgsTested());
+ StubCode::UnoptimizedStaticCallEntryPoint(ic_data.NumArgsTested());
ExternalLabel target_label(label_address);
__ LoadObject(R5, ic_data, PP);
GenerateDartCall(deopt_id,
@@ -1327,13 +1319,12 @@ void FlowGraphCompiler::EmitOptimizedStaticCall(
intptr_t deopt_id,
intptr_t token_pos,
LocationSummary* locs) {
- StubCode* stub_code = isolate()->stub_code();
__ LoadObject(R4, arguments_descriptor, PP);
// Do not use the code from the function, but let the code be patched so that
// we can record the outgoing edges to other code.
GenerateDartCall(deopt_id,
token_pos,
- &stub_code->CallStaticFunctionLabel(),
+ &StubCode::CallStaticFunctionLabel(),
RawPcDescriptors::kOther,
locs);
AddStaticCallTarget(function);
@@ -1347,16 +1338,15 @@ Condition FlowGraphCompiler::EmitEqualityRegConstCompare(
bool needs_number_check,
intptr_t token_pos) {
if (needs_number_check) {
- StubCode* stub_code = isolate()->stub_code();
ASSERT(!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint());
__ Push(reg);
__ PushObject(obj, PP);
if (is_optimizing()) {
__ BranchLinkPatchable(
- &stub_code->OptimizedIdenticalWithNumberCheckLabel());
+ &StubCode::OptimizedIdenticalWithNumberCheckLabel());
} else {
__ BranchLinkPatchable(
- &stub_code->UnoptimizedIdenticalWithNumberCheckLabel());
+ &StubCode::UnoptimizedIdenticalWithNumberCheckLabel());
}
if (token_pos != Scanner::kNoSourcePos) {
AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
@@ -1378,15 +1368,14 @@ Condition FlowGraphCompiler::EmitEqualityRegRegCompare(Register left,
bool needs_number_check,
intptr_t token_pos) {
if (needs_number_check) {
- StubCode* stub_code = isolate()->stub_code();
__ Push(left);
__ Push(right);
if (is_optimizing()) {
__ BranchLinkPatchable(
- &stub_code->OptimizedIdenticalWithNumberCheckLabel());
+ &StubCode::OptimizedIdenticalWithNumberCheckLabel());
} else {
__ BranchLinkPatchable(
- &stub_code->UnoptimizedIdenticalWithNumberCheckLabel());
+ &StubCode::UnoptimizedIdenticalWithNumberCheckLabel());
}
if (token_pos != Scanner::kNoSourcePos) {
AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
@@ -1489,7 +1478,6 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
const Array& arguments_descriptor =
Array::ZoneHandle(ArgumentsDescriptor::New(argument_count,
argument_names));
- StubCode* stub_code = isolate()->stub_code();
// Load receiver into R0.
__ LoadFromOffset(R0, SP, (argument_count - 1) * kWordSize, PP);
@@ -1513,7 +1501,7 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
// that we can record the outgoing edges to other code.
GenerateDartCall(deopt_id,
token_index,
- &stub_code->CallStaticFunctionLabel(),
+ &StubCode::CallStaticFunctionLabel(),
RawPcDescriptors::kOther,
locs);
const Function& function = Function::Handle(ic_data.GetTargetAt(0));
@@ -1554,7 +1542,7 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
// that we can record the outgoing edges to other code.
GenerateDartCall(deopt_id,
token_index,
- &stub_code->CallStaticFunctionLabel(),
+ &StubCode::CallStaticFunctionLabel(),
RawPcDescriptors::kOther,
locs);
const Function& function = *sorted[i].target;

Powered by Google App Engine
This is Rietveld 408576698