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

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: 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
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 for (intptr_t i = 0; i < unary_checks().NumberOfChecks(); ++i) { 95 for (intptr_t i = 0; i < unary_checks().NumberOfChecks(); ++i) {
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
Vyacheslav Egorov (Google) 2013/01/18 13:34:44 new line here
Florian Schneider 2013/01/18 16:22:38 Done.
105 bool CheckClassInstr::AffectedBySideEffect() const {
106 // The class-id of string objects is not invariant: Externalization of strings
107 // via the API can change the class-id.
108 for (intptr_t i = 0; i < unary_checks().NumberOfChecks(); i++) {
Vyacheslav Egorov (Google) 2013/01/18 13:34:44 optimizer has ICDataHasReceiverClassId that does s
Florian Schneider 2013/01/18 16:22:38 Done.
109 intptr_t cid = unary_checks().GetReceiverClassIdAt(i);
110 if (cid == kOneByteStringCid || cid == kTwoByteStringCid) {
111 return true;
112 }
113 }
114 return false;
115 }
105 116
Vyacheslav Egorov (Google) 2013/01/18 13:34:44 new line here
Florian Schneider 2013/01/18 16:22:38 Done.
106 bool CheckArrayBoundInstr::AttributesEqual(Instruction* other) const { 117 bool CheckArrayBoundInstr::AttributesEqual(Instruction* other) const {
107 CheckArrayBoundInstr* other_check = other->AsCheckArrayBound(); 118 CheckArrayBoundInstr* other_check = other->AsCheckArrayBound();
108 ASSERT(other_check != NULL); 119 ASSERT(other_check != NULL);
109 return array_type() == other_check->array_type(); 120 return array_type() == other_check->array_type();
110 } 121 }
111 122
112 123
113 bool AssertAssignableInstr::AttributesEqual(Instruction* other) const { 124 bool AssertAssignableInstr::AttributesEqual(Instruction* other) const {
114 AssertAssignableInstr* other_assert = other->AsAssertAssignable(); 125 AssertAssignableInstr* other_assert = other->AsAssertAssignable();
115 ASSERT(other_assert != NULL); 126 ASSERT(other_assert != NULL);
(...skipping 2574 matching lines...) Expand 10 before | Expand all | Expand 10 after
2690 return ByteArray::length_offset(); 2701 return ByteArray::length_offset();
2691 default: 2702 default:
2692 UNREACHABLE(); 2703 UNREACHABLE();
2693 return -1; 2704 return -1;
2694 } 2705 }
2695 } 2706 }
2696 2707
2697 #undef __ 2708 #undef __
2698 2709
2699 } // namespace dart 2710 } // namespace dart
OLDNEW
« runtime/vm/dart_api_impl_test.cc ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698