| 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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
| 8 | 8 |
| 9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
| 10 // | 10 // |
| (...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1318 CallLoadIC(NOT_CONTEXTUAL, expr->HomeObjectFeedbackId()); | 1318 CallLoadIC(NOT_CONTEXTUAL, expr->HomeObjectFeedbackId()); |
| 1319 } | 1319 } |
| 1320 | 1320 |
| 1321 Label done; | 1321 Label done; |
| 1322 __ Branch(&done, ne, v0, Operand(isolate()->factory()->undefined_value())); | 1322 __ Branch(&done, ne, v0, Operand(isolate()->factory()->undefined_value())); |
| 1323 __ CallRuntime(Runtime::kThrowNonMethodError, 0); | 1323 __ CallRuntime(Runtime::kThrowNonMethodError, 0); |
| 1324 __ bind(&done); | 1324 __ bind(&done); |
| 1325 } | 1325 } |
| 1326 | 1326 |
| 1327 | 1327 |
| 1328 void FullCodeGenerator::EmitSetHomeObjectIfNeeded(Expression* initializer, |
| 1329 int offset) { |
| 1330 if (NeedsHomeObject(initializer)) { |
| 1331 __ ld(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
| 1332 __ li(StoreDescriptor::NameRegister(), |
| 1333 Operand(isolate()->factory()->home_object_symbol())); |
| 1334 __ ld(StoreDescriptor::ValueRegister(), |
| 1335 MemOperand(sp, offset * kPointerSize)); |
| 1336 CallStoreIC(); |
| 1337 } |
| 1338 } |
| 1339 |
| 1340 |
| 1328 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, | 1341 void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy, |
| 1329 TypeofState typeof_state, | 1342 TypeofState typeof_state, |
| 1330 Label* slow) { | 1343 Label* slow) { |
| 1331 Register current = cp; | 1344 Register current = cp; |
| 1332 Register next = a1; | 1345 Register next = a1; |
| 1333 Register temp = a2; | 1346 Register temp = a2; |
| 1334 | 1347 |
| 1335 Scope* s = scope(); | 1348 Scope* s = scope(); |
| 1336 while (s != NULL) { | 1349 while (s != NULL) { |
| 1337 if (s->num_heap_slots() > 0) { | 1350 if (s->num_heap_slots() > 0) { |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 // contains computed properties with an uninitialized value. | 1689 // contains computed properties with an uninitialized value. |
| 1677 if (key->value()->IsInternalizedString()) { | 1690 if (key->value()->IsInternalizedString()) { |
| 1678 if (property->emit_store()) { | 1691 if (property->emit_store()) { |
| 1679 VisitForAccumulatorValue(value); | 1692 VisitForAccumulatorValue(value); |
| 1680 __ mov(StoreDescriptor::ValueRegister(), result_register()); | 1693 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
| 1681 DCHECK(StoreDescriptor::ValueRegister().is(a0)); | 1694 DCHECK(StoreDescriptor::ValueRegister().is(a0)); |
| 1682 __ li(StoreDescriptor::NameRegister(), Operand(key->value())); | 1695 __ li(StoreDescriptor::NameRegister(), Operand(key->value())); |
| 1683 __ ld(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); | 1696 __ ld(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
| 1684 CallStoreIC(key->LiteralFeedbackId()); | 1697 CallStoreIC(key->LiteralFeedbackId()); |
| 1685 PrepareForBailoutForId(key->id(), NO_REGISTERS); | 1698 PrepareForBailoutForId(key->id(), NO_REGISTERS); |
| 1699 |
| 1700 if (NeedsHomeObject(value)) { |
| 1701 __ Move(StoreDescriptor::ReceiverRegister(), v0); |
| 1702 __ li(StoreDescriptor::NameRegister(), |
| 1703 Operand(isolate()->factory()->home_object_symbol())); |
| 1704 __ ld(StoreDescriptor::ValueRegister(), MemOperand(sp)); |
| 1705 CallStoreIC(); |
| 1706 } |
| 1686 } else { | 1707 } else { |
| 1687 VisitForEffect(value); | 1708 VisitForEffect(value); |
| 1688 } | 1709 } |
| 1689 break; | 1710 break; |
| 1690 } | 1711 } |
| 1691 // Duplicate receiver on stack. | 1712 // Duplicate receiver on stack. |
| 1692 __ ld(a0, MemOperand(sp)); | 1713 __ ld(a0, MemOperand(sp)); |
| 1693 __ push(a0); | 1714 __ push(a0); |
| 1694 VisitForStackValue(key); | 1715 VisitForStackValue(key); |
| 1695 VisitForStackValue(value); | 1716 VisitForStackValue(value); |
| 1696 if (property->emit_store()) { | 1717 if (property->emit_store()) { |
| 1718 EmitSetHomeObjectIfNeeded(value, 2); |
| 1697 __ li(a0, Operand(Smi::FromInt(SLOPPY))); // PropertyAttributes. | 1719 __ li(a0, Operand(Smi::FromInt(SLOPPY))); // PropertyAttributes. |
| 1698 __ push(a0); | 1720 __ push(a0); |
| 1699 __ CallRuntime(Runtime::kSetProperty, 4); | 1721 __ CallRuntime(Runtime::kSetProperty, 4); |
| 1700 } else { | 1722 } else { |
| 1701 __ Drop(3); | 1723 __ Drop(3); |
| 1702 } | 1724 } |
| 1703 break; | 1725 break; |
| 1704 case ObjectLiteral::Property::PROTOTYPE: | 1726 case ObjectLiteral::Property::PROTOTYPE: |
| 1705 // Duplicate receiver on stack. | 1727 // Duplicate receiver on stack. |
| 1706 __ ld(a0, MemOperand(sp)); | 1728 __ ld(a0, MemOperand(sp)); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1723 | 1745 |
| 1724 // Emit code to define accessors, using only a single call to the runtime for | 1746 // Emit code to define accessors, using only a single call to the runtime for |
| 1725 // each pair of corresponding getters and setters. | 1747 // each pair of corresponding getters and setters. |
| 1726 for (AccessorTable::Iterator it = accessor_table.begin(); | 1748 for (AccessorTable::Iterator it = accessor_table.begin(); |
| 1727 it != accessor_table.end(); | 1749 it != accessor_table.end(); |
| 1728 ++it) { | 1750 ++it) { |
| 1729 __ ld(a0, MemOperand(sp)); // Duplicate receiver. | 1751 __ ld(a0, MemOperand(sp)); // Duplicate receiver. |
| 1730 __ push(a0); | 1752 __ push(a0); |
| 1731 VisitForStackValue(it->first); | 1753 VisitForStackValue(it->first); |
| 1732 EmitAccessor(it->second->getter); | 1754 EmitAccessor(it->second->getter); |
| 1755 EmitSetHomeObjectIfNeeded(it->second->getter, 2); |
| 1733 EmitAccessor(it->second->setter); | 1756 EmitAccessor(it->second->setter); |
| 1757 EmitSetHomeObjectIfNeeded(it->second->setter, 3); |
| 1734 __ li(a0, Operand(Smi::FromInt(NONE))); | 1758 __ li(a0, Operand(Smi::FromInt(NONE))); |
| 1735 __ push(a0); | 1759 __ push(a0); |
| 1736 __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); | 1760 __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5); |
| 1737 } | 1761 } |
| 1738 | 1762 |
| 1739 if (expr->has_function()) { | 1763 if (expr->has_function()) { |
| 1740 DCHECK(result_saved); | 1764 DCHECK(result_saved); |
| 1741 __ ld(a0, MemOperand(sp)); | 1765 __ ld(a0, MemOperand(sp)); |
| 1742 __ push(a0); | 1766 __ push(a0); |
| 1743 __ CallRuntime(Runtime::kToFastProperties, 1); | 1767 __ CallRuntime(Runtime::kToFastProperties, 1); |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2462 DCHECK(key != NULL); | 2486 DCHECK(key != NULL); |
| 2463 | 2487 |
| 2464 if (property->is_static()) { | 2488 if (property->is_static()) { |
| 2465 __ ld(scratch, MemOperand(sp, kPointerSize)); // constructor | 2489 __ ld(scratch, MemOperand(sp, kPointerSize)); // constructor |
| 2466 } else { | 2490 } else { |
| 2467 __ ld(scratch, MemOperand(sp, 0)); // prototype | 2491 __ ld(scratch, MemOperand(sp, 0)); // prototype |
| 2468 } | 2492 } |
| 2469 __ push(scratch); | 2493 __ push(scratch); |
| 2470 VisitForStackValue(key); | 2494 VisitForStackValue(key); |
| 2471 VisitForStackValue(value); | 2495 VisitForStackValue(value); |
| 2496 EmitSetHomeObjectIfNeeded(value, 2); |
| 2472 | 2497 |
| 2473 switch (property->kind()) { | 2498 switch (property->kind()) { |
| 2474 case ObjectLiteral::Property::CONSTANT: | 2499 case ObjectLiteral::Property::CONSTANT: |
| 2475 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | 2500 case ObjectLiteral::Property::MATERIALIZED_LITERAL: |
| 2476 case ObjectLiteral::Property::COMPUTED: | 2501 case ObjectLiteral::Property::COMPUTED: |
| 2477 case ObjectLiteral::Property::PROTOTYPE: | 2502 case ObjectLiteral::Property::PROTOTYPE: |
| 2478 __ CallRuntime(Runtime::kDefineClassMethod, 3); | 2503 __ CallRuntime(Runtime::kDefineClassMethod, 3); |
| 2479 break; | 2504 break; |
| 2480 | 2505 |
| 2481 case ObjectLiteral::Property::GETTER: | 2506 case ObjectLiteral::Property::GETTER: |
| (...skipping 2762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5244 Assembler::target_address_at(pc_immediate_load_address)) == | 5269 Assembler::target_address_at(pc_immediate_load_address)) == |
| 5245 reinterpret_cast<uint64_t>( | 5270 reinterpret_cast<uint64_t>( |
| 5246 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5271 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5247 return OSR_AFTER_STACK_CHECK; | 5272 return OSR_AFTER_STACK_CHECK; |
| 5248 } | 5273 } |
| 5249 | 5274 |
| 5250 | 5275 |
| 5251 } } // namespace v8::internal | 5276 } } // namespace v8::internal |
| 5252 | 5277 |
| 5253 #endif // V8_TARGET_ARCH_MIPS64 | 5278 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |