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 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1785 __ xor_(right, left, right); | 1785 __ xor_(right, left, right); |
1786 break; | 1786 break; |
1787 default: | 1787 default: |
1788 UNREACHABLE(); | 1788 UNREACHABLE(); |
1789 } | 1789 } |
1790 | 1790 |
1791 __ bind(&done); | 1791 __ bind(&done); |
1792 context()->Plug(r3); | 1792 context()->Plug(r3); |
1793 } | 1793 } |
1794 | 1794 |
1795 | |
1796 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { | |
1797 for (int i = 0; i < lit->properties()->length(); i++) { | |
1798 ClassLiteral::Property* property = lit->properties()->at(i); | |
1799 Expression* value = property->value(); | |
1800 | |
1801 Register scratch = r4; | |
1802 if (property->is_static()) { | |
1803 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor | |
1804 } else { | |
1805 __ LoadP(scratch, MemOperand(sp, 0)); // prototype | |
1806 } | |
1807 PushOperand(scratch); | |
1808 EmitPropertyKey(property, lit->GetIdForProperty(i)); | |
1809 | |
1810 // The static prototype property is read only. We handle the non computed | |
1811 // property name case in the parser. Since this is the only case where we | |
1812 // need to check for an own read only property we special case this so we do | |
1813 // not need to do this for every property. | |
1814 if (property->is_static() && property->is_computed_name()) { | |
1815 __ CallRuntime(Runtime::kThrowIfStaticPrototype); | |
1816 __ push(r3); | |
1817 } | |
1818 | |
1819 VisitForStackValue(value); | |
1820 if (NeedsHomeObject(value)) { | |
1821 EmitSetHomeObject(value, 2, property->GetSlot()); | |
1822 } | |
1823 | |
1824 switch (property->kind()) { | |
1825 case ClassLiteral::Property::METHOD: | |
1826 PushOperand(Smi::FromInt(DONT_ENUM)); | |
1827 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); | |
1828 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); | |
1829 break; | |
1830 | |
1831 case ClassLiteral::Property::GETTER: | |
1832 PushOperand(Smi::FromInt(DONT_ENUM)); | |
1833 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); | |
1834 break; | |
1835 | |
1836 case ClassLiteral::Property::SETTER: | |
1837 PushOperand(Smi::FromInt(DONT_ENUM)); | |
1838 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); | |
1839 break; | |
1840 | |
1841 case ClassLiteral::Property::FIELD: | |
1842 default: | |
1843 UNREACHABLE(); | |
1844 } | |
1845 } | |
1846 } | |
1847 | |
1848 | |
1849 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 1795 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
1850 PopOperand(r4); | 1796 PopOperand(r4); |
1851 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); | 1797 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
1852 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 1798 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
1853 CallIC(code, expr->BinaryOperationFeedbackId()); | 1799 CallIC(code, expr->BinaryOperationFeedbackId()); |
1854 patch_site.EmitPatchInfo(); | 1800 patch_site.EmitPatchInfo(); |
1855 context()->Plug(r3); | 1801 context()->Plug(r3); |
1856 } | 1802 } |
1857 | 1803 |
1858 | 1804 |
(...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3329 | 3275 |
3330 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3276 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
3331 | 3277 |
3332 DCHECK(interrupt_address == | 3278 DCHECK(interrupt_address == |
3333 isolate->builtins()->OnStackReplacement()->entry()); | 3279 isolate->builtins()->OnStackReplacement()->entry()); |
3334 return ON_STACK_REPLACEMENT; | 3280 return ON_STACK_REPLACEMENT; |
3335 } | 3281 } |
3336 } // namespace internal | 3282 } // namespace internal |
3337 } // namespace v8 | 3283 } // namespace v8 |
3338 #endif // V8_TARGET_ARCH_PPC | 3284 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |