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

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

Issue 11867020: Fix bug in optimization in the presence of externalized strings. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments Created 7 years, 11 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/object.h » ('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) 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/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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // TODO(fschneider): Make sure ic_data are sorted to hit more cases. 96 // TODO(fschneider): Make sure ic_data are sorted to hit more cases.
97 if (unary_checks().GetReceiverClassIdAt(i) != 97 if (unary_checks().GetReceiverClassIdAt(i) !=
98 other_check->unary_checks().GetReceiverClassIdAt(i)) { 98 other_check->unary_checks().GetReceiverClassIdAt(i)) {
99 return false; 99 return false;
100 } 100 }
101 } 101 }
102 return true; 102 return true;
103 } 103 }
104 104
105 105
106 bool CheckClassInstr::AffectedBySideEffect() const {
107 // The class-id of string objects is not invariant: Externalization of strings
108 // via the API can change the class-id.
109 return unary_checks().HasReceiverClassId(kOneByteStringCid)
110 || unary_checks().HasReceiverClassId(kTwoByteStringCid);
111 }
112
113
106 bool CheckArrayBoundInstr::AttributesEqual(Instruction* other) const { 114 bool CheckArrayBoundInstr::AttributesEqual(Instruction* other) const {
107 CheckArrayBoundInstr* other_check = other->AsCheckArrayBound(); 115 CheckArrayBoundInstr* other_check = other->AsCheckArrayBound();
108 ASSERT(other_check != NULL); 116 ASSERT(other_check != NULL);
109 return array_type() == other_check->array_type(); 117 return array_type() == other_check->array_type();
110 } 118 }
111 119
112 120
113 bool AssertAssignableInstr::AttributesEqual(Instruction* other) const { 121 bool AssertAssignableInstr::AttributesEqual(Instruction* other) const {
114 AssertAssignableInstr* other_assert = other->AsAssertAssignable(); 122 AssertAssignableInstr* other_assert = other->AsAssertAssignable();
115 ASSERT(other_assert != NULL); 123 ASSERT(other_assert != NULL);
(...skipping 2574 matching lines...) Expand 10 before | Expand all | Expand 10 after
2690 return ByteArray::length_offset(); 2698 return ByteArray::length_offset();
2691 default: 2699 default:
2692 UNREACHABLE(); 2700 UNREACHABLE();
2693 return -1; 2701 return -1;
2694 } 2702 }
2695 } 2703 }
2696 2704
2697 #undef __ 2705 #undef __
2698 2706
2699 } // namespace dart 2707 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698