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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.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/compiler/ast-graph-builder.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.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_ARM 5 #if V8_TARGET_ARCH_ARM
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 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 __ eor(right, left, Operand(right)); 1773 __ eor(right, left, Operand(right));
1774 break; 1774 break;
1775 default: 1775 default:
1776 UNREACHABLE(); 1776 UNREACHABLE();
1777 } 1777 }
1778 1778
1779 __ bind(&done); 1779 __ bind(&done);
1780 context()->Plug(r0); 1780 context()->Plug(r0);
1781 } 1781 }
1782 1782
1783
1784 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
1785 for (int i = 0; i < lit->properties()->length(); i++) {
1786 ClassLiteral::Property* property = lit->properties()->at(i);
1787 Expression* value = property->value();
1788
1789 Register scratch = r1;
1790 if (property->is_static()) {
1791 __ ldr(scratch, MemOperand(sp, kPointerSize)); // constructor
1792 } else {
1793 __ ldr(scratch, MemOperand(sp, 0)); // prototype
1794 }
1795 PushOperand(scratch);
1796 EmitPropertyKey(property, lit->GetIdForProperty(i));
1797
1798 // The static prototype property is read only. We handle the non computed
1799 // property name case in the parser. Since this is the only case where we
1800 // need to check for an own read only property we special case this so we do
1801 // not need to do this for every property.
1802 if (property->is_static() && property->is_computed_name()) {
1803 __ CallRuntime(Runtime::kThrowIfStaticPrototype);
1804 __ push(r0);
1805 }
1806
1807 VisitForStackValue(value);
1808 if (NeedsHomeObject(value)) {
1809 EmitSetHomeObject(value, 2, property->GetSlot());
1810 }
1811
1812 switch (property->kind()) {
1813 case ClassLiteral::Property::METHOD:
1814 PushOperand(Smi::FromInt(DONT_ENUM));
1815 PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
1816 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
1817 break;
1818
1819 case ClassLiteral::Property::GETTER:
1820 PushOperand(Smi::FromInt(DONT_ENUM));
1821 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked);
1822 break;
1823
1824 case ClassLiteral::Property::SETTER:
1825 PushOperand(Smi::FromInt(DONT_ENUM));
1826 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked);
1827 break;
1828
1829 case ClassLiteral::Property::FIELD:
1830 default:
1831 UNREACHABLE();
1832 }
1833 }
1834 }
1835
1836
1837 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { 1783 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
1838 PopOperand(r1); 1784 PopOperand(r1);
1839 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); 1785 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
1840 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 1786 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
1841 CallIC(code, expr->BinaryOperationFeedbackId()); 1787 CallIC(code, expr->BinaryOperationFeedbackId());
1842 patch_site.EmitPatchInfo(); 1788 patch_site.EmitPatchInfo();
1843 context()->Plug(r0); 1789 context()->Plug(r0);
1844 } 1790 }
1845 1791
1846 1792
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after
3399 DCHECK(interrupt_address == 3345 DCHECK(interrupt_address ==
3400 isolate->builtins()->OnStackReplacement()->entry()); 3346 isolate->builtins()->OnStackReplacement()->entry());
3401 return ON_STACK_REPLACEMENT; 3347 return ON_STACK_REPLACEMENT;
3402 } 3348 }
3403 3349
3404 3350
3405 } // namespace internal 3351 } // namespace internal
3406 } // namespace v8 3352 } // namespace v8
3407 3353
3408 #endif // V8_TARGET_ARCH_ARM 3354 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698