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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.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 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 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after
1992 break; 1992 break;
1993 default: 1993 default:
1994 UNREACHABLE(); 1994 UNREACHABLE();
1995 } 1995 }
1996 1996
1997 __ bind(&done); 1997 __ bind(&done);
1998 context()->Plug(v0); 1998 context()->Plug(v0);
1999 } 1999 }
2000 2000
2001 2001
2002 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
2003 for (int i = 0; i < lit->properties()->length(); i++) {
2004 ObjectLiteral::Property* property = lit->properties()->at(i);
2005 Expression* value = property->value();
2006
2007 Register scratch = a1;
2008 if (property->is_static()) {
2009 __ ld(scratch, MemOperand(sp, kPointerSize)); // constructor
2010 } else {
2011 __ ld(scratch, MemOperand(sp, 0)); // prototype
2012 }
2013 PushOperand(scratch);
2014 EmitPropertyKey(property, lit->GetIdForProperty(i));
2015
2016 // The static prototype property is read only. We handle the non computed
2017 // property name case in the parser. Since this is the only case where we
2018 // need to check for an own read only property we special case this so we do
2019 // not need to do this for every property.
2020 if (property->is_static() && property->is_computed_name()) {
2021 __ CallRuntime(Runtime::kThrowIfStaticPrototype);
2022 __ push(v0);
2023 }
2024
2025 VisitForStackValue(value);
2026 if (NeedsHomeObject(value)) {
2027 EmitSetHomeObject(value, 2, property->GetSlot());
2028 }
2029
2030 switch (property->kind()) {
2031 case ObjectLiteral::Property::CONSTANT:
2032 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
2033 case ObjectLiteral::Property::PROTOTYPE:
2034 UNREACHABLE();
2035 case ObjectLiteral::Property::COMPUTED:
2036 PushOperand(Smi::FromInt(DONT_ENUM));
2037 PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
2038 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
2039 break;
2040
2041 case ObjectLiteral::Property::GETTER:
2042 PushOperand(Smi::FromInt(DONT_ENUM));
2043 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked);
2044 break;
2045
2046 case ObjectLiteral::Property::SETTER:
2047 PushOperand(Smi::FromInt(DONT_ENUM));
2048 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked);
2049 break;
2050
2051 default:
2052 UNREACHABLE();
2053 }
2054 }
2055 }
2056
2057
2058 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { 2002 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
2059 __ mov(a0, result_register()); 2003 __ mov(a0, result_register());
2060 PopOperand(a1); 2004 PopOperand(a1);
2061 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); 2005 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
2062 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 2006 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
2063 CallIC(code, expr->BinaryOperationFeedbackId()); 2007 CallIC(code, expr->BinaryOperationFeedbackId());
2064 patch_site.EmitPatchInfo(); 2008 patch_site.EmitPatchInfo();
2065 context()->Plug(v0); 2009 context()->Plug(v0);
2066 } 2010 }
2067 2011
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after
3788 reinterpret_cast<uint64_t>( 3732 reinterpret_cast<uint64_t>(
3789 isolate->builtins()->OnStackReplacement()->entry())); 3733 isolate->builtins()->OnStackReplacement()->entry()));
3790 return ON_STACK_REPLACEMENT; 3734 return ON_STACK_REPLACEMENT;
3791 } 3735 }
3792 3736
3793 3737
3794 } // namespace internal 3738 } // namespace internal
3795 } // namespace v8 3739 } // namespace v8
3796 3740
3797 #endif // V8_TARGET_ARCH_MIPS64 3741 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698