Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: runtime/vm/intermediate_language.cc

Issue 16398008: Implements checks for 53-bit overflow for x64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.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 12 matching lines...) Expand all
23 23
24 DEFINE_FLAG(bool, new_identity_spec, true, 24 DEFINE_FLAG(bool, new_identity_spec, true,
25 "Use new identity check rules for numbers."); 25 "Use new identity check rules for numbers.");
26 DEFINE_FLAG(bool, propagate_ic_data, true, 26 DEFINE_FLAG(bool, propagate_ic_data, true,
27 "Propagate IC data from unoptimized to optimized IC calls."); 27 "Propagate IC data from unoptimized to optimized IC calls.");
28 DECLARE_FLAG(bool, enable_type_checks); 28 DECLARE_FLAG(bool, enable_type_checks);
29 DECLARE_FLAG(bool, eliminate_type_checks); 29 DECLARE_FLAG(bool, eliminate_type_checks);
30 DECLARE_FLAG(int, max_polymorphic_checks); 30 DECLARE_FLAG(int, max_polymorphic_checks);
31 DECLARE_FLAG(bool, trace_optimization); 31 DECLARE_FLAG(bool, trace_optimization);
32 DECLARE_FLAG(bool, trace_constant_propagation); 32 DECLARE_FLAG(bool, trace_constant_propagation);
33 DECLARE_FLAG(bool, throw_on_javascript_int_overflow);
33 34
34 Definition::Definition() 35 Definition::Definition()
35 : range_(NULL), 36 : range_(NULL),
36 type_(NULL), 37 type_(NULL),
37 temp_index_(-1), 38 temp_index_(-1),
38 ssa_temp_index_(-1), 39 ssa_temp_index_(-1),
39 input_use_list_(NULL), 40 input_use_list_(NULL),
40 env_use_list_(NULL), 41 env_use_list_(NULL),
41 use_kind_(kValue), // Phis and parameters rely on this default. 42 use_kind_(kValue), // Phis and parameters rely on this default.
42 constant_value_(Object::ZoneHandle(ConstantPropagator::Unknown())) { 43 constant_value_(Object::ZoneHandle(ConstantPropagator::Unknown())) {
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 962
962 963
963 bool EqualityCompareInstr::IsPolymorphic() const { 964 bool EqualityCompareInstr::IsPolymorphic() const {
964 return HasICData() && 965 return HasICData() &&
965 (ic_data()->NumberOfChecks() > 0) && 966 (ic_data()->NumberOfChecks() > 0) &&
966 (ic_data()->NumberOfChecks() <= FLAG_max_polymorphic_checks); 967 (ic_data()->NumberOfChecks() <= FLAG_max_polymorphic_checks);
967 } 968 }
968 969
969 970
970 bool BinarySmiOpInstr::CanDeoptimize() const { 971 bool BinarySmiOpInstr::CanDeoptimize() const {
972 if (FLAG_throw_on_javascript_int_overflow) return true;
971 switch (op_kind()) { 973 switch (op_kind()) {
972 case Token::kBIT_AND: 974 case Token::kBIT_AND:
973 case Token::kBIT_OR: 975 case Token::kBIT_OR:
974 case Token::kBIT_XOR: 976 case Token::kBIT_XOR:
975 return false; 977 return false;
976 case Token::kSHR: { 978 case Token::kSHR: {
977 // Can't deopt if shift-count is known positive. 979 // Can't deopt if shift-count is known positive.
978 Range* right_range = this->right()->definition()->range(); 980 Range* right_range = this->right()->definition()->range();
979 return (right_range == NULL) 981 return (right_range == NULL)
980 || !right_range->IsWithin(0, RangeBoundary::kPlusInfinity); 982 || !right_range->IsWithin(0, RangeBoundary::kPlusInfinity);
(...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
2491 default: 2493 default:
2492 UNREACHABLE(); 2494 UNREACHABLE();
2493 } 2495 }
2494 return kPowRuntimeEntry; 2496 return kPowRuntimeEntry;
2495 } 2497 }
2496 2498
2497 2499
2498 #undef __ 2500 #undef __
2499 2501
2500 } // namespace dart 2502 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language_x64.cc » ('j') | runtime/vm/intermediate_language_x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698