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

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

Issue 18111006: Collect edge count profiling data and reorder basic blocks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated review comments. Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 4553 matching lines...) Expand 10 before | Expand all | Expand 10 after
4564 4564
4565 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4565 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4566 compiler->GenerateCallRuntime(token_pos(), 4566 compiler->GenerateCallRuntime(token_pos(),
4567 deopt_id(), 4567 deopt_id(),
4568 kReThrowRuntimeEntry, 4568 kReThrowRuntimeEntry,
4569 locs()); 4569 locs());
4570 __ int3(); 4570 __ int3();
4571 } 4571 }
4572 4572
4573 4573
4574 void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4575 __ Bind(compiler->GetJumpLabel(this));
4576 if (!compiler->is_optimizing()) {
4577 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
4578 deopt_id_,
4579 Scanner::kDummyTokenIndex);
4580 // Add an edge counter.
4581 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld));
4582 counter.SetAt(0, Smi::Handle(Smi::New(0)));
4583 Label done;
4584 __ Comment("Edge counter");
4585 __ LoadObject(RAX, counter);
4586 __ addq(FieldAddress(RAX, Array::element_offset(0)),
4587 Immediate(Smi::RawValue(1)));
4588 __ j(NO_OVERFLOW, &done);
4589 __ movq(FieldAddress(RAX, Array::element_offset(0)),
4590 Immediate(Smi::RawValue(Smi::kMaxValue)));
4591 __ Bind(&done);
4592 }
4593 if (HasParallelMove()) {
4594 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
4595 }
4596 }
4597
4598
4574 LocationSummary* GotoInstr::MakeLocationSummary() const { 4599 LocationSummary* GotoInstr::MakeLocationSummary() const {
4575 return new LocationSummary(0, 0, LocationSummary::kNoCall); 4600 return new LocationSummary(0, 0, LocationSummary::kNoCall);
4576 } 4601 }
4577 4602
4578 4603
4579 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4604 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4605 if (!compiler->is_optimizing()) {
4606 // Add deoptimization descriptor for deoptimizing instructions that may
4607 // be inserted before this instruction.
4608 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
4609 GetDeoptId(),
4610 0); // No token position.
4611 // Add an edge counter.
4612 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld));
4613 counter.SetAt(0, Smi::Handle(Smi::New(0)));
4614 Label done;
4615 __ Comment("Edge counter");
4616 __ LoadObject(RAX, counter);
4617 __ addq(FieldAddress(RAX, Array::element_offset(0)),
4618 Immediate(Smi::RawValue(1)));
4619 __ j(NO_OVERFLOW, &done);
4620 __ movq(FieldAddress(RAX, Array::element_offset(0)),
4621 Immediate(Smi::RawValue(Smi::kMaxValue)));
4622 __ Bind(&done);
4623 }
4580 if (HasParallelMove()) { 4624 if (HasParallelMove()) {
4581 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); 4625 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
4582 } 4626 }
4583 4627
4584 // We can fall through if the successor is the next block in the list. 4628 // We can fall through if the successor is the next block in the list.
4585 // Otherwise, we need a jump. 4629 // Otherwise, we need a jump.
4586 if (!compiler->CanFallThroughTo(successor())) { 4630 if (!compiler->CanFallThroughTo(successor())) {
4587 __ jmp(compiler->GetJumpLabel(successor())); 4631 __ jmp(compiler->GetJumpLabel(successor()));
4588 } 4632 }
4589 } 4633 }
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
4827 PcDescriptors::kOther, 4871 PcDescriptors::kOther,
4828 locs()); 4872 locs());
4829 __ Drop(2); // Discard type arguments and receiver. 4873 __ Drop(2); // Discard type arguments and receiver.
4830 } 4874 }
4831 4875
4832 } // namespace dart 4876 } // namespace dart
4833 4877
4834 #undef __ 4878 #undef __
4835 4879
4836 #endif // defined TARGET_ARCH_X64 4880 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698