OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1983 UNREACHABLE(); | 1983 UNREACHABLE(); |
1984 } | 1984 } |
1985 | 1985 |
1986 __ bind(&done); | 1986 __ bind(&done); |
1987 context()->Plug(r3); | 1987 context()->Plug(r3); |
1988 } | 1988 } |
1989 | 1989 |
1990 | 1990 |
1991 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { | 1991 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
1992 for (int i = 0; i < lit->properties()->length(); i++) { | 1992 for (int i = 0; i < lit->properties()->length(); i++) { |
1993 ObjectLiteral::Property* property = lit->properties()->at(i); | 1993 ClassLiteral::Property* property = lit->properties()->at(i); |
1994 Expression* value = property->value(); | 1994 Expression* value = property->value(); |
1995 | 1995 |
1996 Register scratch = r4; | 1996 Register scratch = r4; |
1997 if (property->is_static()) { | 1997 if (property->is_static()) { |
1998 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor | 1998 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor |
1999 } else { | 1999 } else { |
2000 __ LoadP(scratch, MemOperand(sp, 0)); // prototype | 2000 __ LoadP(scratch, MemOperand(sp, 0)); // prototype |
2001 } | 2001 } |
2002 PushOperand(scratch); | 2002 PushOperand(scratch); |
2003 EmitPropertyKey(property, lit->GetIdForProperty(i)); | 2003 EmitPropertyKey(property, lit->GetIdForProperty(i)); |
2004 | 2004 |
2005 // The static prototype property is read only. We handle the non computed | 2005 // The static prototype property is read only. We handle the non computed |
2006 // property name case in the parser. Since this is the only case where we | 2006 // property name case in the parser. Since this is the only case where we |
2007 // need to check for an own read only property we special case this so we do | 2007 // need to check for an own read only property we special case this so we do |
2008 // not need to do this for every property. | 2008 // not need to do this for every property. |
2009 if (property->is_static() && property->is_computed_name()) { | 2009 if (property->is_static() && property->is_computed_name()) { |
2010 __ CallRuntime(Runtime::kThrowIfStaticPrototype); | 2010 __ CallRuntime(Runtime::kThrowIfStaticPrototype); |
2011 __ push(r3); | 2011 __ push(r3); |
2012 } | 2012 } |
2013 | 2013 |
2014 VisitForStackValue(value); | 2014 VisitForStackValue(value); |
2015 if (NeedsHomeObject(value)) { | 2015 if (NeedsHomeObject(value)) { |
2016 EmitSetHomeObject(value, 2, property->GetSlot()); | 2016 EmitSetHomeObject(value, 2, property->GetSlot()); |
2017 } | 2017 } |
2018 | 2018 |
2019 switch (property->kind()) { | 2019 switch (property->kind()) { |
2020 case ObjectLiteral::Property::CONSTANT: | 2020 case ClassLiteral::Property::METHOD: |
2021 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | |
2022 case ObjectLiteral::Property::PROTOTYPE: | |
2023 UNREACHABLE(); | |
2024 case ObjectLiteral::Property::COMPUTED: | |
2025 PushOperand(Smi::FromInt(DONT_ENUM)); | 2021 PushOperand(Smi::FromInt(DONT_ENUM)); |
2026 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); | 2022 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); |
2027 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); | 2023 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); |
2028 break; | 2024 break; |
2029 | 2025 |
2030 case ObjectLiteral::Property::GETTER: | 2026 case ClassLiteral::Property::GETTER: |
2031 PushOperand(Smi::FromInt(DONT_ENUM)); | 2027 PushOperand(Smi::FromInt(DONT_ENUM)); |
2032 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); | 2028 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); |
2033 break; | 2029 break; |
2034 | 2030 |
2035 case ObjectLiteral::Property::SETTER: | 2031 case ClassLiteral::Property::SETTER: |
2036 PushOperand(Smi::FromInt(DONT_ENUM)); | 2032 PushOperand(Smi::FromInt(DONT_ENUM)); |
2037 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); | 2033 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); |
2038 break; | 2034 break; |
2039 | 2035 |
2040 default: | 2036 default: |
2041 UNREACHABLE(); | 2037 UNREACHABLE(); |
2042 } | 2038 } |
2043 } | 2039 } |
2044 } | 2040 } |
2045 | 2041 |
(...skipping 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3731 | 3727 |
3732 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3728 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
3733 | 3729 |
3734 DCHECK(interrupt_address == | 3730 DCHECK(interrupt_address == |
3735 isolate->builtins()->OnStackReplacement()->entry()); | 3731 isolate->builtins()->OnStackReplacement()->entry()); |
3736 return ON_STACK_REPLACEMENT; | 3732 return ON_STACK_REPLACEMENT; |
3737 } | 3733 } |
3738 } // namespace internal | 3734 } // namespace internal |
3739 } // namespace v8 | 3735 } // namespace v8 |
3740 #endif // V8_TARGET_ARCH_PPC | 3736 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |