| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
| 6 | 6 |
| 7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
| 8 #include "src/compiler/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
| 9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
| 10 #include "src/compiler/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
| (...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1563 // is needed here since the constructor is created by the class literal. | 1563 // is needed here since the constructor is created by the class literal. |
| 1564 Node* proto = | 1564 Node* proto = |
| 1565 BuildLoadObjectField(literal, JSFunction::kPrototypeOrInitialMapOffset); | 1565 BuildLoadObjectField(literal, JSFunction::kPrototypeOrInitialMapOffset); |
| 1566 | 1566 |
| 1567 // The class literal and the prototype are both expected on the operand stack | 1567 // The class literal and the prototype are both expected on the operand stack |
| 1568 // during evaluation of the method values. | 1568 // during evaluation of the method values. |
| 1569 environment()->Push(literal); | 1569 environment()->Push(literal); |
| 1570 environment()->Push(proto); | 1570 environment()->Push(proto); |
| 1571 | 1571 |
| 1572 // Create nodes to store method values into the literal. | 1572 // Create nodes to store method values into the literal. |
| 1573 int store_slot_index = 0; | |
| 1574 for (int i = 0; i < expr->properties()->length(); i++) { | 1573 for (int i = 0; i < expr->properties()->length(); i++) { |
| 1575 ObjectLiteral::Property* property = expr->properties()->at(i); | 1574 ObjectLiteral::Property* property = expr->properties()->at(i); |
| 1576 environment()->Push(property->is_static() ? literal : proto); | 1575 environment()->Push(property->is_static() ? literal : proto); |
| 1577 | 1576 |
| 1578 VisitForValue(property->key()); | 1577 VisitForValue(property->key()); |
| 1579 Node* name = BuildToName(environment()->Pop(), expr->GetIdForProperty(i)); | 1578 Node* name = BuildToName(environment()->Pop(), expr->GetIdForProperty(i)); |
| 1580 environment()->Push(name); | 1579 environment()->Push(name); |
| 1581 | 1580 |
| 1582 // The static prototype property is read only. We handle the non computed | 1581 // The static prototype property is read only. We handle the non computed |
| 1583 // property name case in the parser. Since this is the only case where we | 1582 // property name case in the parser. Since this is the only case where we |
| 1584 // need to check for an own read only property we special case this so we do | 1583 // need to check for an own read only property we special case this so we do |
| 1585 // not need to do this for every property. | 1584 // not need to do this for every property. |
| 1586 if (property->is_static() && property->is_computed_name()) { | 1585 if (property->is_static() && property->is_computed_name()) { |
| 1587 Node* check = BuildThrowIfStaticPrototype(environment()->Pop(), | 1586 Node* check = BuildThrowIfStaticPrototype(environment()->Pop(), |
| 1588 expr->GetIdForProperty(i)); | 1587 expr->GetIdForProperty(i)); |
| 1589 environment()->Push(check); | 1588 environment()->Push(check); |
| 1590 } | 1589 } |
| 1591 | 1590 |
| 1592 VisitForValue(property->value()); | 1591 VisitForValue(property->value()); |
| 1593 Node* value = environment()->Pop(); | 1592 Node* value = environment()->Pop(); |
| 1594 Node* key = environment()->Pop(); | 1593 Node* key = environment()->Pop(); |
| 1595 Node* receiver = environment()->Pop(); | 1594 Node* receiver = environment()->Pop(); |
| 1596 VectorSlotPair feedback = CreateVectorSlotPair( | 1595 |
| 1597 expr->SlotForHomeObject(property->value(), &store_slot_index)); | 1596 BuildSetHomeObject(value, receiver, property); |
| 1598 BuildSetHomeObject(value, receiver, property->value(), feedback); | |
| 1599 | 1597 |
| 1600 switch (property->kind()) { | 1598 switch (property->kind()) { |
| 1601 case ObjectLiteral::Property::CONSTANT: | 1599 case ObjectLiteral::Property::CONSTANT: |
| 1602 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 1600 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
| 1603 case ObjectLiteral::Property::PROTOTYPE: | 1601 case ObjectLiteral::Property::PROTOTYPE: |
| 1604 UNREACHABLE(); | 1602 UNREACHABLE(); |
| 1605 case ObjectLiteral::Property::COMPUTED: { | 1603 case ObjectLiteral::Property::COMPUTED: { |
| 1606 const Operator* op = | 1604 const Operator* op = |
| 1607 javascript()->CallRuntime(Runtime::kDefineClassMethod, 3); | 1605 javascript()->CallRuntime(Runtime::kDefineClassMethod, 3); |
| 1608 NewNode(op, receiver, key, value); | 1606 NewNode(op, receiver, key, value); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1631 environment()->Pop(); // literal | 1629 environment()->Pop(); // literal |
| 1632 const Operator* op = | 1630 const Operator* op = |
| 1633 javascript()->CallRuntime(Runtime::kFinalizeClassDefinition, 2); | 1631 javascript()->CallRuntime(Runtime::kFinalizeClassDefinition, 2); |
| 1634 literal = NewNode(op, literal, proto); | 1632 literal = NewNode(op, literal, proto); |
| 1635 | 1633 |
| 1636 // Assign to class variable. | 1634 // Assign to class variable. |
| 1637 if (expr->scope() != NULL) { | 1635 if (expr->scope() != NULL) { |
| 1638 DCHECK_NOT_NULL(expr->class_variable_proxy()); | 1636 DCHECK_NOT_NULL(expr->class_variable_proxy()); |
| 1639 Variable* var = expr->class_variable_proxy()->var(); | 1637 Variable* var = expr->class_variable_proxy()->var(); |
| 1640 FrameStateBeforeAndAfter states(this, BailoutId::None()); | 1638 FrameStateBeforeAndAfter states(this, BailoutId::None()); |
| 1641 VectorSlotPair feedback = | 1639 VectorSlotPair feedback = CreateVectorSlotPair( |
| 1642 CreateVectorSlotPair(FLAG_vector_stores && var->IsUnallocated() | 1640 expr->NeedsProxySlot() ? expr->ProxySlot() |
| 1643 ? expr->GetNthSlot(store_slot_index++) | 1641 : FeedbackVectorICSlot::Invalid()); |
| 1644 : FeedbackVectorICSlot::Invalid()); | |
| 1645 BuildVariableAssignment(var, literal, Token::INIT_CONST, feedback, | 1642 BuildVariableAssignment(var, literal, Token::INIT_CONST, feedback, |
| 1646 BailoutId::None(), states); | 1643 BailoutId::None(), states); |
| 1647 } | 1644 } |
| 1648 ast_context()->ProduceValue(literal); | 1645 ast_context()->ProduceValue(literal); |
| 1649 } | 1646 } |
| 1650 | 1647 |
| 1651 | 1648 |
| 1652 void AstGraphBuilder::VisitNativeFunctionLiteral(NativeFunctionLiteral* expr) { | 1649 void AstGraphBuilder::VisitNativeFunctionLiteral(NativeFunctionLiteral* expr) { |
| 1653 UNREACHABLE(); | 1650 UNREACHABLE(); |
| 1654 } | 1651 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1713 Node* literal = NewNode(op, literals_array, literal_index, constants); | 1710 Node* literal = NewNode(op, literals_array, literal_index, constants); |
| 1714 PrepareFrameState(literal, expr->CreateLiteralId(), | 1711 PrepareFrameState(literal, expr->CreateLiteralId(), |
| 1715 OutputFrameStateCombine::Push()); | 1712 OutputFrameStateCombine::Push()); |
| 1716 | 1713 |
| 1717 // The object is expected on the operand stack during computation of the | 1714 // The object is expected on the operand stack during computation of the |
| 1718 // property values and is the value of the entire expression. | 1715 // property values and is the value of the entire expression. |
| 1719 environment()->Push(literal); | 1716 environment()->Push(literal); |
| 1720 | 1717 |
| 1721 // Create nodes to store computed values into the literal. | 1718 // Create nodes to store computed values into the literal. |
| 1722 int property_index = 0; | 1719 int property_index = 0; |
| 1723 int store_slot_index = 0; | |
| 1724 AccessorTable accessor_table(zone()); | 1720 AccessorTable accessor_table(zone()); |
| 1725 for (; property_index < expr->properties()->length(); property_index++) { | 1721 for (; property_index < expr->properties()->length(); property_index++) { |
| 1726 ObjectLiteral::Property* property = expr->properties()->at(property_index); | 1722 ObjectLiteral::Property* property = expr->properties()->at(property_index); |
| 1727 if (property->is_computed_name()) break; | 1723 if (property->is_computed_name()) break; |
| 1728 if (property->IsCompileTimeValue()) continue; | 1724 if (property->IsCompileTimeValue()) continue; |
| 1729 | 1725 |
| 1730 Literal* key = property->key()->AsLiteral(); | 1726 Literal* key = property->key()->AsLiteral(); |
| 1731 switch (property->kind()) { | 1727 switch (property->kind()) { |
| 1732 case ObjectLiteral::Property::CONSTANT: | 1728 case ObjectLiteral::Property::CONSTANT: |
| 1733 UNREACHABLE(); | 1729 UNREACHABLE(); |
| 1734 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 1730 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
| 1735 DCHECK(!CompileTimeValue::IsCompileTimeValue(property->value())); | 1731 DCHECK(!CompileTimeValue::IsCompileTimeValue(property->value())); |
| 1736 // Fall through. | 1732 // Fall through. |
| 1737 case ObjectLiteral::Property::COMPUTED: { | 1733 case ObjectLiteral::Property::COMPUTED: { |
| 1738 // It is safe to use [[Put]] here because the boilerplate already | 1734 // It is safe to use [[Put]] here because the boilerplate already |
| 1739 // contains computed properties with an uninitialized value. | 1735 // contains computed properties with an uninitialized value. |
| 1740 if (key->value()->IsInternalizedString()) { | 1736 if (key->value()->IsInternalizedString()) { |
| 1741 if (property->emit_store()) { | 1737 if (property->emit_store()) { |
| 1742 VisitForValue(property->value()); | 1738 VisitForValue(property->value()); |
| 1743 FrameStateBeforeAndAfter states(this, property->value()->id()); | 1739 FrameStateBeforeAndAfter states(this, property->value()->id()); |
| 1744 Node* value = environment()->Pop(); | 1740 Node* value = environment()->Pop(); |
| 1745 Handle<Name> name = key->AsPropertyName(); | 1741 Handle<Name> name = key->AsPropertyName(); |
| 1746 VectorSlotPair feedback = | 1742 VectorSlotPair feedback = |
| 1747 FLAG_vector_stores | 1743 CreateVectorSlotPair(property->GetSlot(0)); |
| 1748 ? CreateVectorSlotPair(expr->GetNthSlot(store_slot_index++)) | |
| 1749 : VectorSlotPair(); | |
| 1750 Node* store = BuildNamedStore(literal, name, value, feedback, | 1744 Node* store = BuildNamedStore(literal, name, value, feedback, |
| 1751 TypeFeedbackId::None()); | 1745 TypeFeedbackId::None()); |
| 1752 states.AddToNode(store, key->id(), | 1746 states.AddToNode(store, key->id(), |
| 1753 OutputFrameStateCombine::Ignore()); | 1747 OutputFrameStateCombine::Ignore()); |
| 1754 VectorSlotPair home_feedback = CreateVectorSlotPair( | 1748 BuildSetHomeObject(value, literal, property, 1); |
| 1755 expr->SlotForHomeObject(property->value(), &store_slot_index)); | |
| 1756 BuildSetHomeObject(value, literal, property->value(), | |
| 1757 home_feedback); | |
| 1758 } else { | 1749 } else { |
| 1759 VisitForEffect(property->value()); | 1750 VisitForEffect(property->value()); |
| 1760 } | 1751 } |
| 1761 break; | 1752 break; |
| 1762 } | 1753 } |
| 1763 environment()->Push(literal); // Duplicate receiver. | 1754 environment()->Push(literal); // Duplicate receiver. |
| 1764 VisitForValue(property->key()); | 1755 VisitForValue(property->key()); |
| 1765 VisitForValue(property->value()); | 1756 VisitForValue(property->value()); |
| 1766 Node* value = environment()->Pop(); | 1757 Node* value = environment()->Pop(); |
| 1767 Node* key = environment()->Pop(); | 1758 Node* key = environment()->Pop(); |
| 1768 Node* receiver = environment()->Pop(); | 1759 Node* receiver = environment()->Pop(); |
| 1769 if (property->emit_store()) { | 1760 if (property->emit_store()) { |
| 1770 Node* language = jsgraph()->Constant(SLOPPY); | 1761 Node* language = jsgraph()->Constant(SLOPPY); |
| 1771 const Operator* op = | 1762 const Operator* op = |
| 1772 javascript()->CallRuntime(Runtime::kSetProperty, 4); | 1763 javascript()->CallRuntime(Runtime::kSetProperty, 4); |
| 1773 Node* set_property = NewNode(op, receiver, key, value, language); | 1764 Node* set_property = NewNode(op, receiver, key, value, language); |
| 1774 // SetProperty should not lazy deopt on an object literal. | 1765 // SetProperty should not lazy deopt on an object literal. |
| 1775 PrepareFrameState(set_property, BailoutId::None()); | 1766 PrepareFrameState(set_property, BailoutId::None()); |
| 1776 VectorSlotPair home_feedback = CreateVectorSlotPair( | 1767 BuildSetHomeObject(value, receiver, property); |
| 1777 expr->SlotForHomeObject(property->value(), &store_slot_index)); | |
| 1778 BuildSetHomeObject(value, receiver, property->value(), home_feedback); | |
| 1779 } | 1768 } |
| 1780 break; | 1769 break; |
| 1781 } | 1770 } |
| 1782 case ObjectLiteral::Property::PROTOTYPE: { | 1771 case ObjectLiteral::Property::PROTOTYPE: { |
| 1783 environment()->Push(literal); // Duplicate receiver. | 1772 environment()->Push(literal); // Duplicate receiver. |
| 1784 VisitForValue(property->value()); | 1773 VisitForValue(property->value()); |
| 1785 Node* value = environment()->Pop(); | 1774 Node* value = environment()->Pop(); |
| 1786 Node* receiver = environment()->Pop(); | 1775 Node* receiver = environment()->Pop(); |
| 1787 DCHECK(property->emit_store()); | 1776 DCHECK(property->emit_store()); |
| 1788 const Operator* op = | 1777 const Operator* op = |
| 1789 javascript()->CallRuntime(Runtime::kInternalSetPrototype, 2); | 1778 javascript()->CallRuntime(Runtime::kInternalSetPrototype, 2); |
| 1790 Node* set_prototype = NewNode(op, receiver, value); | 1779 Node* set_prototype = NewNode(op, receiver, value); |
| 1791 // SetPrototype should not lazy deopt on an object literal. | 1780 // SetPrototype should not lazy deopt on an object literal. |
| 1792 PrepareFrameState(set_prototype, BailoutId::None()); | 1781 PrepareFrameState(set_prototype, BailoutId::None()); |
| 1793 break; | 1782 break; |
| 1794 } | 1783 } |
| 1795 case ObjectLiteral::Property::GETTER: | 1784 case ObjectLiteral::Property::GETTER: |
| 1796 if (property->emit_store()) { | 1785 if (property->emit_store()) { |
| 1797 accessor_table.lookup(key)->second->getter = property->value(); | 1786 accessor_table.lookup(key)->second->getter = property; |
| 1798 } | 1787 } |
| 1799 break; | 1788 break; |
| 1800 case ObjectLiteral::Property::SETTER: | 1789 case ObjectLiteral::Property::SETTER: |
| 1801 if (property->emit_store()) { | 1790 if (property->emit_store()) { |
| 1802 accessor_table.lookup(key)->second->setter = property->value(); | 1791 accessor_table.lookup(key)->second->setter = property; |
| 1803 } | 1792 } |
| 1804 break; | 1793 break; |
| 1805 } | 1794 } |
| 1806 } | 1795 } |
| 1807 | 1796 |
| 1808 // Create nodes to define accessors, using only a single call to the runtime | 1797 // Create nodes to define accessors, using only a single call to the runtime |
| 1809 // for each pair of corresponding getters and setters. | 1798 // for each pair of corresponding getters and setters. |
| 1810 for (AccessorTable::Iterator it = accessor_table.begin(); | 1799 for (AccessorTable::Iterator it = accessor_table.begin(); |
| 1811 it != accessor_table.end(); ++it) { | 1800 it != accessor_table.end(); ++it) { |
| 1812 VisitForValue(it->first); | 1801 VisitForValue(it->first); |
| 1813 VisitForValueOrNull(it->second->getter); | 1802 VisitObjectLiteralAccessor(literal, it->second->getter); |
| 1814 VectorSlotPair feedback_getter = CreateVectorSlotPair( | 1803 VisitObjectLiteralAccessor(literal, it->second->setter); |
| 1815 expr->SlotForHomeObject(it->second->getter, &store_slot_index)); | |
| 1816 BuildSetHomeObject(environment()->Top(), literal, it->second->getter, | |
| 1817 feedback_getter); | |
| 1818 VisitForValueOrNull(it->second->setter); | |
| 1819 VectorSlotPair feedback_setter = CreateVectorSlotPair( | |
| 1820 expr->SlotForHomeObject(it->second->setter, &store_slot_index)); | |
| 1821 BuildSetHomeObject(environment()->Top(), literal, it->second->setter, | |
| 1822 feedback_setter); | |
| 1823 Node* setter = environment()->Pop(); | 1804 Node* setter = environment()->Pop(); |
| 1824 Node* getter = environment()->Pop(); | 1805 Node* getter = environment()->Pop(); |
| 1825 Node* name = environment()->Pop(); | 1806 Node* name = environment()->Pop(); |
| 1826 Node* attr = jsgraph()->Constant(NONE); | 1807 Node* attr = jsgraph()->Constant(NONE); |
| 1827 const Operator* op = | 1808 const Operator* op = |
| 1828 javascript()->CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); | 1809 javascript()->CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); |
| 1829 Node* call = NewNode(op, literal, name, getter, setter, attr); | 1810 Node* call = NewNode(op, literal, name, getter, setter, attr); |
| 1830 // This should not lazy deopt on a new literal. | 1811 // This should not lazy deopt on a new literal. |
| 1831 PrepareFrameState(call, BailoutId::None()); | 1812 PrepareFrameState(call, BailoutId::None()); |
| 1832 } | 1813 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1857 | 1838 |
| 1858 environment()->Push(literal); // Duplicate receiver. | 1839 environment()->Push(literal); // Duplicate receiver. |
| 1859 VisitForValue(property->key()); | 1840 VisitForValue(property->key()); |
| 1860 Node* name = BuildToName(environment()->Pop(), | 1841 Node* name = BuildToName(environment()->Pop(), |
| 1861 expr->GetIdForProperty(property_index)); | 1842 expr->GetIdForProperty(property_index)); |
| 1862 environment()->Push(name); | 1843 environment()->Push(name); |
| 1863 VisitForValue(property->value()); | 1844 VisitForValue(property->value()); |
| 1864 Node* value = environment()->Pop(); | 1845 Node* value = environment()->Pop(); |
| 1865 Node* key = environment()->Pop(); | 1846 Node* key = environment()->Pop(); |
| 1866 Node* receiver = environment()->Pop(); | 1847 Node* receiver = environment()->Pop(); |
| 1867 VectorSlotPair feedback = CreateVectorSlotPair( | 1848 BuildSetHomeObject(value, receiver, property); |
| 1868 expr->SlotForHomeObject(property->value(), &store_slot_index)); | |
| 1869 BuildSetHomeObject(value, receiver, property->value(), feedback); | |
| 1870 switch (property->kind()) { | 1849 switch (property->kind()) { |
| 1871 case ObjectLiteral::Property::CONSTANT: | 1850 case ObjectLiteral::Property::CONSTANT: |
| 1872 case ObjectLiteral::Property::COMPUTED: | 1851 case ObjectLiteral::Property::COMPUTED: |
| 1873 case ObjectLiteral::Property::MATERIALIZED_LITERAL: { | 1852 case ObjectLiteral::Property::MATERIALIZED_LITERAL: { |
| 1874 Node* attr = jsgraph()->Constant(NONE); | 1853 Node* attr = jsgraph()->Constant(NONE); |
| 1875 const Operator* op = | 1854 const Operator* op = |
| 1876 javascript()->CallRuntime(Runtime::kDefineDataPropertyUnchecked, 4); | 1855 javascript()->CallRuntime(Runtime::kDefineDataPropertyUnchecked, 4); |
| 1877 Node* call = NewNode(op, receiver, key, value, attr); | 1856 Node* call = NewNode(op, receiver, key, value, attr); |
| 1878 PrepareFrameState(call, BailoutId::None()); | 1857 PrepareFrameState(call, BailoutId::None()); |
| 1879 break; | 1858 break; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1900 } | 1879 } |
| 1901 } | 1880 } |
| 1902 | 1881 |
| 1903 // Transform literals that contain functions to fast properties. | 1882 // Transform literals that contain functions to fast properties. |
| 1904 if (expr->has_function()) { | 1883 if (expr->has_function()) { |
| 1905 const Operator* op = | 1884 const Operator* op = |
| 1906 javascript()->CallRuntime(Runtime::kToFastProperties, 1); | 1885 javascript()->CallRuntime(Runtime::kToFastProperties, 1); |
| 1907 NewNode(op, literal); | 1886 NewNode(op, literal); |
| 1908 } | 1887 } |
| 1909 | 1888 |
| 1910 // Verify that compilation exactly consumed the number of store ic slots that | 1889 ast_context()->ProduceValue(environment()->Pop()); |
| 1911 // the ObjectLiteral node had to offer. | 1890 } |
| 1912 DCHECK(!FLAG_vector_stores || store_slot_index == expr->slot_count()); | |
| 1913 | 1891 |
| 1914 ast_context()->ProduceValue(environment()->Pop()); | 1892 |
| 1893 void AstGraphBuilder::VisitObjectLiteralAccessor( |
| 1894 Node* home_object, ObjectLiteralProperty* property) { |
| 1895 if (property == nullptr) { |
| 1896 VisitForValueOrNull(nullptr); |
| 1897 } else { |
| 1898 VisitForValue(property->value()); |
| 1899 BuildSetHomeObject(environment()->Top(), home_object, property); |
| 1900 } |
| 1915 } | 1901 } |
| 1916 | 1902 |
| 1917 | 1903 |
| 1918 void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { | 1904 void AstGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { |
| 1919 Node* closure = GetFunctionClosure(); | 1905 Node* closure = GetFunctionClosure(); |
| 1920 | 1906 |
| 1921 // Create node to deep-copy the literal boilerplate. | 1907 // Create node to deep-copy the literal boilerplate. |
| 1922 expr->BuildConstantElements(isolate()); | 1908 expr->BuildConstantElements(isolate()); |
| 1923 Node* literals_array = | 1909 Node* literals_array = |
| 1924 BuildLoadObjectField(closure, JSFunction::kLiteralsOffset); | 1910 BuildLoadObjectField(closure, JSFunction::kLiteralsOffset); |
| (...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3801 | 3787 |
| 3802 | 3788 |
| 3803 Node* AstGraphBuilder::BuildToObject(Node* input, BailoutId bailout_id) { | 3789 Node* AstGraphBuilder::BuildToObject(Node* input, BailoutId bailout_id) { |
| 3804 Node* object = NewNode(javascript()->ToObject(), input); | 3790 Node* object = NewNode(javascript()->ToObject(), input); |
| 3805 PrepareFrameState(object, bailout_id, OutputFrameStateCombine::Push()); | 3791 PrepareFrameState(object, bailout_id, OutputFrameStateCombine::Push()); |
| 3806 return object; | 3792 return object; |
| 3807 } | 3793 } |
| 3808 | 3794 |
| 3809 | 3795 |
| 3810 Node* AstGraphBuilder::BuildSetHomeObject(Node* value, Node* home_object, | 3796 Node* AstGraphBuilder::BuildSetHomeObject(Node* value, Node* home_object, |
| 3811 Expression* expr, | 3797 ObjectLiteralProperty* property, |
| 3812 const VectorSlotPair& feedback) { | 3798 int slot_number) { |
| 3799 Expression* expr = property->value(); |
| 3813 if (!FunctionLiteral::NeedsHomeObject(expr)) return value; | 3800 if (!FunctionLiteral::NeedsHomeObject(expr)) return value; |
| 3814 Handle<Name> name = isolate()->factory()->home_object_symbol(); | 3801 Handle<Name> name = isolate()->factory()->home_object_symbol(); |
| 3815 FrameStateBeforeAndAfter states(this, BailoutId::None()); | 3802 FrameStateBeforeAndAfter states(this, BailoutId::None()); |
| 3803 VectorSlotPair feedback = |
| 3804 CreateVectorSlotPair(property->GetSlot(slot_number)); |
| 3816 Node* store = BuildNamedStore(value, name, home_object, feedback, | 3805 Node* store = BuildNamedStore(value, name, home_object, feedback, |
| 3817 TypeFeedbackId::None()); | 3806 TypeFeedbackId::None()); |
| 3818 states.AddToNode(store, BailoutId::None(), OutputFrameStateCombine::Ignore()); | 3807 states.AddToNode(store, BailoutId::None(), OutputFrameStateCombine::Ignore()); |
| 3819 return store; | 3808 return store; |
| 3820 } | 3809 } |
| 3821 | 3810 |
| 3822 | 3811 |
| 3823 Node* AstGraphBuilder::BuildThrowError(Node* exception, BailoutId bailout_id) { | 3812 Node* AstGraphBuilder::BuildThrowError(Node* exception, BailoutId bailout_id) { |
| 3824 const Operator* op = javascript()->CallRuntime(Runtime::kThrow, 1); | 3813 const Operator* op = javascript()->CallRuntime(Runtime::kThrow, 1); |
| 3825 Node* call = NewNode(op, exception); | 3814 Node* call = NewNode(op, exception); |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4261 // Phi does not exist yet, introduce one. | 4250 // Phi does not exist yet, introduce one. |
| 4262 value = NewPhi(inputs, value, control); | 4251 value = NewPhi(inputs, value, control); |
| 4263 value->ReplaceInput(inputs - 1, other); | 4252 value->ReplaceInput(inputs - 1, other); |
| 4264 } | 4253 } |
| 4265 return value; | 4254 return value; |
| 4266 } | 4255 } |
| 4267 | 4256 |
| 4268 } // namespace compiler | 4257 } // namespace compiler |
| 4269 } // namespace internal | 4258 } // namespace internal |
| 4270 } // namespace v8 | 4259 } // namespace v8 |
| OLD | NEW |