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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.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 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 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 UNREACHABLE(); 1981 UNREACHABLE();
1982 } 1982 }
1983 1983
1984 __ bind(&done); 1984 __ bind(&done);
1985 context()->Plug(v0); 1985 context()->Plug(v0);
1986 } 1986 }
1987 1987
1988 1988
1989 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { 1989 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
1990 for (int i = 0; i < lit->properties()->length(); i++) { 1990 for (int i = 0; i < lit->properties()->length(); i++) {
1991 ObjectLiteral::Property* property = lit->properties()->at(i); 1991 ClassLiteral::Property* property = lit->properties()->at(i);
1992 Expression* value = property->value(); 1992 Expression* value = property->value();
1993 1993
1994 Register scratch = a1; 1994 Register scratch = a1;
1995 if (property->is_static()) { 1995 if (property->is_static()) {
1996 __ ld(scratch, MemOperand(sp, kPointerSize)); // constructor 1996 __ ld(scratch, MemOperand(sp, kPointerSize)); // constructor
1997 } else { 1997 } else {
1998 __ ld(scratch, MemOperand(sp, 0)); // prototype 1998 __ ld(scratch, MemOperand(sp, 0)); // prototype
1999 } 1999 }
2000 PushOperand(scratch); 2000 PushOperand(scratch);
2001 EmitPropertyKey(property, lit->GetIdForProperty(i)); 2001 EmitPropertyKey(property, lit->GetIdForProperty(i));
2002 2002
2003 // The static prototype property is read only. We handle the non computed 2003 // The static prototype property is read only. We handle the non computed
2004 // property name case in the parser. Since this is the only case where we 2004 // property name case in the parser. Since this is the only case where we
2005 // need to check for an own read only property we special case this so we do 2005 // need to check for an own read only property we special case this so we do
2006 // not need to do this for every property. 2006 // not need to do this for every property.
2007 if (property->is_static() && property->is_computed_name()) { 2007 if (property->is_static() && property->is_computed_name()) {
2008 __ CallRuntime(Runtime::kThrowIfStaticPrototype); 2008 __ CallRuntime(Runtime::kThrowIfStaticPrototype);
2009 __ push(v0); 2009 __ push(v0);
2010 } 2010 }
2011 2011
2012 VisitForStackValue(value); 2012 VisitForStackValue(value);
2013 if (NeedsHomeObject(value)) { 2013 if (NeedsHomeObject(value)) {
2014 EmitSetHomeObject(value, 2, property->GetSlot()); 2014 EmitSetHomeObject(value, 2, property->GetSlot());
2015 } 2015 }
2016 2016
2017 switch (property->kind()) { 2017 switch (property->kind()) {
2018 case ObjectLiteral::Property::CONSTANT: 2018 case ClassLiteral::Property::METHOD:
2019 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
2020 case ObjectLiteral::Property::PROTOTYPE:
2021 UNREACHABLE();
2022 case ObjectLiteral::Property::COMPUTED:
2023 PushOperand(Smi::FromInt(DONT_ENUM)); 2019 PushOperand(Smi::FromInt(DONT_ENUM));
2024 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); 2020 PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
2025 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); 2021 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
2026 break; 2022 break;
2027 2023
2028 case ObjectLiteral::Property::GETTER: 2024 case ClassLiteral::Property::GETTER:
2029 PushOperand(Smi::FromInt(DONT_ENUM)); 2025 PushOperand(Smi::FromInt(DONT_ENUM));
2030 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); 2026 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked);
2031 break; 2027 break;
2032 2028
2033 case ObjectLiteral::Property::SETTER: 2029 case ClassLiteral::Property::SETTER:
2034 PushOperand(Smi::FromInt(DONT_ENUM)); 2030 PushOperand(Smi::FromInt(DONT_ENUM));
2035 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); 2031 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked);
2036 break; 2032 break;
2037 2033
2038 default: 2034 default:
2039 UNREACHABLE(); 2035 UNREACHABLE();
2040 } 2036 }
2041 } 2037 }
2042 } 2038 }
2043 2039
(...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after
3757 reinterpret_cast<uint64_t>( 3753 reinterpret_cast<uint64_t>(
3758 isolate->builtins()->OnStackReplacement()->entry())); 3754 isolate->builtins()->OnStackReplacement()->entry()));
3759 return ON_STACK_REPLACEMENT; 3755 return ON_STACK_REPLACEMENT;
3760 } 3756 }
3761 3757
3762 3758
3763 } // namespace internal 3759 } // namespace internal
3764 } // namespace v8 3760 } // namespace v8
3765 3761
3766 #endif // V8_TARGET_ARCH_MIPS64 3762 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698