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/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...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(r3); | 1985 context()->Plug(r3); |
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 = r4; | 1994 Register scratch = r4; |
1995 if (property->is_static()) { | 1995 if (property->is_static()) { |
1996 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor | 1996 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor |
1997 } else { | 1997 } else { |
1998 __ LoadP(scratch, MemOperand(sp, 0)); // prototype | 1998 __ LoadP(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(r3); | 2009 __ push(r3); |
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 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3723 | 3719 |
3724 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3720 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
3725 | 3721 |
3726 DCHECK(interrupt_address == | 3722 DCHECK(interrupt_address == |
3727 isolate->builtins()->OnStackReplacement()->entry()); | 3723 isolate->builtins()->OnStackReplacement()->entry()); |
3728 return ON_STACK_REPLACEMENT; | 3724 return ON_STACK_REPLACEMENT; |
3729 } | 3725 } |
3730 } // namespace internal | 3726 } // namespace internal |
3731 } // namespace v8 | 3727 } // namespace v8 |
3732 #endif // V8_TARGET_ARCH_PPC | 3728 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |