OLD | NEW |
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 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1979 UNREACHABLE(); | 1979 UNREACHABLE(); |
1980 } | 1980 } |
1981 | 1981 |
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 ObjectLiteral::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 Register scratch = a1; | 1992 Register scratch = a1; |
1993 if (property->is_static()) { | 1993 if (property->is_static()) { |
1994 __ ld(scratch, MemOperand(sp, kPointerSize)); // constructor | 1994 __ ld(scratch, MemOperand(sp, kPointerSize)); // constructor |
1995 } else { | 1995 } else { |
1996 __ ld(scratch, MemOperand(sp, 0)); // prototype | 1996 __ ld(scratch, MemOperand(sp, 0)); // prototype |
1997 } | 1997 } |
1998 PushOperand(scratch); | 1998 PushOperand(scratch); |
1999 EmitPropertyKey(property, lit->GetIdForProperty(i)); | 1999 EmitPropertyKey(property, lit->GetIdForProperty(i)); |
2000 | 2000 |
2001 // The static prototype property is read only. We handle the non computed | 2001 // The static prototype property is read only. We handle the non computed |
2002 // property name case in the parser. Since this is the only case where we | 2002 // property name case in the parser. Since this is the only case where we |
2003 // need to check for an own read only property we special case this so we do | 2003 // need to check for an own read only property we special case this so we do |
2004 // not need to do this for every property. | 2004 // not need to do this for every property. |
2005 if (property->is_static() && property->is_computed_name()) { | 2005 if (property->is_static() && property->is_computed_name()) { |
2006 __ CallRuntime(Runtime::kThrowIfStaticPrototype); | 2006 __ CallRuntime(Runtime::kThrowIfStaticPrototype); |
2007 __ push(v0); | 2007 __ push(v0); |
2008 } | 2008 } |
2009 | 2009 |
2010 VisitForStackValue(value); | 2010 VisitForStackValue(value); |
2011 if (NeedsHomeObject(value)) { | 2011 if (NeedsHomeObject(value)) { |
2012 EmitSetHomeObject(value, 2, property->GetSlot()); | 2012 EmitSetHomeObject(value, 2, property->GetSlot()); |
2013 } | 2013 } |
2014 | 2014 |
2015 switch (property->kind()) { | 2015 switch (property->kind()) { |
2016 case ObjectLiteral::Property::CONSTANT: | 2016 case ClassLiteral::Property::METHOD: |
2017 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | |
2018 case ObjectLiteral::Property::PROTOTYPE: | |
2019 UNREACHABLE(); | |
2020 case ObjectLiteral::Property::COMPUTED: | |
2021 PushOperand(Smi::FromInt(DONT_ENUM)); | 2017 PushOperand(Smi::FromInt(DONT_ENUM)); |
2022 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); | 2018 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); |
2023 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); | 2019 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); |
2024 break; | 2020 break; |
2025 | 2021 |
2026 case ObjectLiteral::Property::GETTER: | 2022 case ClassLiteral::Property::GETTER: |
2027 PushOperand(Smi::FromInt(DONT_ENUM)); | 2023 PushOperand(Smi::FromInt(DONT_ENUM)); |
2028 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); | 2024 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); |
2029 break; | 2025 break; |
2030 | 2026 |
2031 case ObjectLiteral::Property::SETTER: | 2027 case ClassLiteral::Property::SETTER: |
2032 PushOperand(Smi::FromInt(DONT_ENUM)); | 2028 PushOperand(Smi::FromInt(DONT_ENUM)); |
2033 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); | 2029 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); |
2034 break; | 2030 break; |
2035 | 2031 |
2036 default: | 2032 default: |
2037 UNREACHABLE(); | 2033 UNREACHABLE(); |
2038 } | 2034 } |
2039 } | 2035 } |
2040 } | 2036 } |
2041 | 2037 |
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3749 reinterpret_cast<uint64_t>( | 3745 reinterpret_cast<uint64_t>( |
3750 isolate->builtins()->OnStackReplacement()->entry())); | 3746 isolate->builtins()->OnStackReplacement()->entry())); |
3751 return ON_STACK_REPLACEMENT; | 3747 return ON_STACK_REPLACEMENT; |
3752 } | 3748 } |
3753 | 3749 |
3754 | 3750 |
3755 } // namespace internal | 3751 } // namespace internal |
3756 } // namespace v8 | 3752 } // namespace v8 |
3757 | 3753 |
3758 #endif // V8_TARGET_ARCH_MIPS64 | 3754 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |