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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index 77278560b8176e5da8e53d734673d2fca5361da9..b5cc607fe8590365b5e3ef634ac2ea10c9c040ce 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -4571,12 +4571,56 @@ void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
+void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ __ Bind(compiler->GetJumpLabel(this));
+ if (!compiler->is_optimizing()) {
+ compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
+ deopt_id_,
+ Scanner::kDummyTokenIndex);
+ // Add an edge counter.
+ const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld));
+ counter.SetAt(0, Smi::Handle(Smi::New(0)));
+ Label done;
+ __ Comment("Edge counter");
+ __ LoadObject(RAX, counter);
+ __ addq(FieldAddress(RAX, Array::element_offset(0)),
+ Immediate(Smi::RawValue(1)));
+ __ j(NO_OVERFLOW, &done);
+ __ movq(FieldAddress(RAX, Array::element_offset(0)),
+ Immediate(Smi::RawValue(Smi::kMaxValue)));
+ __ Bind(&done);
+ }
+ if (HasParallelMove()) {
+ compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
+ }
+}
+
+
LocationSummary* GotoInstr::MakeLocationSummary() const {
return new LocationSummary(0, 0, LocationSummary::kNoCall);
}
void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ if (!compiler->is_optimizing()) {
+ // Add deoptimization descriptor for deoptimizing instructions that may
+ // be inserted before this instruction.
+ compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
+ GetDeoptId(),
+ 0); // No token position.
+ // Add an edge counter.
+ const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld));
+ counter.SetAt(0, Smi::Handle(Smi::New(0)));
+ Label done;
+ __ Comment("Edge counter");
+ __ LoadObject(RAX, counter);
+ __ addq(FieldAddress(RAX, Array::element_offset(0)),
+ Immediate(Smi::RawValue(1)));
+ __ j(NO_OVERFLOW, &done);
+ __ movq(FieldAddress(RAX, Array::element_offset(0)),
+ Immediate(Smi::RawValue(Smi::kMaxValue)));
+ __ Bind(&done);
+ }
if (HasParallelMove()) {
compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
}
« 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