| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1718 EmitSetHomeObjectIfNeeded(value, 2); | 1718 EmitSetHomeObjectIfNeeded(value, 2); |
| 1719 __ Mov(x0, Smi::FromInt(SLOPPY)); // Strict mode | 1719 __ Mov(x0, Smi::FromInt(SLOPPY)); // Strict mode |
| 1720 __ Push(x0); | 1720 __ Push(x0); |
| 1721 __ CallRuntime(Runtime::kSetProperty, 4); | 1721 __ CallRuntime(Runtime::kSetProperty, 4); |
| 1722 } else { | 1722 } else { |
| 1723 VisitForEffect(key); | 1723 VisitForEffect(key); |
| 1724 VisitForEffect(value); | 1724 VisitForEffect(value); |
| 1725 } | 1725 } |
| 1726 break; | 1726 break; |
| 1727 case ObjectLiteral::Property::PROTOTYPE: | 1727 case ObjectLiteral::Property::PROTOTYPE: |
| 1728 if (property->emit_store()) { | 1728 DCHECK(property->emit_store()); |
| 1729 // Duplicate receiver on stack. | 1729 // Duplicate receiver on stack. |
| 1730 __ Peek(x0, 0); | 1730 __ Peek(x0, 0); |
| 1731 __ Push(x0); | 1731 __ Push(x0); |
| 1732 VisitForStackValue(value); | 1732 VisitForStackValue(value); |
| 1733 __ CallRuntime(Runtime::kInternalSetPrototype, 2); | 1733 __ CallRuntime(Runtime::kInternalSetPrototype, 2); |
| 1734 } else { | |
| 1735 VisitForEffect(value); | |
| 1736 } | |
| 1737 break; | 1734 break; |
| 1738 case ObjectLiteral::Property::GETTER: | 1735 case ObjectLiteral::Property::GETTER: |
| 1739 accessor_table.lookup(key)->second->getter = value; | 1736 accessor_table.lookup(key)->second->getter = value; |
| 1740 break; | 1737 break; |
| 1741 case ObjectLiteral::Property::SETTER: | 1738 case ObjectLiteral::Property::SETTER: |
| 1742 accessor_table.lookup(key)->second->setter = value; | 1739 accessor_table.lookup(key)->second->setter = value; |
| 1743 break; | 1740 break; |
| 1744 } | 1741 } |
| 1745 } | 1742 } |
| 1746 | 1743 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1778 __ Push(x0); // Save result on stack | 1775 __ Push(x0); // Save result on stack |
| 1779 result_saved = true; | 1776 result_saved = true; |
| 1780 } | 1777 } |
| 1781 | 1778 |
| 1782 __ Peek(x10, 0); // Duplicate receiver. | 1779 __ Peek(x10, 0); // Duplicate receiver. |
| 1783 __ Push(x10); | 1780 __ Push(x10); |
| 1784 | 1781 |
| 1785 if (property->kind() == ObjectLiteral::Property::PROTOTYPE) { | 1782 if (property->kind() == ObjectLiteral::Property::PROTOTYPE) { |
| 1786 DCHECK(!property->is_computed_name()); | 1783 DCHECK(!property->is_computed_name()); |
| 1787 VisitForStackValue(value); | 1784 VisitForStackValue(value); |
| 1788 if (property->emit_store()) { | 1785 DCHECK(property->emit_store()); |
| 1789 __ CallRuntime(Runtime::kInternalSetPrototype, 2); | 1786 __ CallRuntime(Runtime::kInternalSetPrototype, 2); |
| 1790 } else { | |
| 1791 __ Drop(2); | |
| 1792 } | |
| 1793 } else { | 1787 } else { |
| 1794 EmitPropertyKey(property); | 1788 EmitPropertyKey(property); |
| 1795 VisitForStackValue(value); | 1789 VisitForStackValue(value); |
| 1796 | 1790 |
| 1797 switch (property->kind()) { | 1791 switch (property->kind()) { |
| 1798 case ObjectLiteral::Property::CONSTANT: | 1792 case ObjectLiteral::Property::CONSTANT: |
| 1799 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 1793 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
| 1800 case ObjectLiteral::Property::COMPUTED: | 1794 case ObjectLiteral::Property::COMPUTED: |
| 1801 if (property->emit_store()) { | 1795 if (property->emit_store()) { |
| 1802 __ Mov(x0, Smi::FromInt(NONE)); | 1796 __ Mov(x0, Smi::FromInt(NONE)); |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2247 __ Peek(scratch, 0); // prototype | 2241 __ Peek(scratch, 0); // prototype |
| 2248 } | 2242 } |
| 2249 __ Push(scratch); | 2243 __ Push(scratch); |
| 2250 EmitPropertyKey(property); | 2244 EmitPropertyKey(property); |
| 2251 VisitForStackValue(value); | 2245 VisitForStackValue(value); |
| 2252 EmitSetHomeObjectIfNeeded(value, 2); | 2246 EmitSetHomeObjectIfNeeded(value, 2); |
| 2253 | 2247 |
| 2254 switch (property->kind()) { | 2248 switch (property->kind()) { |
| 2255 case ObjectLiteral::Property::CONSTANT: | 2249 case ObjectLiteral::Property::CONSTANT: |
| 2256 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 2250 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
| 2251 case ObjectLiteral::Property::PROTOTYPE: |
| 2252 UNREACHABLE(); |
| 2257 case ObjectLiteral::Property::COMPUTED: | 2253 case ObjectLiteral::Property::COMPUTED: |
| 2258 case ObjectLiteral::Property::PROTOTYPE: | |
| 2259 __ CallRuntime(Runtime::kDefineClassMethod, 3); | 2254 __ CallRuntime(Runtime::kDefineClassMethod, 3); |
| 2260 break; | 2255 break; |
| 2261 | 2256 |
| 2262 case ObjectLiteral::Property::GETTER: | 2257 case ObjectLiteral::Property::GETTER: |
| 2263 __ CallRuntime(Runtime::kDefineGetterPropertyUnchecked, 3); | 2258 __ CallRuntime(Runtime::kDefineGetterPropertyUnchecked, 3); |
| 2264 break; | 2259 break; |
| 2265 | 2260 |
| 2266 case ObjectLiteral::Property::SETTER: | 2261 case ObjectLiteral::Property::SETTER: |
| 2267 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 3); | 2262 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 3); |
| 2268 break; | 2263 break; |
| (...skipping 3121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5390 return previous_; | 5385 return previous_; |
| 5391 } | 5386 } |
| 5392 | 5387 |
| 5393 | 5388 |
| 5394 #undef __ | 5389 #undef __ |
| 5395 | 5390 |
| 5396 | 5391 |
| 5397 } } // namespace v8::internal | 5392 } } // namespace v8::internal |
| 5398 | 5393 |
| 5399 #endif // V8_TARGET_ARCH_ARM64 | 5394 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |