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

Unified Diff: runtime/vm/intermediate_language_mips.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/intermediate_language_mips.cc
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index 07a8242612860fe3b0fe32b70f5cb15f36687814..34fac2812e1efccd0c656190dbbe4134883a8f25 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -993,10 +993,9 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function());
const bool is_leaf_call =
(argc_tag & NativeArguments::AutoSetupScopeMask()) == 0;
- StubCode* stub_code = compiler->isolate()->stub_code();
const ExternalLabel* stub_entry;
if (is_bootstrap_native() || is_leaf_call) {
- stub_entry = &stub_code->CallBootstrapCFunctionLabel();
+ stub_entry = &StubCode::CallBootstrapCFunctionLabel();
#if defined(USING_SIMULATOR)
entry = Simulator::RedirectExternalReference(
entry, Simulator::kBootstrapNativeCall, function().NumParameters());
@@ -1005,7 +1004,7 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// In the case of non bootstrap native methods the CallNativeCFunction
// stub generates the redirection address when running under the simulator
// and hence we do not change 'entry' here.
- stub_entry = &stub_code->CallNativeCFunctionLabel();
+ stub_entry = &StubCode::CallNativeCFunctionLabel();
#if defined(USING_SIMULATOR)
if (!function().IsNativeAutoSetupScope()) {
entry = Simulator::RedirectExternalReference(
@@ -1838,7 +1837,6 @@ class BoxAllocationSlowPath : public SlowPathCode {
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
Isolate* isolate = compiler->isolate();
- StubCode* stub_code = isolate->stub_code();
if (Assembler::EmittingComments()) {
__ Comment("%s slow path allocation of %s",
@@ -1847,7 +1845,7 @@ class BoxAllocationSlowPath : public SlowPathCode {
}
__ Bind(entry_label());
const Code& stub =
- Code::Handle(isolate, stub_code->GetAllocationStubForClass(cls_));
+ Code::Handle(isolate, StubCode::GetAllocationStubForClass(cls_));
const ExternalLabel label(stub.EntryPoint());
LocationSummary* locs = instruction_->locs();
@@ -2246,15 +2244,11 @@ void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
__ Bind(&slow_path);
- Isolate* isolate = compiler->isolate();
- const Code& stub = Code::Handle(
- isolate, isolate->stub_code()->GetAllocateArrayStub());
- const ExternalLabel label(stub.EntryPoint());
+ const ExternalLabel label(StubCode::AllocateArrayEntryPoint());
compiler->GenerateCall(token_pos(),
&label,
RawPcDescriptors::kOther,
locs());
- compiler->AddStubCallTarget(stub);
__ Bind(&done);
ASSERT(locs()->out(0).reg() == kResultReg);
}
@@ -2500,8 +2494,7 @@ class AllocateContextSlowPath : public SlowPathCode {
compiler->SaveLiveRegisters(locs);
__ LoadImmediate(T1, instruction_->num_context_variables());
- StubCode* stub_code = compiler->isolate()->stub_code();
- const ExternalLabel label(stub_code->AllocateContextEntryPoint());
+ const ExternalLabel label(StubCode::AllocateContextEntryPoint());
compiler->GenerateCall(instruction_->token_pos(),
&label,
RawPcDescriptors::kOther,
@@ -2559,8 +2552,7 @@ void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ Comment("AllocateContextInstr");
__ LoadImmediate(T1, num_context_variables());
- StubCode* stub_code = compiler->isolate()->stub_code();
- const ExternalLabel label(stub_code->AllocateContextEntryPoint());
+ const ExternalLabel label(StubCode::AllocateContextEntryPoint());
compiler->GenerateCall(token_pos(),
&label,
RawPcDescriptors::kOther,
@@ -5544,9 +5536,8 @@ LocationSummary* AllocateObjectInstr::MakeLocationSummary(Zone* zone,
void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ Comment("AllocateObjectInstr");
Isolate* isolate = compiler->isolate();
- StubCode* stub_code = isolate->stub_code();
const Code& stub = Code::Handle(isolate,
- stub_code->GetAllocationStubForClass(cls()));
+ StubCode::GetAllocationStubForClass(cls()));
const ExternalLabel label(stub.EntryPoint());
compiler->GenerateCall(token_pos(),
&label,
@@ -5559,8 +5550,7 @@ void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(!compiler->is_optimizing());
- StubCode* stub_code = compiler->isolate()->stub_code();
- const ExternalLabel label(stub_code->DebugStepCheckEntryPoint());
+ const ExternalLabel label(StubCode::DebugStepCheckEntryPoint());
compiler->GenerateCall(token_pos(), &label, stub_kind_, locs());
}

Powered by Google App Engine
This is Rietveld 408576698