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

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

Issue 10828414: Fix a bug in Equals for UseVal and ConstantVal. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 26 matching lines...) Expand all
37 37
38 bool Computation::Equals(Computation* other) const { 38 bool Computation::Equals(Computation* other) const {
39 if (computation_kind() != other->computation_kind()) return false; 39 if (computation_kind() != other->computation_kind()) return false;
40 for (intptr_t i = 0; i < InputCount(); ++i) { 40 for (intptr_t i = 0; i < InputCount(); ++i) {
41 if (!InputAt(i)->Equals(other->InputAt(i))) return false; 41 if (!InputAt(i)->Equals(other->InputAt(i))) return false;
42 } 42 }
43 return AttributesEqual(other); 43 return AttributesEqual(other);
44 } 44 }
45 45
46 46
47 bool UseVal::AttributesEqual(Computation* other) const {
48 return other->IsUse()
49 && definition() == other->AsUse()->definition();
50 }
51
52
53 bool ConstantVal::AttributesEqual(Computation* other) const {
54 return other->IsConstant()
55 && value().raw() == other->AsConstant()->value().raw();
56 }
57
58
47 bool CheckClassComp::AttributesEqual(Computation* other) const { 59 bool CheckClassComp::AttributesEqual(Computation* other) const {
48 CheckClassComp* other_check = other->AsCheckClass(); 60 CheckClassComp* other_check = other->AsCheckClass();
49 if (other_check == NULL) return false; 61 if (other_check == NULL) return false;
50 if (ic_data()->NumberOfChecks() != other->ic_data()->NumberOfChecks()) { 62 if (ic_data()->NumberOfChecks() != other->ic_data()->NumberOfChecks()) {
51 return false; 63 return false;
52 } 64 }
53 for (intptr_t i = 0; i < ic_data()->NumberOfChecks(); ++i) { 65 for (intptr_t i = 0; i < ic_data()->NumberOfChecks(); ++i) {
54 // TODO(fschneider): Make sure ic_data are sorted to hit more cases. 66 // TODO(fschneider): Make sure ic_data are sorted to hit more cases.
55 if (ic_data()->GetReceiverClassIdAt(i) != 67 if (ic_data()->GetReceiverClassIdAt(i) !=
56 other->ic_data()->GetReceiverClassIdAt(i)) { 68 other->ic_data()->GetReceiverClassIdAt(i)) {
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 fixed_parameter_count_(fixed_parameter_count) { 1527 fixed_parameter_count_(fixed_parameter_count) {
1516 for (intptr_t i = 0; i < definitions.length(); ++i) { 1528 for (intptr_t i = 0; i < definitions.length(); ++i) {
1517 values_.Add(UseDefinition(definitions[i])); 1529 values_.Add(UseDefinition(definitions[i]));
1518 } 1530 }
1519 } 1531 }
1520 1532
1521 1533
1522 #undef __ 1534 #undef __
1523 1535
1524 } // namespace dart 1536 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698