| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM | 7 #if V8_TARGET_ARCH_ARM |
| 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 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 } | 1376 } |
| 1377 | 1377 |
| 1378 __ cmp(r0, Operand(isolate()->factory()->undefined_value())); | 1378 __ cmp(r0, Operand(isolate()->factory()->undefined_value())); |
| 1379 Label done; | 1379 Label done; |
| 1380 __ b(ne, &done); | 1380 __ b(ne, &done); |
| 1381 __ CallRuntime(Runtime::kThrowNonMethodError, 0); | 1381 __ CallRuntime(Runtime::kThrowNonMethodError, 0); |
| 1382 __ bind(&done); | 1382 __ bind(&done); |
| 1383 } | 1383 } |
| 1384 | 1384 |
| 1385 | 1385 |
| 1386 void FullCodeGenerator::EmitSetHomeObjectIfNeeded(Expression* initializer, |
| 1387 int offset) { |
| 1388 if (NeedsHomeObject(initializer)) { |
| 1389 __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
| 1390 __ mov(StoreDescriptor::NameRegister(), |
| 1391 Operand(isolate()->factory()->home_object_symbol())); |
| 1392 __ ldr(StoreDescriptor::ValueRegister(), |
| 1393 MemOperand(sp, offset * kPointerSize)); |
| 1394 CallStoreIC(); |
| 1395 } |
| 1396 } |
| 1397 |
| 1398 |
| 1386 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, | 1399 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
| 1387 TypeofState typeof_state, | 1400 TypeofState typeof_state, |
| 1388 Label* slow) { | 1401 Label* slow) { |
| 1389 Register current = cp; | 1402 Register current = cp; |
| 1390 Register next = r1; | 1403 Register next = r1; |
| 1391 Register temp = r2; | 1404 Register temp = r2; |
| 1392 | 1405 |
| 1393 Scope* s = scope(); | 1406 Scope* s = scope(); |
| 1394 while (s != NULL) { | 1407 while (s != NULL) { |
| 1395 if (s->num_heap_slots() > 0) { | 1408 if (s->num_heap_slots() > 0) { |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1732 // It is safe to use [[Put]] here because the boilerplate already | 1745 // It is safe to use [[Put]] here because the boilerplate already |
| 1733 // contains computed properties with an uninitialized value. | 1746 // contains computed properties with an uninitialized value. |
| 1734 if (key->value()->IsInternalizedString()) { | 1747 if (key->value()->IsInternalizedString()) { |
| 1735 if (property->emit_store()) { | 1748 if (property->emit_store()) { |
| 1736 VisitForAccumulatorValue(value); | 1749 VisitForAccumulatorValue(value); |
| 1737 DCHECK(StoreDescriptor::ValueRegister().is(r0)); | 1750 DCHECK(StoreDescriptor::ValueRegister().is(r0)); |
| 1738 __ mov(StoreDescriptor::NameRegister(), Operand(key->value())); | 1751 __ mov(StoreDescriptor::NameRegister(), Operand(key->value())); |
| 1739 __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); | 1752 __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
| 1740 CallStoreIC(key->LiteralFeedbackId()); | 1753 CallStoreIC(key->LiteralFeedbackId()); |
| 1741 PrepareForBailoutForId(key->id(), NO_REGISTERS); | 1754 PrepareForBailoutForId(key->id(), NO_REGISTERS); |
| 1755 |
| 1756 if (NeedsHomeObject(value)) { |
| 1757 __ Move(StoreDescriptor::ReceiverRegister(), r0); |
| 1758 __ mov(StoreDescriptor::NameRegister(), |
| 1759 Operand(isolate()->factory()->home_object_symbol())); |
| 1760 __ ldr(StoreDescriptor::ValueRegister(), MemOperand(sp)); |
| 1761 CallStoreIC(); |
| 1762 } |
| 1742 } else { | 1763 } else { |
| 1743 VisitForEffect(value); | 1764 VisitForEffect(value); |
| 1744 } | 1765 } |
| 1745 break; | 1766 break; |
| 1746 } | 1767 } |
| 1747 // Duplicate receiver on stack. | 1768 // Duplicate receiver on stack. |
| 1748 __ ldr(r0, MemOperand(sp)); | 1769 __ ldr(r0, MemOperand(sp)); |
| 1749 __ push(r0); | 1770 __ push(r0); |
| 1750 VisitForStackValue(key); | 1771 VisitForStackValue(key); |
| 1751 VisitForStackValue(value); | 1772 VisitForStackValue(value); |
| 1752 if (property->emit_store()) { | 1773 if (property->emit_store()) { |
| 1774 EmitSetHomeObjectIfNeeded(value, 2); |
| 1753 __ mov(r0, Operand(Smi::FromInt(SLOPPY))); // PropertyAttributes | 1775 __ mov(r0, Operand(Smi::FromInt(SLOPPY))); // PropertyAttributes |
| 1754 __ push(r0); | 1776 __ push(r0); |
| 1755 __ CallRuntime(Runtime::kSetProperty, 4); | 1777 __ CallRuntime(Runtime::kSetProperty, 4); |
| 1756 } else { | 1778 } else { |
| 1757 __ Drop(3); | 1779 __ Drop(3); |
| 1758 } | 1780 } |
| 1759 break; | 1781 break; |
| 1760 case ObjectLiteral::Property::PROTOTYPE: | 1782 case ObjectLiteral::Property::PROTOTYPE: |
| 1761 // Duplicate receiver on stack. | 1783 // Duplicate receiver on stack. |
| 1762 __ ldr(r0, MemOperand(sp)); | 1784 __ ldr(r0, MemOperand(sp)); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1780 | 1802 |
| 1781 // Emit code to define accessors, using only a single call to the runtime for | 1803 // Emit code to define accessors, using only a single call to the runtime for |
| 1782 // each pair of corresponding getters and setters. | 1804 // each pair of corresponding getters and setters. |
| 1783 for (AccessorTable::Iterator it = accessor_table.begin(); | 1805 for (AccessorTable::Iterator it = accessor_table.begin(); |
| 1784 it != accessor_table.end(); | 1806 it != accessor_table.end(); |
| 1785 ++it) { | 1807 ++it) { |
| 1786 __ ldr(r0, MemOperand(sp)); // Duplicate receiver. | 1808 __ ldr(r0, MemOperand(sp)); // Duplicate receiver. |
| 1787 __ push(r0); | 1809 __ push(r0); |
| 1788 VisitForStackValue(it->first); | 1810 VisitForStackValue(it->first); |
| 1789 EmitAccessor(it->second->getter); | 1811 EmitAccessor(it->second->getter); |
| 1812 EmitSetHomeObjectIfNeeded(it->second->getter, 2); |
| 1790 EmitAccessor(it->second->setter); | 1813 EmitAccessor(it->second->setter); |
| 1814 EmitSetHomeObjectIfNeeded(it->second->setter, 3); |
| 1791 __ mov(r0, Operand(Smi::FromInt(NONE))); | 1815 __ mov(r0, Operand(Smi::FromInt(NONE))); |
| 1792 __ push(r0); | 1816 __ push(r0); |
| 1793 __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); | 1817 __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); |
| 1794 } | 1818 } |
| 1795 | 1819 |
| 1796 if (expr->has_function()) { | 1820 if (expr->has_function()) { |
| 1797 DCHECK(result_saved); | 1821 DCHECK(result_saved); |
| 1798 __ ldr(r0, MemOperand(sp)); | 1822 __ ldr(r0, MemOperand(sp)); |
| 1799 __ push(r0); | 1823 __ push(r0); |
| 1800 __ CallRuntime(Runtime::kToFastProperties, 1); | 1824 __ CallRuntime(Runtime::kToFastProperties, 1); |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2527 DCHECK(key != NULL); | 2551 DCHECK(key != NULL); |
| 2528 | 2552 |
| 2529 if (property->is_static()) { | 2553 if (property->is_static()) { |
| 2530 __ ldr(scratch, MemOperand(sp, kPointerSize)); // constructor | 2554 __ ldr(scratch, MemOperand(sp, kPointerSize)); // constructor |
| 2531 } else { | 2555 } else { |
| 2532 __ ldr(scratch, MemOperand(sp, 0)); // prototype | 2556 __ ldr(scratch, MemOperand(sp, 0)); // prototype |
| 2533 } | 2557 } |
| 2534 __ push(scratch); | 2558 __ push(scratch); |
| 2535 VisitForStackValue(key); | 2559 VisitForStackValue(key); |
| 2536 VisitForStackValue(value); | 2560 VisitForStackValue(value); |
| 2561 EmitSetHomeObjectIfNeeded(value, 2); |
| 2537 | 2562 |
| 2538 switch (property->kind()) { | 2563 switch (property->kind()) { |
| 2539 case ObjectLiteral::Property::CONSTANT: | 2564 case ObjectLiteral::Property::CONSTANT: |
| 2540 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 2565 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
| 2541 case ObjectLiteral::Property::COMPUTED: | 2566 case ObjectLiteral::Property::COMPUTED: |
| 2542 case ObjectLiteral::Property::PROTOTYPE: | 2567 case ObjectLiteral::Property::PROTOTYPE: |
| 2543 __ CallRuntime(Runtime::kDefineClassMethod, 3); | 2568 __ CallRuntime(Runtime::kDefineClassMethod, 3); |
| 2544 break; | 2569 break; |
| 2545 | 2570 |
| 2546 case ObjectLiteral::Property::GETTER: | 2571 case ObjectLiteral::Property::GETTER: |
| (...skipping 2794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5341 | 5366 |
| 5342 DCHECK(interrupt_address == | 5367 DCHECK(interrupt_address == |
| 5343 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5368 isolate->builtins()->OsrAfterStackCheck()->entry()); |
| 5344 return OSR_AFTER_STACK_CHECK; | 5369 return OSR_AFTER_STACK_CHECK; |
| 5345 } | 5370 } |
| 5346 | 5371 |
| 5347 | 5372 |
| 5348 } } // namespace v8::internal | 5373 } } // namespace v8::internal |
| 5349 | 5374 |
| 5350 #endif // V8_TARGET_ARCH_ARM | 5375 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |