| 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/globals.h" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2832 Register result = locs->out(0).reg(); | 2832 Register result = locs->out(0).reg(); |
| 2833 locs->live_registers()->Remove(Location::RegisterLocation(result)); | 2833 locs->live_registers()->Remove(Location::RegisterLocation(result)); |
| 2834 | 2834 |
| 2835 compiler->SaveLiveRegisters(locs); | 2835 compiler->SaveLiveRegisters(locs); |
| 2836 if (instruction_->env() != NULL) { | 2836 if (instruction_->env() != NULL) { |
| 2837 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); | 2837 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); |
| 2838 compiler->pending_deoptimization_env_ = env; | 2838 compiler->pending_deoptimization_env_ = env; |
| 2839 } | 2839 } |
| 2840 __ pushq(locs->in(0).reg()); | 2840 __ pushq(locs->in(0).reg()); |
| 2841 __ pushq(locs->in(1).reg()); | 2841 __ pushq(locs->in(1).reg()); |
| 2842 const String& selector = |
| 2843 String::Handle(instruction_->call()->ic_data()->target_name()); |
| 2844 const Array& argument_names = |
| 2845 Array::Handle(instruction_->call()->ic_data()->arguments_descriptor()); |
| 2842 compiler->EmitMegamorphicInstanceCall( | 2846 compiler->EmitMegamorphicInstanceCall( |
| 2843 *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(), | 2847 selector, argument_names, instruction_->call()->ArgumentCount(), |
| 2844 instruction_->call()->deopt_id(), instruction_->call()->token_pos(), | 2848 instruction_->call()->deopt_id(), instruction_->call()->token_pos(), |
| 2845 locs, try_index_, | 2849 locs, try_index_, |
| 2846 /* slow_path_argument_count = */ 2); | 2850 /* slow_path_argument_count = */ 2); |
| 2847 __ MoveRegister(result, RAX); | 2851 __ MoveRegister(result, RAX); |
| 2848 compiler->RestoreLiveRegisters(locs); | 2852 compiler->RestoreLiveRegisters(locs); |
| 2849 __ jmp(exit_label()); | 2853 __ jmp(exit_label()); |
| 2850 compiler->pending_deoptimization_env_ = NULL; | 2854 compiler->pending_deoptimization_env_ = NULL; |
| 2851 } | 2855 } |
| 2852 | 2856 |
| 2853 private: | 2857 private: |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2997 Register result = merged_ ? locs->temp(0).reg() : locs->out(0).reg(); | 3001 Register result = merged_ ? locs->temp(0).reg() : locs->out(0).reg(); |
| 2998 locs->live_registers()->Remove(Location::RegisterLocation(result)); | 3002 locs->live_registers()->Remove(Location::RegisterLocation(result)); |
| 2999 | 3003 |
| 3000 compiler->SaveLiveRegisters(locs); | 3004 compiler->SaveLiveRegisters(locs); |
| 3001 if (instruction_->env() != NULL) { | 3005 if (instruction_->env() != NULL) { |
| 3002 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); | 3006 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); |
| 3003 compiler->pending_deoptimization_env_ = env; | 3007 compiler->pending_deoptimization_env_ = env; |
| 3004 } | 3008 } |
| 3005 __ pushq(locs->in(0).reg()); | 3009 __ pushq(locs->in(0).reg()); |
| 3006 __ pushq(locs->in(1).reg()); | 3010 __ pushq(locs->in(1).reg()); |
| 3011 String& selector = |
| 3012 String::Handle(instruction_->call()->ic_data()->target_name()); |
| 3013 Array& argument_names = |
| 3014 Array::Handle(instruction_->call()->ic_data()->arguments_descriptor()); |
| 3007 compiler->EmitMegamorphicInstanceCall( | 3015 compiler->EmitMegamorphicInstanceCall( |
| 3008 *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(), | 3016 selector, argument_names, instruction_->call()->ArgumentCount(), |
| 3009 instruction_->call()->deopt_id(), instruction_->call()->token_pos(), | 3017 instruction_->call()->deopt_id(), instruction_->call()->token_pos(), |
| 3010 locs, try_index_, | 3018 locs, try_index_, |
| 3011 /* slow_path_argument_count = */ 2); | 3019 /* slow_path_argument_count = */ 2); |
| 3012 __ MoveRegister(result, RAX); | 3020 __ MoveRegister(result, RAX); |
| 3013 compiler->RestoreLiveRegisters(locs); | 3021 compiler->RestoreLiveRegisters(locs); |
| 3014 compiler->pending_deoptimization_env_ = NULL; | 3022 compiler->pending_deoptimization_env_ = NULL; |
| 3015 if (merged_) { | 3023 if (merged_) { |
| 3016 __ CompareObject(result, Bool::True()); | 3024 __ CompareObject(result, Bool::True()); |
| 3017 __ j(EQUAL, instruction_->is_negated() ? labels_.false_label | 3025 __ j(EQUAL, instruction_->is_negated() ? labels_.false_label |
| 3018 : labels_.true_label); | 3026 : labels_.true_label); |
| (...skipping 3766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6785 __ Drop(1); | 6793 __ Drop(1); |
| 6786 __ popq(result); | 6794 __ popq(result); |
| 6787 } | 6795 } |
| 6788 | 6796 |
| 6789 | 6797 |
| 6790 } // namespace dart | 6798 } // namespace dart |
| 6791 | 6799 |
| 6792 #undef __ | 6800 #undef __ |
| 6793 | 6801 |
| 6794 #endif // defined TARGET_ARCH_X64 | 6802 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |