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

Side by Side Diff: src/full-codegen/arm64/full-codegen-arm64.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/arm/full-codegen-arm.cc ('k') | src/full-codegen/full-codegen.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
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 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); 1722 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
1723 JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code. 1723 JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code.
1724 { 1724 {
1725 Assembler::BlockPoolsScope scope(masm_); 1725 Assembler::BlockPoolsScope scope(masm_);
1726 CallIC(code, expr->BinaryOperationFeedbackId()); 1726 CallIC(code, expr->BinaryOperationFeedbackId());
1727 patch_site.EmitPatchInfo(); 1727 patch_site.EmitPatchInfo();
1728 } 1728 }
1729 context()->Plug(x0); 1729 context()->Plug(x0);
1730 } 1730 }
1731 1731
1732
1733 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
1734 for (int i = 0; i < lit->properties()->length(); i++) {
1735 ClassLiteral::Property* property = lit->properties()->at(i);
1736 Expression* value = property->value();
1737
1738 Register scratch = x1;
1739 if (property->is_static()) {
1740 __ Peek(scratch, kPointerSize); // constructor
1741 } else {
1742 __ Peek(scratch, 0); // prototype
1743 }
1744 PushOperand(scratch);
1745 EmitPropertyKey(property, lit->GetIdForProperty(i));
1746
1747 // The static prototype property is read only. We handle the non computed
1748 // property name case in the parser. Since this is the only case where we
1749 // need to check for an own read only property we special case this so we do
1750 // not need to do this for every property.
1751 if (property->is_static() && property->is_computed_name()) {
1752 __ CallRuntime(Runtime::kThrowIfStaticPrototype);
1753 __ Push(x0);
1754 }
1755
1756 VisitForStackValue(value);
1757 if (NeedsHomeObject(value)) {
1758 EmitSetHomeObject(value, 2, property->GetSlot());
1759 }
1760
1761 switch (property->kind()) {
1762 case ClassLiteral::Property::METHOD:
1763 PushOperand(Smi::FromInt(DONT_ENUM));
1764 PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
1765 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
1766 break;
1767
1768 case ClassLiteral::Property::GETTER:
1769 PushOperand(Smi::FromInt(DONT_ENUM));
1770 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked);
1771 break;
1772
1773 case ClassLiteral::Property::SETTER:
1774 PushOperand(Smi::FromInt(DONT_ENUM));
1775 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked);
1776 break;
1777
1778 case ClassLiteral::Property::FIELD:
1779 default:
1780 UNREACHABLE();
1781 }
1782 }
1783 }
1784
1785
1786 void FullCodeGenerator::EmitAssignment(Expression* expr, 1732 void FullCodeGenerator::EmitAssignment(Expression* expr,
1787 FeedbackVectorSlot slot) { 1733 FeedbackVectorSlot slot) {
1788 DCHECK(expr->IsValidReferenceExpressionOrThis()); 1734 DCHECK(expr->IsValidReferenceExpressionOrThis());
1789 1735
1790 Property* prop = expr->AsProperty(); 1736 Property* prop = expr->AsProperty();
1791 LhsKind assign_type = Property::GetAssignType(prop); 1737 LhsKind assign_type = Property::GetAssignType(prop);
1792 1738
1793 switch (assign_type) { 1739 switch (assign_type) {
1794 case VARIABLE: { 1740 case VARIABLE: {
1795 VariableProxy* proxy = expr->AsVariableProxy(); 1741 VariableProxy* proxy = expr->AsVariableProxy();
(...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after
3396 } 3342 }
3397 3343
3398 return INTERRUPT; 3344 return INTERRUPT;
3399 } 3345 }
3400 3346
3401 3347
3402 } // namespace internal 3348 } // namespace internal
3403 } // namespace v8 3349 } // namespace v8
3404 3350
3405 #endif // V8_TARGET_ARCH_ARM64 3351 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698