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

Unified Diff: runtime/vm/flow_graph_compiler_x64.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_x64.cc
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index 3aa6f29e02cb8293ad7aff79fa7edf8458e23cf6..5e07319614db68f3be8e4b693307056d1aea244e 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -189,8 +189,7 @@ void CompilerDeoptInfoWithStub::GenerateCode(FlowGraphCompiler* compiler,
ASSERT(deopt_env() != NULL);
- StubCode* stub_code = compiler->isolate()->stub_code();
- __ Call(&stub_code->DeoptimizeLabel(), PP);
+ __ Call(&StubCode::DeoptimizeLabel(), PP);
set_pc_offset(assem->CodeSize());
__ int3();
#undef __
@@ -224,21 +223,20 @@ RawSubtypeTestCache* FlowGraphCompiler::GenerateCallSubtypeTestStub(
Label* is_not_instance_lbl) {
const SubtypeTestCache& type_test_cache =
SubtypeTestCache::ZoneHandle(SubtypeTestCache::New());
- StubCode* stub_code = isolate()->stub_code();
__ LoadUniqueObject(temp_reg, type_test_cache, PP);
__ pushq(temp_reg); // Subtype test cache.
__ pushq(instance_reg); // Instance.
if (test_kind == kTestTypeOneArg) {
ASSERT(type_arguments_reg == kNoRegister);
__ PushObject(Object::null_object(), PP);
- __ Call(&stub_code->Subtype1TestCacheLabel(), PP);
+ __ Call(&StubCode::Subtype1TestCacheLabel(), PP);
} else if (test_kind == kTestTypeTwoArgs) {
ASSERT(type_arguments_reg == kNoRegister);
__ PushObject(Object::null_object(), PP);
- __ Call(&stub_code->Subtype2TestCacheLabel(), PP);
+ __ Call(&StubCode::Subtype2TestCacheLabel(), PP);
} else if (test_kind == kTestTypeThreeArgs) {
__ pushq(type_arguments_reg);
- __ Call(&stub_code->Subtype3TestCacheLabel(), PP);
+ __ Call(&StubCode::Subtype3TestCacheLabel(), PP);
} else {
UNREACHABLE();
}
@@ -932,7 +930,7 @@ void FlowGraphCompiler::CopyParameters() {
__ Bind(&wrong_num_arguments);
if (function.IsClosureFunction()) {
__ LeaveDartFrame(); // The arguments are still on the stack.
- __ jmp(&isolate()->stub_code()->CallClosureNoSuchMethodLabel());
+ __ jmp(&StubCode::CallClosureNoSuchMethodLabel());
// The noSuchMethod call may return to the caller, but not here.
} else if (check_correct_named_args) {
__ Stop("Wrong arguments");
@@ -1033,7 +1031,7 @@ void FlowGraphCompiler::EmitFrameEntry() {
Immediate(GetOptimizationThreshold()));
ASSERT(function_reg == RDI);
__ J(GREATER_EQUAL,
- &isolate()->stub_code()->OptimizeFunctionLabel(),
+ &StubCode::OptimizeFunctionLabel(),
new_pp);
} else {
entry_patch_pc_offset_ = assembler()->CodeSize();
@@ -1057,7 +1055,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.
@@ -1086,7 +1083,7 @@ void FlowGraphCompiler::CompileGraph() {
__ Bind(&wrong_num_arguments);
if (function.IsClosureFunction()) {
__ LeaveDartFrame(); // The arguments are still on the stack.
- __ jmp(&stub_code->CallClosureNoSuchMethodLabel());
+ __ jmp(&StubCode::CallClosureNoSuchMethodLabel());
// The noSuchMethod call may return to the caller, but not here.
} else {
__ Stop("Wrong number of arguments");
@@ -1152,11 +1149,11 @@ void FlowGraphCompiler::CompileGraph() {
patch_code_pc_offset_ = assembler()->CodeSize();
// This is patched up to a point in FrameEntry where the PP for the
// current function is in R13 instead of PP.
- __ JmpPatchable(&stub_code->FixCallersTargetLabel(), R13);
+ __ JmpPatchable(&StubCode::FixCallersTargetLabel(), R13);
if (is_optimizing()) {
lazy_deopt_pc_offset_ = assembler()->CodeSize();
- __ Jmp(&stub_code->DeoptimizeLazyLabel(), PP);
+ __ Jmp(&StubCode::DeoptimizeLazyLabel(), PP);
}
}
@@ -1221,9 +1218,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(RBX, ic_data, PP);
GenerateDartCall(deopt_id,
@@ -1325,8 +1321,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall(
__ LoadObject(cacheR, cache, PP);
if (FLAG_use_megamorphic_stub) {
- StubCode* stub_code = isolate()->stub_code();
- __ call(&stub_code->MegamorphicLookupLabel());
+ __ call(&StubCode::MegamorphicLookupLabel());
} else {
StubCode::EmitMegamorphicLookup(assembler(), receiverR, cacheR, targetR);
}
@@ -1355,13 +1350,12 @@ void FlowGraphCompiler::EmitOptimizedStaticCall(
intptr_t deopt_id,
intptr_t token_pos,
LocationSummary* locs) {
- StubCode* stub_code = isolate()->stub_code();
__ LoadObject(R10, 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);
@@ -1384,13 +1378,12 @@ Condition FlowGraphCompiler::EmitEqualityRegConstCompare(
}
if (needs_number_check) {
- StubCode* stub_code = isolate()->stub_code();
__ pushq(reg);
__ PushObject(obj, PP);
if (is_optimizing()) {
- __ CallPatchable(&stub_code->OptimizedIdenticalWithNumberCheckLabel());
+ __ CallPatchable(&StubCode::OptimizedIdenticalWithNumberCheckLabel());
} else {
- __ CallPatchable(&stub_code->UnoptimizedIdenticalWithNumberCheckLabel());
+ __ CallPatchable(&StubCode::UnoptimizedIdenticalWithNumberCheckLabel());
}
if (token_pos != Scanner::kNoSourcePos) {
AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
@@ -1412,13 +1405,12 @@ Condition FlowGraphCompiler::EmitEqualityRegRegCompare(Register left,
bool needs_number_check,
intptr_t token_pos) {
if (needs_number_check) {
- StubCode* stub_code = isolate()->stub_code();
__ pushq(left);
__ pushq(right);
if (is_optimizing()) {
- __ CallPatchable(&stub_code->OptimizedIdenticalWithNumberCheckLabel());
+ __ CallPatchable(&StubCode::OptimizedIdenticalWithNumberCheckLabel());
} else {
- __ CallPatchable(&stub_code->UnoptimizedIdenticalWithNumberCheckLabel());
+ __ CallPatchable(&StubCode::UnoptimizedIdenticalWithNumberCheckLabel());
}
if (token_pos != Scanner::kNoSourcePos) {
AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
@@ -1484,7 +1476,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 RAX.
__ movq(RAX,
Address(RSP, (argument_count - 1) * kWordSize));
@@ -1508,7 +1499,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));
@@ -1549,7 +1540,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