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

Side by Side Diff: src/deoptimizer.cc

Issue 10910110: Fixed deoptimization of inlined getters. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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
« no previous file with comments | « src/deoptimizer.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 case Translation::GETTER_STUB_FRAME:
593 DoComputeAccessorStubFrame(&iterator, i, false);
594 break;
592 case Translation::SETTER_STUB_FRAME: 595 case Translation::SETTER_STUB_FRAME:
593 DoComputeSetterStubFrame(&iterator, i); 596 DoComputeAccessorStubFrame(&iterator, i, true);
594 break; 597 break;
595 case Translation::BEGIN: 598 case Translation::BEGIN:
596 case Translation::REGISTER: 599 case Translation::REGISTER:
597 case Translation::INT32_REGISTER: 600 case Translation::INT32_REGISTER:
598 case Translation::UINT32_REGISTER: 601 case Translation::UINT32_REGISTER:
599 case Translation::DOUBLE_REGISTER: 602 case Translation::DOUBLE_REGISTER:
600 case Translation::STACK_SLOT: 603 case Translation::STACK_SLOT:
601 case Translation::INT32_STACK_SLOT: 604 case Translation::INT32_STACK_SLOT:
602 case Translation::UINT32_STACK_SLOT: 605 case Translation::UINT32_STACK_SLOT:
603 case Translation::DOUBLE_STACK_SLOT: 606 case Translation::DOUBLE_STACK_SLOT:
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 opcode = static_cast<Translation::Opcode>(iterator->Next()); 718 opcode = static_cast<Translation::Opcode>(iterator->Next());
716 iterator->Skip(Translation::NumberOfOperandsFor(opcode)); 719 iterator->Skip(Translation::NumberOfOperandsFor(opcode));
717 opcode = static_cast<Translation::Opcode>(iterator->Next()); 720 opcode = static_cast<Translation::Opcode>(iterator->Next());
718 } 721 }
719 722
720 switch (opcode) { 723 switch (opcode) {
721 case Translation::BEGIN: 724 case Translation::BEGIN:
722 case Translation::JS_FRAME: 725 case Translation::JS_FRAME:
723 case Translation::ARGUMENTS_ADAPTOR_FRAME: 726 case Translation::ARGUMENTS_ADAPTOR_FRAME:
724 case Translation::CONSTRUCT_STUB_FRAME: 727 case Translation::CONSTRUCT_STUB_FRAME:
728 case Translation::GETTER_STUB_FRAME:
725 case Translation::SETTER_STUB_FRAME: 729 case Translation::SETTER_STUB_FRAME:
726 case Translation::DUPLICATE: 730 case Translation::DUPLICATE:
727 UNREACHABLE(); 731 UNREACHABLE();
728 return; 732 return;
729 733
730 case Translation::REGISTER: { 734 case Translation::REGISTER: {
731 int input_reg = iterator->Next(); 735 int input_reg = iterator->Next();
732 intptr_t input_value = input_->GetRegister(input_reg); 736 intptr_t input_value = input_->GetRegister(input_reg);
733 if (FLAG_trace_deopt) { 737 if (FLAG_trace_deopt) {
734 PrintF( 738 PrintF(
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 bool duplicate = (opcode == Translation::DUPLICATE); 1015 bool duplicate = (opcode == Translation::DUPLICATE);
1012 if (duplicate) { 1016 if (duplicate) {
1013 opcode = static_cast<Translation::Opcode>(iterator->Next()); 1017 opcode = static_cast<Translation::Opcode>(iterator->Next());
1014 } 1018 }
1015 1019
1016 switch (opcode) { 1020 switch (opcode) {
1017 case Translation::BEGIN: 1021 case Translation::BEGIN:
1018 case Translation::JS_FRAME: 1022 case Translation::JS_FRAME:
1019 case Translation::ARGUMENTS_ADAPTOR_FRAME: 1023 case Translation::ARGUMENTS_ADAPTOR_FRAME:
1020 case Translation::CONSTRUCT_STUB_FRAME: 1024 case Translation::CONSTRUCT_STUB_FRAME:
1025 case Translation::GETTER_STUB_FRAME:
1021 case Translation::SETTER_STUB_FRAME: 1026 case Translation::SETTER_STUB_FRAME:
1022 case Translation::DUPLICATE: 1027 case Translation::DUPLICATE:
1023 UNREACHABLE(); // Malformed input. 1028 UNREACHABLE(); // Malformed input.
1024 return false; 1029 return false;
1025 1030
1026 case Translation::REGISTER: { 1031 case Translation::REGISTER: {
1027 int output_reg = iterator->Next(); 1032 int output_reg = iterator->Next();
1028 if (FLAG_trace_osr) { 1033 if (FLAG_trace_osr) {
1029 PrintF(" %s <- 0x%08" V8PRIxPTR " ; [sp + %d]\n", 1034 PrintF(" %s <- 0x%08" V8PRIxPTR " ; [sp + %d]\n",
1030 converter.NameOfCPURegister(output_reg), 1035 converter.NameOfCPURegister(output_reg),
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 } 1480 }
1476 1481
1477 1482
1478 void Translation::BeginConstructStubFrame(int literal_id, unsigned height) { 1483 void Translation::BeginConstructStubFrame(int literal_id, unsigned height) {
1479 buffer_->Add(CONSTRUCT_STUB_FRAME, zone()); 1484 buffer_->Add(CONSTRUCT_STUB_FRAME, zone());
1480 buffer_->Add(literal_id, zone()); 1485 buffer_->Add(literal_id, zone());
1481 buffer_->Add(height, zone()); 1486 buffer_->Add(height, zone());
1482 } 1487 }
1483 1488
1484 1489
1490 void Translation::BeginGetterStubFrame(int literal_id) {
1491 buffer_->Add(GETTER_STUB_FRAME, zone());
1492 buffer_->Add(literal_id, zone());
1493 }
1494
1495
1485 void Translation::BeginSetterStubFrame(int literal_id) { 1496 void Translation::BeginSetterStubFrame(int literal_id) {
1486 buffer_->Add(SETTER_STUB_FRAME, zone()); 1497 buffer_->Add(SETTER_STUB_FRAME, zone());
1487 buffer_->Add(literal_id, zone()); 1498 buffer_->Add(literal_id, zone());
1488 } 1499 }
1489 1500
1490 1501
1491 void Translation::BeginArgumentsAdaptorFrame(int literal_id, unsigned height) { 1502 void Translation::BeginArgumentsAdaptorFrame(int literal_id, unsigned height) {
1492 buffer_->Add(ARGUMENTS_ADAPTOR_FRAME, zone()); 1503 buffer_->Add(ARGUMENTS_ADAPTOR_FRAME, zone());
1493 buffer_->Add(literal_id, zone()); 1504 buffer_->Add(literal_id, zone());
1494 buffer_->Add(height, zone()); 1505 buffer_->Add(height, zone());
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 void Translation::MarkDuplicate() { 1578 void Translation::MarkDuplicate() {
1568 buffer_->Add(DUPLICATE, zone()); 1579 buffer_->Add(DUPLICATE, zone());
1569 } 1580 }
1570 1581
1571 1582
1572 int Translation::NumberOfOperandsFor(Opcode opcode) { 1583 int Translation::NumberOfOperandsFor(Opcode opcode) {
1573 switch (opcode) { 1584 switch (opcode) {
1574 case ARGUMENTS_OBJECT: 1585 case ARGUMENTS_OBJECT:
1575 case DUPLICATE: 1586 case DUPLICATE:
1576 return 0; 1587 return 0;
1588 case GETTER_STUB_FRAME:
1577 case SETTER_STUB_FRAME: 1589 case SETTER_STUB_FRAME:
1578 case REGISTER: 1590 case REGISTER:
1579 case INT32_REGISTER: 1591 case INT32_REGISTER:
1580 case UINT32_REGISTER: 1592 case UINT32_REGISTER:
1581 case DOUBLE_REGISTER: 1593 case DOUBLE_REGISTER:
1582 case STACK_SLOT: 1594 case STACK_SLOT:
1583 case INT32_STACK_SLOT: 1595 case INT32_STACK_SLOT:
1584 case UINT32_STACK_SLOT: 1596 case UINT32_STACK_SLOT:
1585 case DOUBLE_STACK_SLOT: 1597 case DOUBLE_STACK_SLOT:
1586 case LITERAL: 1598 case LITERAL:
(...skipping 15 matching lines...) Expand all
1602 const char* Translation::StringFor(Opcode opcode) { 1614 const char* Translation::StringFor(Opcode opcode) {
1603 switch (opcode) { 1615 switch (opcode) {
1604 case BEGIN: 1616 case BEGIN:
1605 return "BEGIN"; 1617 return "BEGIN";
1606 case JS_FRAME: 1618 case JS_FRAME:
1607 return "JS_FRAME"; 1619 return "JS_FRAME";
1608 case ARGUMENTS_ADAPTOR_FRAME: 1620 case ARGUMENTS_ADAPTOR_FRAME:
1609 return "ARGUMENTS_ADAPTOR_FRAME"; 1621 return "ARGUMENTS_ADAPTOR_FRAME";
1610 case CONSTRUCT_STUB_FRAME: 1622 case CONSTRUCT_STUB_FRAME:
1611 return "CONSTRUCT_STUB_FRAME"; 1623 return "CONSTRUCT_STUB_FRAME";
1624 case GETTER_STUB_FRAME:
1625 return "GETTER_STUB_FRAME";
1612 case SETTER_STUB_FRAME: 1626 case SETTER_STUB_FRAME:
1613 return "SETTER_STUB_FRAME"; 1627 return "SETTER_STUB_FRAME";
1614 case REGISTER: 1628 case REGISTER:
1615 return "REGISTER"; 1629 return "REGISTER";
1616 case INT32_REGISTER: 1630 case INT32_REGISTER:
1617 return "INT32_REGISTER"; 1631 return "INT32_REGISTER";
1618 case UINT32_REGISTER: 1632 case UINT32_REGISTER:
1619 return "UINT32_REGISTER"; 1633 return "UINT32_REGISTER";
1620 case DOUBLE_REGISTER: 1634 case DOUBLE_REGISTER:
1621 return "DOUBLE_REGISTER"; 1635 return "DOUBLE_REGISTER";
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1664 DeoptimizationInputData* data, 1678 DeoptimizationInputData* data,
1665 JavaScriptFrame* frame) { 1679 JavaScriptFrame* frame) {
1666 Translation::Opcode opcode = 1680 Translation::Opcode opcode =
1667 static_cast<Translation::Opcode>(iterator->Next()); 1681 static_cast<Translation::Opcode>(iterator->Next());
1668 1682
1669 switch (opcode) { 1683 switch (opcode) {
1670 case Translation::BEGIN: 1684 case Translation::BEGIN:
1671 case Translation::JS_FRAME: 1685 case Translation::JS_FRAME:
1672 case Translation::ARGUMENTS_ADAPTOR_FRAME: 1686 case Translation::ARGUMENTS_ADAPTOR_FRAME:
1673 case Translation::CONSTRUCT_STUB_FRAME: 1687 case Translation::CONSTRUCT_STUB_FRAME:
1688 case Translation::GETTER_STUB_FRAME:
1674 case Translation::SETTER_STUB_FRAME: 1689 case Translation::SETTER_STUB_FRAME:
1675 // Peeled off before getting here. 1690 // Peeled off before getting here.
1676 break; 1691 break;
1677 1692
1678 case Translation::ARGUMENTS_OBJECT: 1693 case Translation::ARGUMENTS_OBJECT:
1679 // This can be only emitted for local slots not for argument slots. 1694 // This can be only emitted for local slots not for argument slots.
1680 break; 1695 break;
1681 1696
1682 case Translation::REGISTER: 1697 case Translation::REGISTER:
1683 case Translation::INT32_REGISTER: 1698 case Translation::INT32_REGISTER:
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 1855
1841 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 1856 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
1842 v->VisitPointer(BitCast<Object**>(&function_)); 1857 v->VisitPointer(BitCast<Object**>(&function_));
1843 v->VisitPointers(parameters_, parameters_ + parameters_count_); 1858 v->VisitPointers(parameters_, parameters_ + parameters_count_);
1844 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 1859 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
1845 } 1860 }
1846 1861
1847 #endif // ENABLE_DEBUGGER_SUPPORT 1862 #endif // ENABLE_DEBUGGER_SUPPORT
1848 1863
1849 } } // namespace v8::internal 1864 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/deoptimizer.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698