| OLD | NEW |
| 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/code_generator.h" | 5 #include "vm/code_generator.h" |
| 6 | 6 |
| 7 #include "vm/assembler_macros.h" | 7 #include "vm/assembler_macros.h" |
| 8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
| (...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1389 frame->pc(), | 1389 frame->pc(), |
| 1390 target_function.ToFullyQualifiedCString(), | 1390 target_function.ToFullyQualifiedCString(), |
| 1391 new_entry_point); | 1391 new_entry_point); |
| 1392 } | 1392 } |
| 1393 } | 1393 } |
| 1394 } | 1394 } |
| 1395 | 1395 |
| 1396 | 1396 |
| 1397 static const char* DeoptReasonToText(intptr_t deopt_id) { | 1397 static const char* DeoptReasonToText(intptr_t deopt_id) { |
| 1398 switch (deopt_id) { | 1398 switch (deopt_id) { |
| 1399 case kDeoptUnknown: return "kDeoptUnknown"; | 1399 #define DEOPT_REASON_ID_TO_TEXT(name) case k##name: return #name; |
| 1400 case kDeoptIncrLocal: return "kDeoptIncrLocal"; | 1400 DEOPT_REASONS(DEOPT_REASON_ID_TO_TEXT) |
| 1401 case kDeoptIncrInstance: return "kDeoptIncrInstance"; | 1401 #undef DEOPT_REASON_ID_TO_TEXT |
| 1402 case kDeoptIncrInstanceOneClass: return "kDeoptIncrInstanceOneClass"; | |
| 1403 case kDeoptInstanceGetterSameTarget: | |
| 1404 return "kDeoptInstanceGetterSameTarget"; | |
| 1405 case kDeoptInstanceGetter: return "kDeoptInstanceGetter"; | |
| 1406 case kDeoptStoreIndexed: return "kDeoptStoreIndexed"; | |
| 1407 case kDeoptCheckedInstanceCallSmiOnly: | |
| 1408 return "kDeoptCheckedInstanceCallSmiOnly"; | |
| 1409 case kDeoptCheckedInstanceCallSmiFail: | |
| 1410 return "kDeoptCheckedInstanceCallSmiFail"; | |
| 1411 case kDeoptCheckedInstanceCallCheckFail: | |
| 1412 return "kDeoptCheckedInstanceCallCheckFail"; | |
| 1413 case kDeoptIntegerToDouble: return "kDeoptIntegerToDouble"; | |
| 1414 case kDeoptDoubleToDouble: return "kDeoptDoubleToDouble"; | |
| 1415 case kDeoptSmiBinaryOp: return "kDeoptSmiBinaryOp"; | |
| 1416 case kDeoptMintBinaryOp: return "kDeoptMintBinaryOp"; | |
| 1417 case kDeoptDoubleBinaryOp: return "kDeoptDoubleBinaryOp"; | |
| 1418 case kDeoptInstanceSetterSameTarget: | |
| 1419 return "kDeoptInstanceSetterSameTarget"; | |
| 1420 case kDeoptInstanceSetter: return "kDeoptInstanceSetter"; | |
| 1421 case kDeoptSmiEquality: return "kDeoptSmiEquality"; | |
| 1422 case kDeoptSmiCompareSmis: return "kDeoptSmiCompareSmis"; | |
| 1423 case kDeoptSmiCompareAny: return "kDeoptSmiCompareAny"; | |
| 1424 case kDeoptEqualityNoFeedback: return "kDeoptEqualityNoFeedback"; | |
| 1425 case kDeoptEqualityClassCheck: return "kDeoptEqualityClassCheck"; | |
| 1426 case kDeoptDoubleComparison: return "kDeoptDoubleComparison"; | |
| 1427 case kDeoptLoadIndexedFixedArray: return "kDeoptLoadIndexedFixedArray"; | |
| 1428 case kDeoptLoadIndexedGrowableArray: | |
| 1429 return "kDeoptLoadIndexedGrowableArray"; | |
| 1430 case kDeoptNoTypeFeedback: return "kDeoptNoTypeFeedback"; | |
| 1431 case kDeoptSAR: return "kDeoptSAR"; | |
| 1432 case kDeoptUnaryOp: return "kDeoptUnaryOp"; | |
| 1433 default: | 1402 default: |
| 1434 UNREACHABLE(); | 1403 UNREACHABLE(); |
| 1435 return ""; | 1404 return ""; |
| 1436 } | 1405 } |
| 1437 } | 1406 } |
| 1438 | 1407 |
| 1439 | 1408 |
| 1440 // The top Dart frame belongs to the optimized method that needs to be | 1409 // The top Dart frame belongs to the optimized method that needs to be |
| 1441 // deoptimized. The pc of the Dart frame points to the deoptimization point. | 1410 // deoptimized. The pc of the Dart frame points to the deoptimization point. |
| 1442 // Find the node id of the deoptimization point and find the continuation | 1411 // Find the node id of the deoptimization point and find the continuation |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1599 } | 1568 } |
| 1600 } | 1569 } |
| 1601 } | 1570 } |
| 1602 // The cache is null terminated, therefore the loop above should never | 1571 // The cache is null terminated, therefore the loop above should never |
| 1603 // terminate by itself. | 1572 // terminate by itself. |
| 1604 UNREACHABLE(); | 1573 UNREACHABLE(); |
| 1605 return Code::null(); | 1574 return Code::null(); |
| 1606 } | 1575 } |
| 1607 | 1576 |
| 1608 } // namespace dart | 1577 } // namespace dart |
| OLD | NEW |