| 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/jit_optimizer.h" | 5 #include "vm/jit_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/branch_optimizer.h" | 8 #include "vm/branch_optimizer.h" |
| 9 #include "vm/cha.h" | 9 #include "vm/cha.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 Token::kNEGATE, new(Z) Value(input), call->deopt_id()); | 1255 Token::kNEGATE, new(Z) Value(input), call->deopt_id()); |
| 1256 } else { | 1256 } else { |
| 1257 return false; | 1257 return false; |
| 1258 } | 1258 } |
| 1259 ASSERT(unary_op != NULL); | 1259 ASSERT(unary_op != NULL); |
| 1260 ReplaceCall(call, unary_op); | 1260 ReplaceCall(call, unary_op); |
| 1261 return true; | 1261 return true; |
| 1262 } | 1262 } |
| 1263 | 1263 |
| 1264 | 1264 |
| 1265 // Using field class | 1265 // Using field class. |
| 1266 RawField* JitOptimizer::GetField(intptr_t class_id, | 1266 RawField* JitOptimizer::GetField(intptr_t class_id, |
| 1267 const String& field_name) { | 1267 const String& field_name) { |
| 1268 Class& cls = Class::Handle(Z, isolate()->class_table()->At(class_id)); | 1268 Class& cls = Class::Handle(Z, isolate()->class_table()->At(class_id)); |
| 1269 Field& field = Field::Handle(Z); | 1269 Field& field = Field::Handle(Z); |
| 1270 while (!cls.IsNull()) { | 1270 while (!cls.IsNull()) { |
| 1271 field = cls.LookupInstanceField(field_name); | 1271 field = cls.LookupInstanceField(field_name); |
| 1272 if (!field.IsNull()) { | 1272 if (!field.IsNull()) { |
| 1273 return field.raw(); | 1273 if (Compiler::IsBackgroundCompilation() || |
| 1274 FLAG_force_clone_compiler_objects) { |
| 1275 return field.CloneFromOriginal(); |
| 1276 } else { |
| 1277 return field.raw(); |
| 1278 } |
| 1274 } | 1279 } |
| 1275 cls = cls.SuperClass(); | 1280 cls = cls.SuperClass(); |
| 1276 } | 1281 } |
| 1277 return Field::null(); | 1282 return Field::null(); |
| 1278 } | 1283 } |
| 1279 | 1284 |
| 1280 | 1285 |
| 1281 // Use CHA to determine if the call needs a class check: if the callee's | 1286 // Use CHA to determine if the call needs a class check: if the callee's |
| 1282 // receiver is the same as the caller's receiver and there are no overriden | 1287 // receiver is the same as the caller's receiver and there are no overriden |
| 1283 // callee functions, then no class check is needed. | 1288 // callee functions, then no class check is needed. |
| (...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3148 | 3153 |
| 3149 // Discard the environment from the original instruction because the store | 3154 // Discard the environment from the original instruction because the store |
| 3150 // can't deoptimize. | 3155 // can't deoptimize. |
| 3151 instr->RemoveEnvironment(); | 3156 instr->RemoveEnvironment(); |
| 3152 ReplaceCall(instr, store); | 3157 ReplaceCall(instr, store); |
| 3153 return true; | 3158 return true; |
| 3154 } | 3159 } |
| 3155 | 3160 |
| 3156 | 3161 |
| 3157 } // namespace dart | 3162 } // namespace dart |
| OLD | NEW |