OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 case Translation::JS_FRAME: | 582 case Translation::JS_FRAME: |
583 DoComputeJSFrame(&iterator, i); | 583 DoComputeJSFrame(&iterator, i); |
584 jsframe_count_++; | 584 jsframe_count_++; |
585 break; | 585 break; |
586 case Translation::ARGUMENTS_ADAPTOR_FRAME: | 586 case Translation::ARGUMENTS_ADAPTOR_FRAME: |
587 DoComputeArgumentsAdaptorFrame(&iterator, i); | 587 DoComputeArgumentsAdaptorFrame(&iterator, i); |
588 break; | 588 break; |
589 case Translation::CONSTRUCT_STUB_FRAME: | 589 case Translation::CONSTRUCT_STUB_FRAME: |
590 DoComputeConstructStubFrame(&iterator, i); | 590 DoComputeConstructStubFrame(&iterator, i); |
591 break; | 591 break; |
592 default: | 592 case Translation::SETTER_STUB_FRAME: |
| 593 DoComputeSetterStubFrame(&iterator, i); |
| 594 break; |
| 595 case Translation::BEGIN: |
| 596 case Translation::REGISTER: |
| 597 case Translation::INT32_REGISTER: |
| 598 case Translation::DOUBLE_REGISTER: |
| 599 case Translation::STACK_SLOT: |
| 600 case Translation::INT32_STACK_SLOT: |
| 601 case Translation::DOUBLE_STACK_SLOT: |
| 602 case Translation::LITERAL: |
| 603 case Translation::ARGUMENTS_OBJECT: |
| 604 case Translation::DUPLICATE: |
593 UNREACHABLE(); | 605 UNREACHABLE(); |
594 break; | 606 break; |
595 } | 607 } |
596 } | 608 } |
597 | 609 |
598 // Print some helpful diagnostic information. | 610 // Print some helpful diagnostic information. |
599 if (FLAG_trace_deopt) { | 611 if (FLAG_trace_deopt) { |
600 double ms = static_cast<double>(OS::Ticks() - start) / 1000; | 612 double ms = static_cast<double>(OS::Ticks() - start) / 1000; |
601 int index = output_count_ - 1; // Index of the topmost frame. | 613 int index = output_count_ - 1; // Index of the topmost frame. |
602 JSFunction* function = output_[index]->GetFunction(); | 614 JSFunction* function = output_[index]->GetFunction(); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 opcode = static_cast<Translation::Opcode>(iterator->Next()); | 713 opcode = static_cast<Translation::Opcode>(iterator->Next()); |
702 iterator->Skip(Translation::NumberOfOperandsFor(opcode)); | 714 iterator->Skip(Translation::NumberOfOperandsFor(opcode)); |
703 opcode = static_cast<Translation::Opcode>(iterator->Next()); | 715 opcode = static_cast<Translation::Opcode>(iterator->Next()); |
704 } | 716 } |
705 | 717 |
706 switch (opcode) { | 718 switch (opcode) { |
707 case Translation::BEGIN: | 719 case Translation::BEGIN: |
708 case Translation::JS_FRAME: | 720 case Translation::JS_FRAME: |
709 case Translation::ARGUMENTS_ADAPTOR_FRAME: | 721 case Translation::ARGUMENTS_ADAPTOR_FRAME: |
710 case Translation::CONSTRUCT_STUB_FRAME: | 722 case Translation::CONSTRUCT_STUB_FRAME: |
| 723 case Translation::SETTER_STUB_FRAME: |
711 case Translation::DUPLICATE: | 724 case Translation::DUPLICATE: |
712 UNREACHABLE(); | 725 UNREACHABLE(); |
713 return; | 726 return; |
714 | 727 |
715 case Translation::REGISTER: { | 728 case Translation::REGISTER: { |
716 int input_reg = iterator->Next(); | 729 int input_reg = iterator->Next(); |
717 intptr_t input_value = input_->GetRegister(input_reg); | 730 intptr_t input_value = input_->GetRegister(input_reg); |
718 if (FLAG_trace_deopt) { | 731 if (FLAG_trace_deopt) { |
719 PrintF( | 732 PrintF( |
720 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" V8PRIxPTR " ; %s ", | 733 " 0x%08" V8PRIxPTR ": [top + %d] <- 0x%08" V8PRIxPTR " ; %s ", |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 bool duplicate = (opcode == Translation::DUPLICATE); | 901 bool duplicate = (opcode == Translation::DUPLICATE); |
889 if (duplicate) { | 902 if (duplicate) { |
890 opcode = static_cast<Translation::Opcode>(iterator->Next()); | 903 opcode = static_cast<Translation::Opcode>(iterator->Next()); |
891 } | 904 } |
892 | 905 |
893 switch (opcode) { | 906 switch (opcode) { |
894 case Translation::BEGIN: | 907 case Translation::BEGIN: |
895 case Translation::JS_FRAME: | 908 case Translation::JS_FRAME: |
896 case Translation::ARGUMENTS_ADAPTOR_FRAME: | 909 case Translation::ARGUMENTS_ADAPTOR_FRAME: |
897 case Translation::CONSTRUCT_STUB_FRAME: | 910 case Translation::CONSTRUCT_STUB_FRAME: |
| 911 case Translation::SETTER_STUB_FRAME: |
898 case Translation::DUPLICATE: | 912 case Translation::DUPLICATE: |
899 UNREACHABLE(); // Malformed input. | 913 UNREACHABLE(); // Malformed input. |
900 return false; | 914 return false; |
901 | 915 |
902 case Translation::REGISTER: { | 916 case Translation::REGISTER: { |
903 int output_reg = iterator->Next(); | 917 int output_reg = iterator->Next(); |
904 if (FLAG_trace_osr) { | 918 if (FLAG_trace_osr) { |
905 PrintF(" %s <- 0x%08" V8PRIxPTR " ; [sp + %d]\n", | 919 PrintF(" %s <- 0x%08" V8PRIxPTR " ; [sp + %d]\n", |
906 converter.NameOfCPURegister(output_reg), | 920 converter.NameOfCPURegister(output_reg), |
907 input_value, | 921 input_value, |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 } | 1357 } |
1344 | 1358 |
1345 | 1359 |
1346 void Translation::BeginConstructStubFrame(int literal_id, unsigned height) { | 1360 void Translation::BeginConstructStubFrame(int literal_id, unsigned height) { |
1347 buffer_->Add(CONSTRUCT_STUB_FRAME, zone()); | 1361 buffer_->Add(CONSTRUCT_STUB_FRAME, zone()); |
1348 buffer_->Add(literal_id, zone()); | 1362 buffer_->Add(literal_id, zone()); |
1349 buffer_->Add(height, zone()); | 1363 buffer_->Add(height, zone()); |
1350 } | 1364 } |
1351 | 1365 |
1352 | 1366 |
| 1367 void Translation::BeginSetterStubFrame(int literal_id) { |
| 1368 buffer_->Add(SETTER_STUB_FRAME, zone()); |
| 1369 buffer_->Add(literal_id, zone()); |
| 1370 } |
| 1371 |
| 1372 |
1353 void Translation::BeginArgumentsAdaptorFrame(int literal_id, unsigned height) { | 1373 void Translation::BeginArgumentsAdaptorFrame(int literal_id, unsigned height) { |
1354 buffer_->Add(ARGUMENTS_ADAPTOR_FRAME, zone()); | 1374 buffer_->Add(ARGUMENTS_ADAPTOR_FRAME, zone()); |
1355 buffer_->Add(literal_id, zone()); | 1375 buffer_->Add(literal_id, zone()); |
1356 buffer_->Add(height, zone()); | 1376 buffer_->Add(height, zone()); |
1357 } | 1377 } |
1358 | 1378 |
1359 | 1379 |
1360 void Translation::BeginJSFrame(BailoutId node_id, | 1380 void Translation::BeginJSFrame(BailoutId node_id, |
1361 int literal_id, | 1381 int literal_id, |
1362 unsigned height) { | 1382 unsigned height) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1417 void Translation::MarkDuplicate() { | 1437 void Translation::MarkDuplicate() { |
1418 buffer_->Add(DUPLICATE, zone()); | 1438 buffer_->Add(DUPLICATE, zone()); |
1419 } | 1439 } |
1420 | 1440 |
1421 | 1441 |
1422 int Translation::NumberOfOperandsFor(Opcode opcode) { | 1442 int Translation::NumberOfOperandsFor(Opcode opcode) { |
1423 switch (opcode) { | 1443 switch (opcode) { |
1424 case ARGUMENTS_OBJECT: | 1444 case ARGUMENTS_OBJECT: |
1425 case DUPLICATE: | 1445 case DUPLICATE: |
1426 return 0; | 1446 return 0; |
| 1447 case SETTER_STUB_FRAME: |
1427 case REGISTER: | 1448 case REGISTER: |
1428 case INT32_REGISTER: | 1449 case INT32_REGISTER: |
1429 case DOUBLE_REGISTER: | 1450 case DOUBLE_REGISTER: |
1430 case STACK_SLOT: | 1451 case STACK_SLOT: |
1431 case INT32_STACK_SLOT: | 1452 case INT32_STACK_SLOT: |
1432 case DOUBLE_STACK_SLOT: | 1453 case DOUBLE_STACK_SLOT: |
1433 case LITERAL: | 1454 case LITERAL: |
1434 return 1; | 1455 return 1; |
1435 case BEGIN: | 1456 case BEGIN: |
1436 case ARGUMENTS_ADAPTOR_FRAME: | 1457 case ARGUMENTS_ADAPTOR_FRAME: |
(...skipping 12 matching lines...) Expand all Loading... |
1449 const char* Translation::StringFor(Opcode opcode) { | 1470 const char* Translation::StringFor(Opcode opcode) { |
1450 switch (opcode) { | 1471 switch (opcode) { |
1451 case BEGIN: | 1472 case BEGIN: |
1452 return "BEGIN"; | 1473 return "BEGIN"; |
1453 case JS_FRAME: | 1474 case JS_FRAME: |
1454 return "JS_FRAME"; | 1475 return "JS_FRAME"; |
1455 case ARGUMENTS_ADAPTOR_FRAME: | 1476 case ARGUMENTS_ADAPTOR_FRAME: |
1456 return "ARGUMENTS_ADAPTOR_FRAME"; | 1477 return "ARGUMENTS_ADAPTOR_FRAME"; |
1457 case CONSTRUCT_STUB_FRAME: | 1478 case CONSTRUCT_STUB_FRAME: |
1458 return "CONSTRUCT_STUB_FRAME"; | 1479 return "CONSTRUCT_STUB_FRAME"; |
| 1480 case SETTER_STUB_FRAME: |
| 1481 return "SETTER_STUB_FRAME"; |
1459 case REGISTER: | 1482 case REGISTER: |
1460 return "REGISTER"; | 1483 return "REGISTER"; |
1461 case INT32_REGISTER: | 1484 case INT32_REGISTER: |
1462 return "INT32_REGISTER"; | 1485 return "INT32_REGISTER"; |
1463 case DOUBLE_REGISTER: | 1486 case DOUBLE_REGISTER: |
1464 return "DOUBLE_REGISTER"; | 1487 return "DOUBLE_REGISTER"; |
1465 case STACK_SLOT: | 1488 case STACK_SLOT: |
1466 return "STACK_SLOT"; | 1489 return "STACK_SLOT"; |
1467 case INT32_STACK_SLOT: | 1490 case INT32_STACK_SLOT: |
1468 return "INT32_STACK_SLOT"; | 1491 return "INT32_STACK_SLOT"; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1505 DeoptimizationInputData* data, | 1528 DeoptimizationInputData* data, |
1506 JavaScriptFrame* frame) { | 1529 JavaScriptFrame* frame) { |
1507 Translation::Opcode opcode = | 1530 Translation::Opcode opcode = |
1508 static_cast<Translation::Opcode>(iterator->Next()); | 1531 static_cast<Translation::Opcode>(iterator->Next()); |
1509 | 1532 |
1510 switch (opcode) { | 1533 switch (opcode) { |
1511 case Translation::BEGIN: | 1534 case Translation::BEGIN: |
1512 case Translation::JS_FRAME: | 1535 case Translation::JS_FRAME: |
1513 case Translation::ARGUMENTS_ADAPTOR_FRAME: | 1536 case Translation::ARGUMENTS_ADAPTOR_FRAME: |
1514 case Translation::CONSTRUCT_STUB_FRAME: | 1537 case Translation::CONSTRUCT_STUB_FRAME: |
| 1538 case Translation::SETTER_STUB_FRAME: |
1515 // Peeled off before getting here. | 1539 // Peeled off before getting here. |
1516 break; | 1540 break; |
1517 | 1541 |
1518 case Translation::ARGUMENTS_OBJECT: | 1542 case Translation::ARGUMENTS_OBJECT: |
1519 // This can be only emitted for local slots not for argument slots. | 1543 // This can be only emitted for local slots not for argument slots. |
1520 break; | 1544 break; |
1521 | 1545 |
1522 case Translation::REGISTER: | 1546 case Translation::REGISTER: |
1523 case Translation::INT32_REGISTER: | 1547 case Translation::INT32_REGISTER: |
1524 case Translation::DOUBLE_REGISTER: | 1548 case Translation::DOUBLE_REGISTER: |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1673 | 1697 |
1674 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { | 1698 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { |
1675 v->VisitPointer(BitCast<Object**>(&function_)); | 1699 v->VisitPointer(BitCast<Object**>(&function_)); |
1676 v->VisitPointers(parameters_, parameters_ + parameters_count_); | 1700 v->VisitPointers(parameters_, parameters_ + parameters_count_); |
1677 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); | 1701 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); |
1678 } | 1702 } |
1679 | 1703 |
1680 #endif // ENABLE_DEBUGGER_SUPPORT | 1704 #endif // ENABLE_DEBUGGER_SUPPORT |
1681 | 1705 |
1682 } } // namespace v8::internal | 1706 } } // namespace v8::internal |
OLD | NEW |