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

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

Issue 2142333002: Refactor class declaration logic to the parser and runtime Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cleanup per Adam Created 4 years, 5 months 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
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/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1890 JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code. 1890 JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code.
1891 { 1891 {
1892 Assembler::BlockPoolsScope scope(masm_); 1892 Assembler::BlockPoolsScope scope(masm_);
1893 CallIC(code, expr->BinaryOperationFeedbackId()); 1893 CallIC(code, expr->BinaryOperationFeedbackId());
1894 patch_site.EmitPatchInfo(); 1894 patch_site.EmitPatchInfo();
1895 } 1895 }
1896 context()->Plug(x0); 1896 context()->Plug(x0);
1897 } 1897 }
1898 1898
1899 1899
1900 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
1901 for (int i = 0; i < lit->properties()->length(); i++) {
1902 ObjectLiteral::Property* property = lit->properties()->at(i);
1903 Expression* value = property->value();
1904
1905 Register scratch = x1;
1906 if (property->is_static()) {
1907 __ Peek(scratch, kPointerSize); // constructor
1908 } else {
1909 __ Peek(scratch, 0); // prototype
1910 }
1911 PushOperand(scratch);
1912 EmitPropertyKey(property, lit->GetIdForProperty(i));
1913
1914 // The static prototype property is read only. We handle the non computed
1915 // property name case in the parser. Since this is the only case where we
1916 // need to check for an own read only property we special case this so we do
1917 // not need to do this for every property.
1918 if (property->is_static() && property->is_computed_name()) {
1919 __ CallRuntime(Runtime::kThrowIfStaticPrototype);
1920 __ Push(x0);
1921 }
1922
1923 VisitForStackValue(value);
1924 if (NeedsHomeObject(value)) {
1925 EmitSetHomeObject(value, 2, property->GetSlot());
1926 }
1927
1928 switch (property->kind()) {
1929 case ObjectLiteral::Property::CONSTANT:
1930 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
1931 case ObjectLiteral::Property::PROTOTYPE:
1932 UNREACHABLE();
1933 case ObjectLiteral::Property::COMPUTED:
1934 PushOperand(Smi::FromInt(DONT_ENUM));
1935 PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
1936 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
1937 break;
1938
1939 case ObjectLiteral::Property::GETTER:
1940 PushOperand(Smi::FromInt(DONT_ENUM));
1941 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked);
1942 break;
1943
1944 case ObjectLiteral::Property::SETTER:
1945 PushOperand(Smi::FromInt(DONT_ENUM));
1946 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked);
1947 break;
1948
1949 default:
1950 UNREACHABLE();
1951 }
1952 }
1953 }
1954
1955
1956 void FullCodeGenerator::EmitAssignment(Expression* expr, 1900 void FullCodeGenerator::EmitAssignment(Expression* expr,
1957 FeedbackVectorSlot slot) { 1901 FeedbackVectorSlot slot) {
1958 DCHECK(expr->IsValidReferenceExpressionOrThis()); 1902 DCHECK(expr->IsValidReferenceExpressionOrThis());
1959 1903
1960 Property* prop = expr->AsProperty(); 1904 Property* prop = expr->AsProperty();
1961 LhsKind assign_type = Property::GetAssignType(prop); 1905 LhsKind assign_type = Property::GetAssignType(prop);
1962 1906
1963 switch (assign_type) { 1907 switch (assign_type) {
1964 case VARIABLE: { 1908 case VARIABLE: {
1965 Variable* var = expr->AsVariableProxy()->var(); 1909 Variable* var = expr->AsVariableProxy()->var();
(...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after
3847 } 3791 }
3848 3792
3849 return INTERRUPT; 3793 return INTERRUPT;
3850 } 3794 }
3851 3795
3852 3796
3853 } // namespace internal 3797 } // namespace internal
3854 } // namespace v8 3798 } // namespace v8
3855 3799
3856 #endif // V8_TARGET_ARCH_ARM64 3800 #endif // V8_TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698