| OLD | NEW |
| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cpu.h" | 8 #include "vm/cpu.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flow_graph_allocator.h" | 10 #include "vm/flow_graph_allocator.h" |
| (...skipping 2604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2615 UNREACHABLE(); | 2615 UNREACHABLE(); |
| 2616 } else if (loc.IsInvalid() && | 2616 } else if (loc.IsInvalid() && |
| 2617 InputAt(i)->definition()->IsMaterializeObject()) { | 2617 InputAt(i)->definition()->IsMaterializeObject()) { |
| 2618 InputAt(i)->definition()->AsMaterializeObject()->RemapRegisters( | 2618 InputAt(i)->definition()->AsMaterializeObject()->RemapRegisters( |
| 2619 fpu_reg_slots, cpu_reg_slots); | 2619 fpu_reg_slots, cpu_reg_slots); |
| 2620 } | 2620 } |
| 2621 } | 2621 } |
| 2622 } | 2622 } |
| 2623 | 2623 |
| 2624 | 2624 |
| 2625 LocationSummary* CurrentContextInstr::MakeLocationSummary(Isolate* isolate, |
| 2626 bool opt) const { |
| 2627 return LocationSummary::Make(isolate, |
| 2628 0, |
| 2629 Location::RegisterLocation(CTX), |
| 2630 LocationSummary::kNoCall); |
| 2631 } |
| 2632 |
| 2633 |
| 2634 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2635 // No code to emit. Just assert the correct result register. |
| 2636 ASSERT(locs()->out(0).reg() == CTX); |
| 2637 } |
| 2638 |
| 2639 |
| 2625 LocationSummary* StoreContextInstr::MakeLocationSummary(Isolate* isolate, | 2640 LocationSummary* StoreContextInstr::MakeLocationSummary(Isolate* isolate, |
| 2626 bool optimizing) const { | 2641 bool optimizing) const { |
| 2627 const intptr_t kNumInputs = 1; | 2642 const intptr_t kNumInputs = 1; |
| 2628 const intptr_t kNumTemps = 0; | 2643 const intptr_t kNumTemps = 0; |
| 2629 LocationSummary* summary = new(isolate) LocationSummary( | 2644 LocationSummary* summary = new(isolate) LocationSummary( |
| 2630 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 2645 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 2631 summary->set_in(0, Location::RegisterLocation(CTX)); | 2646 summary->set_in(0, Location::RegisterLocation(CTX)); |
| 2632 return summary; | 2647 return summary; |
| 2633 } | 2648 } |
| 2634 | 2649 |
| 2635 | 2650 |
| 2651 void StoreContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2652 // Nothing to do. Context register was loaded by the register allocator. |
| 2653 ASSERT(locs()->in(0).reg() == CTX); |
| 2654 } |
| 2655 |
| 2656 |
| 2636 LocationSummary* PushTempInstr::MakeLocationSummary(Isolate* isolate, | 2657 LocationSummary* PushTempInstr::MakeLocationSummary(Isolate* isolate, |
| 2637 bool optimizing) const { | 2658 bool optimizing) const { |
| 2638 return LocationSummary::Make(isolate, | 2659 return LocationSummary::Make(isolate, |
| 2639 1, | 2660 1, |
| 2640 Location::NoLocation(), | 2661 Location::NoLocation(), |
| 2641 LocationSummary::kNoCall); | 2662 LocationSummary::kNoCall); |
| 2642 } | 2663 } |
| 2643 | 2664 |
| 2644 | 2665 |
| 2645 void PushTempInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2666 void PushTempInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2663 | 2684 |
| 2664 | 2685 |
| 2665 void DropTempsInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2686 void DropTempsInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2666 ASSERT(!compiler->is_optimizing()); | 2687 ASSERT(!compiler->is_optimizing()); |
| 2667 // Assert that register assignment is correct. | 2688 // Assert that register assignment is correct. |
| 2668 ASSERT((InputCount() == 0) || (locs()->out(0).reg() == locs()->in(0).reg())); | 2689 ASSERT((InputCount() == 0) || (locs()->out(0).reg() == locs()->in(0).reg())); |
| 2669 __ Drop(num_temps()); | 2690 __ Drop(num_temps()); |
| 2670 } | 2691 } |
| 2671 | 2692 |
| 2672 | 2693 |
| 2673 void StoreContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 2674 // Nothing to do. Context register was loaded by the register allocator. | |
| 2675 ASSERT(locs()->in(0).reg() == CTX); | |
| 2676 } | |
| 2677 | |
| 2678 | |
| 2679 StrictCompareInstr::StrictCompareInstr(intptr_t token_pos, | 2694 StrictCompareInstr::StrictCompareInstr(intptr_t token_pos, |
| 2680 Token::Kind kind, | 2695 Token::Kind kind, |
| 2681 Value* left, | 2696 Value* left, |
| 2682 Value* right, | 2697 Value* right, |
| 2683 bool needs_number_check) | 2698 bool needs_number_check) |
| 2684 : ComparisonInstr(token_pos, kind, left, right), | 2699 : ComparisonInstr(token_pos, kind, left, right), |
| 2685 needs_number_check_(needs_number_check) { | 2700 needs_number_check_(needs_number_check) { |
| 2686 deopt_id_ = Isolate::Current()->GetNextDeoptId(); | 2701 deopt_id_ = Isolate::Current()->GetNextDeoptId(); |
| 2687 ASSERT((kind == Token::kEQ_STRICT) || (kind == Token::kNE_STRICT)); | 2702 ASSERT((kind == Token::kEQ_STRICT) || (kind == Token::kNE_STRICT)); |
| 2688 } | 2703 } |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3320 case Token::kTRUNCDIV: return 0; | 3335 case Token::kTRUNCDIV: return 0; |
| 3321 case Token::kMOD: return 1; | 3336 case Token::kMOD: return 1; |
| 3322 default: UNIMPLEMENTED(); return -1; | 3337 default: UNIMPLEMENTED(); return -1; |
| 3323 } | 3338 } |
| 3324 } | 3339 } |
| 3325 | 3340 |
| 3326 | 3341 |
| 3327 #undef __ | 3342 #undef __ |
| 3328 | 3343 |
| 3329 } // namespace dart | 3344 } // namespace dart |
| OLD | NEW |