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

Side by Side Diff: runtime/vm/intermediate_language_arm64.cc

Issue 1288863006: Use zone allocated growable array to populate interim static and stub calls table, thus allocating … (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: add comment 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after
1661 class BoxAllocationSlowPath : public SlowPathCode { 1661 class BoxAllocationSlowPath : public SlowPathCode {
1662 public: 1662 public:
1663 BoxAllocationSlowPath(Instruction* instruction, 1663 BoxAllocationSlowPath(Instruction* instruction,
1664 const Class& cls, 1664 const Class& cls,
1665 Register result) 1665 Register result)
1666 : instruction_(instruction), 1666 : instruction_(instruction),
1667 cls_(cls), 1667 cls_(cls),
1668 result_(result) { } 1668 result_(result) { }
1669 1669
1670 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { 1670 virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
1671 Isolate* isolate = compiler->isolate();
1672
1673 if (Assembler::EmittingComments()) { 1671 if (Assembler::EmittingComments()) {
1674 __ Comment("%s slow path allocation of %s", 1672 __ Comment("%s slow path allocation of %s",
1675 instruction_->DebugName(), 1673 instruction_->DebugName(),
1676 String::Handle(cls_.PrettyName()).ToCString()); 1674 String::Handle(cls_.PrettyName()).ToCString());
1677 } 1675 }
1678 __ Bind(entry_label()); 1676 __ Bind(entry_label());
1679 const Code& stub = 1677 const Code& stub = Code::ZoneHandle(compiler->zone(),
1680 Code::Handle(isolate, StubCode::GetAllocationStubForClass(cls_)); 1678 StubCode::GetAllocationStubForClass(cls_));
1681 const StubEntry stub_entry(stub); 1679 const StubEntry stub_entry(stub);
1682 1680
1683 LocationSummary* locs = instruction_->locs(); 1681 LocationSummary* locs = instruction_->locs();
1684 1682
1685 locs->live_registers()->Remove(Location::RegisterLocation(result_)); 1683 locs->live_registers()->Remove(Location::RegisterLocation(result_));
1686 1684
1687 compiler->SaveLiveRegisters(locs); 1685 compiler->SaveLiveRegisters(locs);
1688 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. 1686 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position.
1689 stub_entry, 1687 stub_entry,
1690 RawPcDescriptors::kOther, 1688 RawPcDescriptors::kOther,
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
2113 deopt_id(), 2111 deopt_id(),
2114 kAllocateArrayRuntimeEntry, 2112 kAllocateArrayRuntimeEntry,
2115 2, 2113 2,
2116 locs()); 2114 locs());
2117 __ Drop(2); 2115 __ Drop(2);
2118 __ Pop(kResultReg); 2116 __ Pop(kResultReg);
2119 __ Bind(&done); 2117 __ Bind(&done);
2120 return; 2118 return;
2121 } 2119 }
2122 } 2120 }
2123 const Code& stub = Code::Handle(compiler->isolate(), 2121 const Code& stub = Code::ZoneHandle(compiler->zone(),
2124 StubCode::AllocateArray_entry()->code()); 2122 StubCode::AllocateArray_entry()->code());
2125 compiler->AddStubCallTarget(stub); 2123 compiler->AddStubCallTarget(stub);
2126 compiler->GenerateCall(token_pos(), 2124 compiler->GenerateCall(token_pos(),
2127 *StubCode::AllocateArray_entry(), 2125 *StubCode::AllocateArray_entry(),
2128 RawPcDescriptors::kOther, 2126 RawPcDescriptors::kOther,
2129 locs()); 2127 locs());
2130 ASSERT(locs()->out(0).reg() == kResultReg); 2128 ASSERT(locs()->out(0).reg() == kResultReg);
2131 } 2129 }
2132 2130
2133 2131
2134 LocationSummary* LoadFieldInstr::MakeLocationSummary(Zone* zone, 2132 LocationSummary* LoadFieldInstr::MakeLocationSummary(Zone* zone,
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
2391 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { 2389 virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
2392 __ Comment("AllocateContextSlowPath"); 2390 __ Comment("AllocateContextSlowPath");
2393 __ Bind(entry_label()); 2391 __ Bind(entry_label());
2394 2392
2395 LocationSummary* locs = instruction_->locs(); 2393 LocationSummary* locs = instruction_->locs();
2396 locs->live_registers()->Remove(locs->out(0)); 2394 locs->live_registers()->Remove(locs->out(0));
2397 2395
2398 compiler->SaveLiveRegisters(locs); 2396 compiler->SaveLiveRegisters(locs);
2399 2397
2400 __ LoadImmediate(R1, instruction_->num_context_variables()); 2398 __ LoadImmediate(R1, instruction_->num_context_variables());
2401 const Code& stub = Code::Handle(compiler->isolate(), 2399 const Code& stub = Code::ZoneHandle(
2402 StubCode::AllocateContext_entry()->code()); 2400 compiler->zone(), StubCode::AllocateContext_entry()->code());
2403 compiler->AddStubCallTarget(stub); 2401 compiler->AddStubCallTarget(stub);
2404 compiler->GenerateCall(instruction_->token_pos(), 2402 compiler->GenerateCall(instruction_->token_pos(),
2405 *StubCode::AllocateContext_entry(), 2403 *StubCode::AllocateContext_entry(),
2406 RawPcDescriptors::kOther, 2404 RawPcDescriptors::kOther,
2407 locs); 2405 locs);
2408 ASSERT(instruction_->locs()->out(0).reg() == R0); 2406 ASSERT(instruction_->locs()->out(0).reg() == R0);
2409 compiler->RestoreLiveRegisters(instruction_->locs()); 2407 compiler->RestoreLiveRegisters(instruction_->locs());
2410 __ b(exit_label()); 2408 __ b(exit_label());
2411 } 2409 }
2412 2410
(...skipping 3153 matching lines...) Expand 10 before | Expand all | Expand 10 after
5566 } 5564 }
5567 5565
5568 5566
5569 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Zone* zone, 5567 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Zone* zone,
5570 bool opt) const { 5568 bool opt) const {
5571 return MakeCallSummary(zone); 5569 return MakeCallSummary(zone);
5572 } 5570 }
5573 5571
5574 5572
5575 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5573 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5576 Isolate* isolate = compiler->isolate(); 5574 const Code& stub = Code::ZoneHandle(
5577 const Code& stub = Code::Handle(isolate, 5575 compiler->zone(), StubCode::GetAllocationStubForClass(cls()));
5578 StubCode::GetAllocationStubForClass(cls()));
5579 const StubEntry stub_entry(stub); 5576 const StubEntry stub_entry(stub);
5580 compiler->GenerateCall(token_pos(), 5577 compiler->GenerateCall(token_pos(),
5581 stub_entry, 5578 stub_entry,
5582 RawPcDescriptors::kOther, 5579 RawPcDescriptors::kOther,
5583 locs()); 5580 locs());
5584 compiler->AddStubCallTarget(stub); 5581 compiler->AddStubCallTarget(stub);
5585 __ Drop(ArgumentCount()); // Discard arguments. 5582 __ Drop(ArgumentCount()); // Discard arguments.
5586 } 5583 }
5587 5584
5588 5585
(...skipping 27 matching lines...) Expand all
5616 1, 5613 1,
5617 locs()); 5614 locs());
5618 __ Drop(1); 5615 __ Drop(1);
5619 __ Pop(result); 5616 __ Pop(result);
5620 } 5617 }
5621 5618
5622 5619
5623 } // namespace dart 5620 } // namespace dart
5624 5621
5625 #endif // defined TARGET_ARCH_ARM64 5622 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698