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

Side by Side Diff: runtime/vm/intermediate_language_ia32.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_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 4780 matching lines...) Expand 10 before | Expand all | Expand 10 after
4791 4791
4792 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4792 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4793 compiler->GenerateCallRuntime(token_pos(), 4793 compiler->GenerateCallRuntime(token_pos(),
4794 deopt_id(), 4794 deopt_id(),
4795 kReThrowRuntimeEntry, 4795 kReThrowRuntimeEntry,
4796 locs()); 4796 locs());
4797 __ int3(); 4797 __ int3();
4798 } 4798 }
4799 4799
4800 4800
4801 void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4802 __ Bind(compiler->GetJumpLabel(this));
4803 if (!compiler->is_optimizing()) {
4804 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
4805 deopt_id_,
4806 Scanner::kDummyTokenIndex);
4807 // Add an edge counter.
4808 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld));
4809 counter.SetAt(0, Smi::Handle(Smi::New(0)));
4810 Label done;
4811 __ Comment("Edge counter");
4812 __ LoadObject(EAX, counter);
4813 __ addl(FieldAddress(EAX, Array::element_offset(0)),
4814 Immediate(Smi::RawValue(1)));
4815 __ j(NO_OVERFLOW, &done);
4816 __ movl(FieldAddress(EAX, Array::element_offset(0)),
4817 Immediate(Smi::RawValue(Smi::kMaxValue)));
4818 __ Bind(&done);
4819 }
4820 if (HasParallelMove()) {
4821 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
4822 }
4823 }
4824
4825
4801 LocationSummary* GotoInstr::MakeLocationSummary() const { 4826 LocationSummary* GotoInstr::MakeLocationSummary() const {
4802 return new LocationSummary(0, 0, LocationSummary::kNoCall); 4827 return new LocationSummary(0, 0, LocationSummary::kNoCall);
4803 } 4828 }
4804 4829
4805 4830
4806 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4831 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4832 if (!compiler->is_optimizing()) {
4833 // Add deoptimization descriptor for deoptimizing instructions that may
4834 // be inserted before this instruction.
4835 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
4836 GetDeoptId(),
4837 0); // No token position.
4838 // Add an edge counter.
4839 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld));
4840 counter.SetAt(0, Smi::Handle(Smi::New(0)));
4841 Label done;
4842 __ Comment("Edge counter");
4843 __ LoadObject(EAX, counter);
4844 __ addl(FieldAddress(EAX, Array::element_offset(0)),
4845 Immediate(Smi::RawValue(1)));
4846 __ j(NO_OVERFLOW, &done);
4847 __ movl(FieldAddress(EAX, Array::element_offset(0)),
4848 Immediate(Smi::RawValue(Smi::kMaxValue)));
4849 __ Bind(&done);
4850 }
4807 if (HasParallelMove()) { 4851 if (HasParallelMove()) {
4808 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); 4852 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
4809 } 4853 }
4810 4854
4811 // We can fall through if the successor is the next block in the list. 4855 // We can fall through if the successor is the next block in the list.
4812 // Otherwise, we need a jump. 4856 // Otherwise, we need a jump.
4813 if (!compiler->CanFallThroughTo(successor())) { 4857 if (!compiler->CanFallThroughTo(successor())) {
4814 __ jmp(compiler->GetJumpLabel(successor())); 4858 __ jmp(compiler->GetJumpLabel(successor()));
4815 } 4859 }
4816 } 4860 }
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
5211 PcDescriptors::kOther, 5255 PcDescriptors::kOther,
5212 locs()); 5256 locs());
5213 __ Drop(2); // Discard type arguments and receiver. 5257 __ Drop(2); // Discard type arguments and receiver.
5214 } 5258 }
5215 5259
5216 } // namespace dart 5260 } // namespace dart
5217 5261
5218 #undef __ 5262 #undef __
5219 5263
5220 #endif // defined TARGET_ARCH_IA32 5264 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698