| 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/code_generator.h" | 5 #include "vm/code_generator.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
| 9 #include "vm/code_patcher.h" | 9 #include "vm/code_patcher.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 if (target_function.IsNull()) { | 1099 if (target_function.IsNull()) { |
| 1100 target_function = InlineCacheMissHelper(receiver, descriptor, name); | 1100 target_function = InlineCacheMissHelper(receiver, descriptor, name); |
| 1101 } | 1101 } |
| 1102 if (target_function.IsNull()) { | 1102 if (target_function.IsNull()) { |
| 1103 ASSERT(!FLAG_lazy_dispatchers); | 1103 ASSERT(!FLAG_lazy_dispatchers); |
| 1104 } else { | 1104 } else { |
| 1105 ic_data.AddReceiverCheck(receiver.GetClassId(), target_function); | 1105 ic_data.AddReceiverCheck(receiver.GetClassId(), target_function); |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 if (old_target.raw() == target_function.raw()) { | 1108 if (old_target.raw() == target_function.raw()) { |
| 1109 intptr_t lower, upper; | 1109 intptr_t lower, upper, unchecked_lower, unchecked_upper; |
| 1110 if (receiver.GetClassId() < cache.lower_limit()) { | 1110 if (receiver.GetClassId() < cache.lower_limit()) { |
| 1111 lower = receiver.GetClassId(); | 1111 lower = receiver.GetClassId(); |
| 1112 unchecked_lower = receiver.GetClassId(); |
| 1112 upper = cache.upper_limit(); | 1113 upper = cache.upper_limit(); |
| 1114 unchecked_upper = cache.lower_limit() - 1; |
| 1113 } else { | 1115 } else { |
| 1114 lower = cache.lower_limit(); | 1116 lower = cache.lower_limit(); |
| 1117 unchecked_lower = cache.upper_limit() + 1; |
| 1115 upper = receiver.GetClassId(); | 1118 upper = receiver.GetClassId(); |
| 1119 unchecked_upper = receiver.GetClassId(); |
| 1116 } | 1120 } |
| 1117 | 1121 |
| 1118 if (IsSingleTarget(isolate, zone, lower, upper, target_function, name)) { | 1122 if (IsSingleTarget(isolate, zone, unchecked_lower, unchecked_upper, |
| 1123 target_function, name)) { |
| 1119 cache.set_lower_limit(lower); | 1124 cache.set_lower_limit(lower); |
| 1120 cache.set_upper_limit(upper); | 1125 cache.set_upper_limit(upper); |
| 1121 // Return the ICData. The single target stub will jump to continue in the | 1126 // Return the ICData. The single target stub will jump to continue in the |
| 1122 // IC call stub. | 1127 // IC call stub. |
| 1123 arguments.SetReturn(ic_data); | 1128 arguments.SetReturn(ic_data); |
| 1124 return; | 1129 return; |
| 1125 } | 1130 } |
| 1126 } | 1131 } |
| 1127 | 1132 |
| 1128 // Call site is not single target, switch to call using ICData. | 1133 // Call site is not single target, switch to call using ICData. |
| (...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2216 const intptr_t elm_size = old_data.ElementSizeInBytes(); | 2221 const intptr_t elm_size = old_data.ElementSizeInBytes(); |
| 2217 const TypedData& new_data = | 2222 const TypedData& new_data = |
| 2218 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); | 2223 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); |
| 2219 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); | 2224 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); |
| 2220 typed_data_cell.SetAt(0, new_data); | 2225 typed_data_cell.SetAt(0, new_data); |
| 2221 arguments.SetReturn(new_data); | 2226 arguments.SetReturn(new_data); |
| 2222 } | 2227 } |
| 2223 | 2228 |
| 2224 | 2229 |
| 2225 } // namespace dart | 2230 } // namespace dart |
| OLD | NEW |