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

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

Issue 2330473002: Class fields, part 3 (backends)
Patch Set: clean up test properly 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 1971 matching lines...) Expand 10 before | Expand all | Expand 10 after
1982 __ bind(&done); 1982 __ bind(&done);
1983 context()->Plug(v0); 1983 context()->Plug(v0);
1984 } 1984 }
1985 1985
1986 1986
1987 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { 1987 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
1988 for (int i = 0; i < lit->properties()->length(); i++) { 1988 for (int i = 0; i < lit->properties()->length(); i++) {
1989 ClassLiteral::Property* property = lit->properties()->at(i); 1989 ClassLiteral::Property* property = lit->properties()->at(i);
1990 Expression* value = property->value(); 1990 Expression* value = property->value();
1991 1991
1992 if (property->kind() == ClassLiteral::Property::FIELD &&
1993 !property->is_static()) {
1994 // This just does the ToName call on the field name and stores it in a
1995 // variable (a proxy for which is the value() of this property)
1996 DCHECK(property->value()->IsVariableProxy());
1997 Variable* variable = property->value()->AsVariableProxy()->var();
1998 VisitForStackValue(property->key());
1999 EmitVariableAssignment(variable, Token::INIT,
2000 FeedbackVectorSlot::Invalid());
2001 DropOperands(1);
2002 continue;
2003 }
2004
1992 Register scratch = a1; 2005 Register scratch = a1;
1993 if (property->is_static()) { 2006 if (property->is_static()) {
1994 __ ld(scratch, MemOperand(sp, kPointerSize)); // constructor 2007 __ ld(scratch, MemOperand(sp, kPointerSize)); // constructor
1995 } else { 2008 } else {
1996 __ ld(scratch, MemOperand(sp, 0)); // prototype 2009 __ ld(scratch, MemOperand(sp, 0)); // prototype
1997 } 2010 }
1998 PushOperand(scratch); 2011 PushOperand(scratch);
1999 EmitPropertyKey(property, lit->GetIdForProperty(i)); 2012 EmitPropertyKey(property, lit->GetIdForProperty(i));
2000 2013
2001 // The static prototype property is read only. We handle the non computed 2014 // The static prototype property is read only. We handle the non computed
(...skipping 21 matching lines...) Expand all
2023 PushOperand(Smi::FromInt(DONT_ENUM)); 2036 PushOperand(Smi::FromInt(DONT_ENUM));
2024 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); 2037 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked);
2025 break; 2038 break;
2026 2039
2027 case ClassLiteral::Property::SETTER: 2040 case ClassLiteral::Property::SETTER:
2028 PushOperand(Smi::FromInt(DONT_ENUM)); 2041 PushOperand(Smi::FromInt(DONT_ENUM));
2029 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); 2042 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked);
2030 break; 2043 break;
2031 2044
2032 case ClassLiteral::Property::FIELD: 2045 case ClassLiteral::Property::FIELD:
2033 default: 2046 DCHECK(property->is_static());
2034 UNREACHABLE(); 2047 PushOperand(Smi::FromInt(DONT_ENUM));
2048 PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
2049 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
2050 break;
2035 } 2051 }
2036 } 2052 }
2037 } 2053 }
2038 2054
2039 2055
2040 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { 2056 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
2041 __ mov(a0, result_register()); 2057 __ mov(a0, result_register());
2042 PopOperand(a1); 2058 PopOperand(a1);
2043 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); 2059 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
2044 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 2060 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
3746 reinterpret_cast<uint64_t>( 3762 reinterpret_cast<uint64_t>(
3747 isolate->builtins()->OnStackReplacement()->entry())); 3763 isolate->builtins()->OnStackReplacement()->entry()));
3748 return ON_STACK_REPLACEMENT; 3764 return ON_STACK_REPLACEMENT;
3749 } 3765 }
3750 3766
3751 3767
3752 } // namespace internal 3768 } // namespace internal
3753 } // namespace v8 3769 } // namespace v8
3754 3770
3755 #endif // V8_TARGET_ARCH_MIPS64 3771 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698