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/constant_propagator.h" | 8 #include "vm/constant_propagator.h" |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 2919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2930 LocationSummary* InstanceCallInstr::MakeLocationSummary(Zone* zone, | 2930 LocationSummary* InstanceCallInstr::MakeLocationSummary(Zone* zone, |
2931 bool optimizing) const { | 2931 bool optimizing) const { |
2932 return MakeCallSummary(zone); | 2932 return MakeCallSummary(zone); |
2933 } | 2933 } |
2934 | 2934 |
2935 | 2935 |
2936 static uword TwoArgsSmiOpInlineCacheEntry(Token::Kind kind) { | 2936 static uword TwoArgsSmiOpInlineCacheEntry(Token::Kind kind) { |
2937 if (!FLAG_two_args_smi_icd) { | 2937 if (!FLAG_two_args_smi_icd) { |
2938 return 0; | 2938 return 0; |
2939 } | 2939 } |
2940 StubCode* stub_code = Isolate::Current()->stub_code(); | |
2941 switch (kind) { | 2940 switch (kind) { |
2942 case Token::kADD: return stub_code->SmiAddInlineCacheEntryPoint(); | 2941 case Token::kADD: return StubCode::SmiAddInlineCacheEntryPoint(); |
2943 case Token::kSUB: return stub_code->SmiSubInlineCacheEntryPoint(); | 2942 case Token::kSUB: return StubCode::SmiSubInlineCacheEntryPoint(); |
2944 case Token::kEQ: return stub_code->SmiEqualInlineCacheEntryPoint(); | 2943 case Token::kEQ: return StubCode::SmiEqualInlineCacheEntryPoint(); |
2945 default: return 0; | 2944 default: return 0; |
2946 } | 2945 } |
2947 } | 2946 } |
2948 | 2947 |
2949 | 2948 |
2950 void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2949 void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2951 Zone* zone = compiler->zone(); | 2950 Zone* zone = compiler->zone(); |
2952 const ICData* call_ic_data = NULL; | 2951 const ICData* call_ic_data = NULL; |
2953 if (!FLAG_propagate_ic_data || !compiler->is_optimizing() || | 2952 if (!FLAG_propagate_ic_data || !compiler->is_optimizing() || |
2954 (ic_data() == NULL)) { | 2953 (ic_data() == NULL)) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3015 ExternalLabel target_label(label_address); | 3014 ExternalLabel target_label(label_address); |
3016 compiler->EmitInstanceCall(&target_label, *call_ic_data, ArgumentCount(), | 3015 compiler->EmitInstanceCall(&target_label, *call_ic_data, ArgumentCount(), |
3017 deopt_id(), token_pos(), locs()); | 3016 deopt_id(), token_pos(), locs()); |
3018 } else if (FLAG_ic_range_profiling && | 3017 } else if (FLAG_ic_range_profiling && |
3019 (Token::IsBinaryArithmeticOperator(token_kind()) || | 3018 (Token::IsBinaryArithmeticOperator(token_kind()) || |
3020 Token::IsUnaryArithmeticOperator(token_kind()))) { | 3019 Token::IsUnaryArithmeticOperator(token_kind()))) { |
3021 ASSERT(Token::IsUnaryArithmeticOperator(token_kind()) == | 3020 ASSERT(Token::IsUnaryArithmeticOperator(token_kind()) == |
3022 (ArgumentCount() == 1)); | 3021 (ArgumentCount() == 1)); |
3023 ASSERT(Token::IsBinaryArithmeticOperator(token_kind()) == | 3022 ASSERT(Token::IsBinaryArithmeticOperator(token_kind()) == |
3024 (ArgumentCount() == 2)); | 3023 (ArgumentCount() == 2)); |
3025 StubCode* stub_code = compiler->isolate()->stub_code(); | |
3026 ExternalLabel target_label((ArgumentCount() == 1) ? | 3024 ExternalLabel target_label((ArgumentCount() == 1) ? |
3027 stub_code->UnaryRangeCollectingInlineCacheEntryPoint() : | 3025 StubCode::UnaryRangeCollectingInlineCacheEntryPoint() : |
3028 stub_code->BinaryRangeCollectingInlineCacheEntryPoint()); | 3026 StubCode::BinaryRangeCollectingInlineCacheEntryPoint()); |
3029 compiler->EmitInstanceCall(&target_label, *call_ic_data, ArgumentCount(), | 3027 compiler->EmitInstanceCall(&target_label, *call_ic_data, ArgumentCount(), |
3030 deopt_id(), token_pos(), locs()); | 3028 deopt_id(), token_pos(), locs()); |
3031 } else { | 3029 } else { |
3032 compiler->GenerateInstanceCall(deopt_id(), | 3030 compiler->GenerateInstanceCall(deopt_id(), |
3033 token_pos(), | 3031 token_pos(), |
3034 ArgumentCount(), | 3032 ArgumentCount(), |
3035 locs(), | 3033 locs(), |
3036 *call_ic_data); | 3034 *call_ic_data); |
3037 } | 3035 } |
3038 } | 3036 } |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3636 case Token::kTRUNCDIV: return 0; | 3634 case Token::kTRUNCDIV: return 0; |
3637 case Token::kMOD: return 1; | 3635 case Token::kMOD: return 1; |
3638 default: UNIMPLEMENTED(); return -1; | 3636 default: UNIMPLEMENTED(); return -1; |
3639 } | 3637 } |
3640 } | 3638 } |
3641 | 3639 |
3642 | 3640 |
3643 #undef __ | 3641 #undef __ |
3644 | 3642 |
3645 } // namespace dart | 3643 } // namespace dart |
OLD | NEW |