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

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

Issue 24744002: Pattern match on generated code to find edge counters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 3850 matching lines...) Expand 10 before | Expand all | Expand 10 after
3861 } 3861 }
3862 3862
3863 3863
3864 LocationSummary* GotoInstr::MakeLocationSummary() const { 3864 LocationSummary* GotoInstr::MakeLocationSummary() const {
3865 return new LocationSummary(0, 0, LocationSummary::kNoCall); 3865 return new LocationSummary(0, 0, LocationSummary::kNoCall);
3866 } 3866 }
3867 3867
3868 3868
3869 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3869 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3870 __ TraceSimMsg("GotoInstr"); 3870 __ TraceSimMsg("GotoInstr");
3871 if (!compiler->is_optimizing()) {
3872 // Add deoptimization descriptor for deoptimizing instructions that may
3873 // be inserted before this instruction.
3874 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
3875 GetDeoptId(),
3876 0); // No token position.
3877 // Add an edge counter.
3878 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld));
3879 counter.SetAt(0, Smi::Handle(Smi::New(0)));
3880 Label done;
3881 __ Comment("Edge counter");
3882 __ LoadObject(T0, counter);
3883 __ lw(T1, FieldAddress(T0, Array::element_offset(0)));
3884 __ AddImmediateDetectOverflow(T1, T1, Smi::RawValue(1), CMPRES, T2);
3885 __ bgez(CMPRES, &done);
3886 __ delay_slot()->sw(T1, FieldAddress(T0, Array::element_offset(0)));
3887 __ LoadImmediate(TMP1, Smi::RawValue(Smi::kMaxValue));
3888 __ sw(TMP1, FieldAddress(T0, Array::element_offset(0))); // If overflow.
3889 __ Bind(&done);
3890 }
3871 if (HasParallelMove()) { 3891 if (HasParallelMove()) {
3872 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); 3892 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
3873 } 3893 }
3874 3894
3875 // We can fall through if the successor is the next block in the list. 3895 // We can fall through if the successor is the next block in the list.
3876 // Otherwise, we need a jump. 3896 // Otherwise, we need a jump.
3877 if (!compiler->CanFallThroughTo(successor())) { 3897 if (!compiler->CanFallThroughTo(successor())) {
3878 __ b(compiler->GetJumpLabel(successor())); 3898 __ b(compiler->GetJumpLabel(successor()));
3879 } 3899 }
3880 } 3900 }
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
4113 compiler->GenerateCall(token_pos(), 4133 compiler->GenerateCall(token_pos(),
4114 &label, 4134 &label,
4115 PcDescriptors::kOther, 4135 PcDescriptors::kOther,
4116 locs()); 4136 locs());
4117 __ Drop(2); // Discard type arguments and receiver. 4137 __ Drop(2); // Discard type arguments and receiver.
4118 } 4138 }
4119 4139
4120 } // namespace dart 4140 } // namespace dart
4121 4141
4122 #endif // defined TARGET_ARCH_MIPS 4142 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« runtime/vm/code_patcher_mips.cc ('K') | « runtime/vm/intermediate_language_arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698