| 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 #if V8_TARGET_ARCH_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| (...skipping 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1782 __ Xor(v0, left, Operand(right)); | 1782 __ Xor(v0, left, Operand(right)); |
| 1783 break; | 1783 break; |
| 1784 default: | 1784 default: |
| 1785 UNREACHABLE(); | 1785 UNREACHABLE(); |
| 1786 } | 1786 } |
| 1787 | 1787 |
| 1788 __ bind(&done); | 1788 __ bind(&done); |
| 1789 context()->Plug(v0); | 1789 context()->Plug(v0); |
| 1790 } | 1790 } |
| 1791 | 1791 |
| 1792 | |
| 1793 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { | |
| 1794 for (int i = 0; i < lit->properties()->length(); i++) { | |
| 1795 ClassLiteral::Property* property = lit->properties()->at(i); | |
| 1796 Expression* value = property->value(); | |
| 1797 | |
| 1798 Register scratch = a1; | |
| 1799 if (property->is_static()) { | |
| 1800 __ lw(scratch, MemOperand(sp, kPointerSize)); // constructor | |
| 1801 } else { | |
| 1802 __ lw(scratch, MemOperand(sp, 0)); // prototype | |
| 1803 } | |
| 1804 PushOperand(scratch); | |
| 1805 EmitPropertyKey(property, lit->GetIdForProperty(i)); | |
| 1806 | |
| 1807 // The static prototype property is read only. We handle the non computed | |
| 1808 // property name case in the parser. Since this is the only case where we | |
| 1809 // need to check for an own read only property we special case this so we do | |
| 1810 // not need to do this for every property. | |
| 1811 if (property->is_static() && property->is_computed_name()) { | |
| 1812 __ CallRuntime(Runtime::kThrowIfStaticPrototype); | |
| 1813 __ push(v0); | |
| 1814 } | |
| 1815 | |
| 1816 VisitForStackValue(value); | |
| 1817 if (NeedsHomeObject(value)) { | |
| 1818 EmitSetHomeObject(value, 2, property->GetSlot()); | |
| 1819 } | |
| 1820 | |
| 1821 switch (property->kind()) { | |
| 1822 case ClassLiteral::Property::METHOD: | |
| 1823 PushOperand(Smi::FromInt(DONT_ENUM)); | |
| 1824 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); | |
| 1825 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); | |
| 1826 break; | |
| 1827 | |
| 1828 case ClassLiteral::Property::GETTER: | |
| 1829 PushOperand(Smi::FromInt(DONT_ENUM)); | |
| 1830 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); | |
| 1831 break; | |
| 1832 | |
| 1833 case ClassLiteral::Property::SETTER: | |
| 1834 PushOperand(Smi::FromInt(DONT_ENUM)); | |
| 1835 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); | |
| 1836 break; | |
| 1837 | |
| 1838 case ClassLiteral::Property::FIELD: | |
| 1839 default: | |
| 1840 UNREACHABLE(); | |
| 1841 } | |
| 1842 } | |
| 1843 } | |
| 1844 | |
| 1845 | |
| 1846 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 1792 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 1847 __ mov(a0, result_register()); | 1793 __ mov(a0, result_register()); |
| 1848 PopOperand(a1); | 1794 PopOperand(a1); |
| 1849 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); | 1795 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
| 1850 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 1796 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 1851 CallIC(code, expr->BinaryOperationFeedbackId()); | 1797 CallIC(code, expr->BinaryOperationFeedbackId()); |
| 1852 patch_site.EmitPatchInfo(); | 1798 patch_site.EmitPatchInfo(); |
| 1853 context()->Plug(v0); | 1799 context()->Plug(v0); |
| 1854 } | 1800 } |
| 1855 | 1801 |
| (...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3348 reinterpret_cast<uint32_t>( | 3294 reinterpret_cast<uint32_t>( |
| 3349 isolate->builtins()->OnStackReplacement()->entry())); | 3295 isolate->builtins()->OnStackReplacement()->entry())); |
| 3350 return ON_STACK_REPLACEMENT; | 3296 return ON_STACK_REPLACEMENT; |
| 3351 } | 3297 } |
| 3352 | 3298 |
| 3353 | 3299 |
| 3354 } // namespace internal | 3300 } // namespace internal |
| 3355 } // namespace v8 | 3301 } // namespace v8 |
| 3356 | 3302 |
| 3357 #endif // V8_TARGET_ARCH_MIPS | 3303 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |