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

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

Issue 15741002: Use a uniform way to emit code for all instructions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 2387 matching lines...) Expand 10 before | Expand all | Expand 10 after
2398 instance_call()->ArgumentCount(), 2398 instance_call()->ArgumentCount(),
2399 instance_call()->argument_names(), 2399 instance_call()->argument_names(),
2400 deopt, 2400 deopt,
2401 deopt_id(), 2401 deopt_id(),
2402 instance_call()->token_pos(), 2402 instance_call()->token_pos(),
2403 locs()); 2403 locs());
2404 } 2404 }
2405 2405
2406 2406
2407 LocationSummary* BranchInstr::MakeLocationSummary() const { 2407 LocationSummary* BranchInstr::MakeLocationSummary() const {
2408 UNREACHABLE(); 2408 LocationSummary* summary = comparison()->locs();
2409 return NULL; 2409 // Share the location summary with the comparison. Branches don't produce
2410 // a result.
2411 summary->set_out(Location::NoLocation());
2412 return summary;
2410 } 2413 }
2411 2414
2412 2415
2413 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2416 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2414 comparison()->EmitBranchCode(compiler, this); 2417 comparison()->EmitBranchCode(compiler, this);
2415 } 2418 }
2416 2419
2417 2420
2418 LocationSummary* CheckClassInstr::MakeLocationSummary() const { 2421 LocationSummary* CheckClassInstr::MakeLocationSummary() const {
2419 const intptr_t kNumInputs = 1; 2422 const intptr_t kNumInputs = 1;
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
2623 __ bkpt(0); 2626 __ bkpt(0);
2624 } 2627 }
2625 2628
2626 2629
2627 LocationSummary* GotoInstr::MakeLocationSummary() const { 2630 LocationSummary* GotoInstr::MakeLocationSummary() const {
2628 return new LocationSummary(0, 0, LocationSummary::kNoCall); 2631 return new LocationSummary(0, 0, LocationSummary::kNoCall);
2629 } 2632 }
2630 2633
2631 2634
2632 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2635 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2633 if (!compiler->is_optimizing()) {
2634 // Add deoptimization descriptor for deoptimizing instructions that may
2635 // be inserted before this instruction.
2636 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
2637 GetDeoptId(),
2638 0); // No token position.
2639 }
2640
2641 if (HasParallelMove()) { 2636 if (HasParallelMove()) {
2642 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); 2637 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
2643 } 2638 }
2644 2639
2645 // We can fall through if the successor is the next block in the list. 2640 // We can fall through if the successor is the next block in the list.
2646 // Otherwise, we need a jump. 2641 // Otherwise, we need a jump.
2647 if (!compiler->CanFallThroughTo(successor())) { 2642 if (!compiler->CanFallThroughTo(successor())) {
2648 __ b(compiler->GetJumpLabel(successor())); 2643 __ b(compiler->GetJumpLabel(successor()));
2649 } 2644 }
2650 } 2645 }
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2862 compiler->GenerateCall(token_pos(), 2857 compiler->GenerateCall(token_pos(),
2863 &label, 2858 &label,
2864 PcDescriptors::kOther, 2859 PcDescriptors::kOther,
2865 locs()); 2860 locs());
2866 __ Drop(2); // Discard type arguments and receiver. 2861 __ Drop(2); // Discard type arguments and receiver.
2867 } 2862 }
2868 2863
2869 } // namespace dart 2864 } // namespace dart
2870 2865
2871 #endif // defined TARGET_ARCH_ARM 2866 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698