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