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/bootstrap.h" | 8 #include "vm/bootstrap.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/constant_propagator.h" | 10 #include "vm/constant_propagator.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 DEFINE_FLAG(bool, propagate_ic_data, true, | 36 DEFINE_FLAG(bool, propagate_ic_data, true, |
37 "Propagate IC data from unoptimized to optimized IC calls."); | 37 "Propagate IC data from unoptimized to optimized IC calls."); |
38 DEFINE_FLAG(bool, two_args_smi_icd, true, | 38 DEFINE_FLAG(bool, two_args_smi_icd, true, |
39 "Generate special IC stubs for two args Smi operations"); | 39 "Generate special IC stubs for two args Smi operations"); |
40 DEFINE_FLAG(bool, unbox_numeric_fields, true, | 40 DEFINE_FLAG(bool, unbox_numeric_fields, true, |
41 "Support unboxed double and float32x4 fields."); | 41 "Support unboxed double and float32x4 fields."); |
42 DEFINE_FLAG(bool, fields_may_be_reset, false, | 42 DEFINE_FLAG(bool, fields_may_be_reset, false, |
43 "Don't optimize away static field initialization"); | 43 "Don't optimize away static field initialization"); |
44 DECLARE_FLAG(bool, eliminate_type_checks); | 44 DECLARE_FLAG(bool, eliminate_type_checks); |
45 DECLARE_FLAG(bool, trace_optimization); | 45 DECLARE_FLAG(bool, trace_optimization); |
46 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); | |
47 | 46 |
48 Definition::Definition(intptr_t deopt_id) | 47 Definition::Definition(intptr_t deopt_id) |
49 : Instruction(deopt_id), | 48 : Instruction(deopt_id), |
50 range_(NULL), | 49 range_(NULL), |
51 type_(NULL), | 50 type_(NULL), |
52 temp_index_(-1), | 51 temp_index_(-1), |
53 ssa_temp_index_(-1), | 52 ssa_temp_index_(-1), |
54 input_use_list_(NULL), | 53 input_use_list_(NULL), |
55 env_use_list_(NULL), | 54 env_use_list_(NULL), |
56 constant_value_(NULL) { | 55 constant_value_(NULL) { |
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 UNREACHABLE(); | 1315 UNREACHABLE(); |
1317 } | 1316 } |
1318 | 1317 |
1319 default: | 1318 default: |
1320 return can_overflow(); | 1319 return can_overflow(); |
1321 } | 1320 } |
1322 } | 1321 } |
1323 | 1322 |
1324 | 1323 |
1325 bool BinarySmiOpInstr::CanDeoptimize() const { | 1324 bool BinarySmiOpInstr::CanDeoptimize() const { |
1326 if (FLAG_throw_on_javascript_int_overflow && (Smi::kBits > 32)) { | |
1327 // If Smi's are bigger than 32-bits, then the instruction could deoptimize | |
1328 // if the result is too big. | |
1329 return true; | |
1330 } | |
1331 switch (op_kind()) { | 1325 switch (op_kind()) { |
1332 case Token::kBIT_AND: | 1326 case Token::kBIT_AND: |
1333 case Token::kBIT_OR: | 1327 case Token::kBIT_OR: |
1334 case Token::kBIT_XOR: | 1328 case Token::kBIT_XOR: |
1335 return false; | 1329 return false; |
1336 | 1330 |
1337 case Token::kSHR: | 1331 case Token::kSHR: |
1338 return !RangeUtils::IsPositive(right()->definition()->range()); | 1332 return !RangeUtils::IsPositive(right()->definition()->range()); |
1339 | 1333 |
1340 case Token::kSHL: | 1334 case Token::kSHL: |
(...skipping 2390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3731 set_native_c_function(native_function); | 3725 set_native_c_function(native_function); |
3732 function().SetIsNativeAutoSetupScope(auto_setup_scope); | 3726 function().SetIsNativeAutoSetupScope(auto_setup_scope); |
3733 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); | 3727 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); |
3734 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); | 3728 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); |
3735 set_is_bootstrap_native(is_bootstrap_native); | 3729 set_is_bootstrap_native(is_bootstrap_native); |
3736 } | 3730 } |
3737 | 3731 |
3738 #undef __ | 3732 #undef __ |
3739 | 3733 |
3740 } // namespace dart | 3734 } // namespace dart |
OLD | NEW |