Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.cc

Issue 2534463002: [fullcodegen] Remove deprecated support for class literals. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
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
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 __ ld(scratch, MemOperand(sp, kPointerSize)); // constructor
1801 } else {
1802 __ ld(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 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after
3355 reinterpret_cast<uint64_t>( 3301 reinterpret_cast<uint64_t>(
3356 isolate->builtins()->OnStackReplacement()->entry())); 3302 isolate->builtins()->OnStackReplacement()->entry()));
3357 return ON_STACK_REPLACEMENT; 3303 return ON_STACK_REPLACEMENT;
3358 } 3304 }
3359 3305
3360 3306
3361 } // namespace internal 3307 } // namespace internal
3362 } // namespace v8 3308 } // namespace v8
3363 3309
3364 #endif // V8_TARGET_ARCH_MIPS64 3310 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698