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

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

Issue 2302643002: Split the AST representation of class properties from object properties (Closed)
Patch Set: remove spurious classliteralproperty typedef Created 4 years, 3 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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_S390 5 #if V8_TARGET_ARCH_S390
6 6
7 #include "src/full-codegen/full-codegen.h" 7 #include "src/full-codegen/full-codegen.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after
1941 default: 1941 default:
1942 UNREACHABLE(); 1942 UNREACHABLE();
1943 } 1943 }
1944 1944
1945 __ bind(&done); 1945 __ bind(&done);
1946 context()->Plug(r2); 1946 context()->Plug(r2);
1947 } 1947 }
1948 1948
1949 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { 1949 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
1950 for (int i = 0; i < lit->properties()->length(); i++) { 1950 for (int i = 0; i < lit->properties()->length(); i++) {
1951 ObjectLiteral::Property* property = lit->properties()->at(i); 1951 ClassLiteral::Property* property = lit->properties()->at(i);
1952 Expression* value = property->value(); 1952 Expression* value = property->value();
1953 1953
1954 Register scratch = r3; 1954 Register scratch = r3;
1955 if (property->is_static()) { 1955 if (property->is_static()) {
1956 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor 1956 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor
1957 } else { 1957 } else {
1958 __ LoadP(scratch, MemOperand(sp, 0)); // prototype 1958 __ LoadP(scratch, MemOperand(sp, 0)); // prototype
1959 } 1959 }
1960 PushOperand(scratch); 1960 PushOperand(scratch);
1961 EmitPropertyKey(property, lit->GetIdForProperty(i)); 1961 EmitPropertyKey(property, lit->GetIdForProperty(i));
1962 1962
1963 // The static prototype property is read only. We handle the non computed 1963 // The static prototype property is read only. We handle the non computed
1964 // property name case in the parser. Since this is the only case where we 1964 // property name case in the parser. Since this is the only case where we
1965 // need to check for an own read only property we special case this so we do 1965 // need to check for an own read only property we special case this so we do
1966 // not need to do this for every property. 1966 // not need to do this for every property.
1967 if (property->is_static() && property->is_computed_name()) { 1967 if (property->is_static() && property->is_computed_name()) {
1968 __ CallRuntime(Runtime::kThrowIfStaticPrototype); 1968 __ CallRuntime(Runtime::kThrowIfStaticPrototype);
1969 __ push(r2); 1969 __ push(r2);
1970 } 1970 }
1971 1971
1972 VisitForStackValue(value); 1972 VisitForStackValue(value);
1973 if (NeedsHomeObject(value)) { 1973 if (NeedsHomeObject(value)) {
1974 EmitSetHomeObject(value, 2, property->GetSlot()); 1974 EmitSetHomeObject(value, 2, property->GetSlot());
1975 } 1975 }
1976 1976
1977 switch (property->kind()) { 1977 switch (property->kind()) {
1978 case ObjectLiteral::Property::CONSTANT: 1978 case ClassLiteral::Property::METHOD:
1979 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
1980 case ObjectLiteral::Property::PROTOTYPE:
1981 UNREACHABLE();
1982 case ObjectLiteral::Property::COMPUTED:
1983 PushOperand(Smi::FromInt(DONT_ENUM)); 1979 PushOperand(Smi::FromInt(DONT_ENUM));
1984 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); 1980 PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
1985 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); 1981 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
1986 break; 1982 break;
1987 1983
1988 case ObjectLiteral::Property::GETTER: 1984 case ClassLiteral::Property::GETTER:
1989 PushOperand(Smi::FromInt(DONT_ENUM)); 1985 PushOperand(Smi::FromInt(DONT_ENUM));
1990 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); 1986 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked);
1991 break; 1987 break;
1992 1988
1993 case ObjectLiteral::Property::SETTER: 1989 case ClassLiteral::Property::SETTER:
1994 PushOperand(Smi::FromInt(DONT_ENUM)); 1990 PushOperand(Smi::FromInt(DONT_ENUM));
1995 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); 1991 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked);
1996 break; 1992 break;
1997 1993
1998 default: 1994 default:
1999 UNREACHABLE(); 1995 UNREACHABLE();
2000 } 1996 }
2001 } 1997 }
2002 } 1998 }
2003 1999
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after
3643 DCHECK(kOSRBranchInstruction == br_instr); 3639 DCHECK(kOSRBranchInstruction == br_instr);
3644 3640
3645 DCHECK(interrupt_address == 3641 DCHECK(interrupt_address ==
3646 isolate->builtins()->OnStackReplacement()->entry()); 3642 isolate->builtins()->OnStackReplacement()->entry());
3647 return ON_STACK_REPLACEMENT; 3643 return ON_STACK_REPLACEMENT;
3648 } 3644 }
3649 3645
3650 } // namespace internal 3646 } // namespace internal
3651 } // namespace v8 3647 } // namespace v8
3652 #endif // V8_TARGET_ARCH_S390 3648 #endif // V8_TARGET_ARCH_S390
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698