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 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2849 Register result = locs->out(0).reg(); | 2849 Register result = locs->out(0).reg(); |
2850 locs->live_registers()->Remove(Location::RegisterLocation(result)); | 2850 locs->live_registers()->Remove(Location::RegisterLocation(result)); |
2851 | 2851 |
2852 compiler->SaveLiveRegisters(locs); | 2852 compiler->SaveLiveRegisters(locs); |
2853 if (instruction_->env() != NULL) { | 2853 if (instruction_->env() != NULL) { |
2854 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); | 2854 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); |
2855 compiler->pending_deoptimization_env_ = env; | 2855 compiler->pending_deoptimization_env_ = env; |
2856 } | 2856 } |
2857 __ pushq(locs->in(0).reg()); | 2857 __ pushq(locs->in(0).reg()); |
2858 __ pushq(locs->in(1).reg()); | 2858 __ pushq(locs->in(1).reg()); |
| 2859 const String& selector = |
| 2860 String::Handle(instruction_->call()->ic_data()->target_name()); |
| 2861 const Array& argument_names = |
| 2862 Array::Handle(instruction_->call()->ic_data()->arguments_descriptor()); |
2859 compiler->EmitMegamorphicInstanceCall( | 2863 compiler->EmitMegamorphicInstanceCall( |
2860 *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(), | 2864 selector, argument_names, instruction_->call()->ArgumentCount(), |
2861 instruction_->call()->deopt_id(), instruction_->call()->token_pos(), | 2865 instruction_->call()->deopt_id(), instruction_->call()->token_pos(), |
2862 locs, try_index_, | 2866 locs, try_index_, |
2863 /* slow_path_argument_count = */ 2); | 2867 /* slow_path_argument_count = */ 2); |
2864 __ MoveRegister(result, RAX); | 2868 __ MoveRegister(result, RAX); |
2865 compiler->RestoreLiveRegisters(locs); | 2869 compiler->RestoreLiveRegisters(locs); |
2866 __ jmp(exit_label()); | 2870 __ jmp(exit_label()); |
2867 compiler->pending_deoptimization_env_ = NULL; | 2871 compiler->pending_deoptimization_env_ = NULL; |
2868 } | 2872 } |
2869 | 2873 |
2870 private: | 2874 private: |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3014 Register result = merged_ ? locs->temp(0).reg() : locs->out(0).reg(); | 3018 Register result = merged_ ? locs->temp(0).reg() : locs->out(0).reg(); |
3015 locs->live_registers()->Remove(Location::RegisterLocation(result)); | 3019 locs->live_registers()->Remove(Location::RegisterLocation(result)); |
3016 | 3020 |
3017 compiler->SaveLiveRegisters(locs); | 3021 compiler->SaveLiveRegisters(locs); |
3018 if (instruction_->env() != NULL) { | 3022 if (instruction_->env() != NULL) { |
3019 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); | 3023 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); |
3020 compiler->pending_deoptimization_env_ = env; | 3024 compiler->pending_deoptimization_env_ = env; |
3021 } | 3025 } |
3022 __ pushq(locs->in(0).reg()); | 3026 __ pushq(locs->in(0).reg()); |
3023 __ pushq(locs->in(1).reg()); | 3027 __ pushq(locs->in(1).reg()); |
| 3028 String& selector = |
| 3029 String::Handle(instruction_->call()->ic_data()->target_name()); |
| 3030 Array& argument_names = |
| 3031 Array::Handle(instruction_->call()->ic_data()->arguments_descriptor()); |
3024 compiler->EmitMegamorphicInstanceCall( | 3032 compiler->EmitMegamorphicInstanceCall( |
3025 *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(), | 3033 selector, argument_names, instruction_->call()->ArgumentCount(), |
3026 instruction_->call()->deopt_id(), instruction_->call()->token_pos(), | 3034 instruction_->call()->deopt_id(), instruction_->call()->token_pos(), |
3027 locs, try_index_, | 3035 locs, try_index_, |
3028 /* slow_path_argument_count = */ 2); | 3036 /* slow_path_argument_count = */ 2); |
3029 __ MoveRegister(result, RAX); | 3037 __ MoveRegister(result, RAX); |
3030 compiler->RestoreLiveRegisters(locs); | 3038 compiler->RestoreLiveRegisters(locs); |
3031 compiler->pending_deoptimization_env_ = NULL; | 3039 compiler->pending_deoptimization_env_ = NULL; |
3032 if (merged_) { | 3040 if (merged_) { |
3033 __ CompareObject(result, Bool::True()); | 3041 __ CompareObject(result, Bool::True()); |
3034 __ j(EQUAL, instruction_->is_negated() ? labels_.false_label | 3042 __ j(EQUAL, instruction_->is_negated() ? labels_.false_label |
3035 : labels_.true_label); | 3043 : labels_.true_label); |
(...skipping 3766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6802 __ Drop(1); | 6810 __ Drop(1); |
6803 __ popq(result); | 6811 __ popq(result); |
6804 } | 6812 } |
6805 | 6813 |
6806 | 6814 |
6807 } // namespace dart | 6815 } // namespace dart |
6808 | 6816 |
6809 #undef __ | 6817 #undef __ |
6810 | 6818 |
6811 #endif // defined TARGET_ARCH_X64 | 6819 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |