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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 Loading... |
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 __ lw(scratch, MemOperand(sp, kPointerSize)); // constructor | 1996 __ lw(scratch, MemOperand(sp, kPointerSize)); // constructor |
1997 } else { | 1997 } else { |
1998 __ lw(scratch, MemOperand(sp, 0)); // prototype | 1998 __ lw(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 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3750 reinterpret_cast<uint32_t>( | 3746 reinterpret_cast<uint32_t>( |
3751 isolate->builtins()->OnStackReplacement()->entry())); | 3747 isolate->builtins()->OnStackReplacement()->entry())); |
3752 return ON_STACK_REPLACEMENT; | 3748 return ON_STACK_REPLACEMENT; |
3753 } | 3749 } |
3754 | 3750 |
3755 | 3751 |
3756 } // namespace internal | 3752 } // namespace internal |
3757 } // namespace v8 | 3753 } // namespace v8 |
3758 | 3754 |
3759 #endif // V8_TARGET_ARCH_MIPS | 3755 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |