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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1994 break; | 1994 break; |
1995 default: | 1995 default: |
1996 UNREACHABLE(); | 1996 UNREACHABLE(); |
1997 } | 1997 } |
1998 | 1998 |
1999 __ bind(&done); | 1999 __ bind(&done); |
2000 context()->Plug(r3); | 2000 context()->Plug(r3); |
2001 } | 2001 } |
2002 | 2002 |
2003 | 2003 |
2004 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { | |
2005 for (int i = 0; i < lit->properties()->length(); i++) { | |
2006 ObjectLiteral::Property* property = lit->properties()->at(i); | |
2007 Expression* value = property->value(); | |
2008 | |
2009 Register scratch = r4; | |
2010 if (property->is_static()) { | |
2011 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor | |
2012 } else { | |
2013 __ LoadP(scratch, MemOperand(sp, 0)); // prototype | |
2014 } | |
2015 PushOperand(scratch); | |
2016 EmitPropertyKey(property, lit->GetIdForProperty(i)); | |
2017 | |
2018 // The static prototype property is read only. We handle the non computed | |
2019 // property name case in the parser. Since this is the only case where we | |
2020 // need to check for an own read only property we special case this so we do | |
2021 // not need to do this for every property. | |
2022 if (property->is_static() && property->is_computed_name()) { | |
2023 __ CallRuntime(Runtime::kThrowIfStaticPrototype); | |
2024 __ push(r3); | |
2025 } | |
2026 | |
2027 VisitForStackValue(value); | |
2028 if (NeedsHomeObject(value)) { | |
2029 EmitSetHomeObject(value, 2, property->GetSlot()); | |
2030 } | |
2031 | |
2032 switch (property->kind()) { | |
2033 case ObjectLiteral::Property::CONSTANT: | |
2034 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | |
2035 case ObjectLiteral::Property::PROTOTYPE: | |
2036 UNREACHABLE(); | |
2037 case ObjectLiteral::Property::COMPUTED: | |
2038 PushOperand(Smi::FromInt(DONT_ENUM)); | |
2039 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); | |
2040 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); | |
2041 break; | |
2042 | |
2043 case ObjectLiteral::Property::GETTER: | |
2044 PushOperand(Smi::FromInt(DONT_ENUM)); | |
2045 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); | |
2046 break; | |
2047 | |
2048 case ObjectLiteral::Property::SETTER: | |
2049 PushOperand(Smi::FromInt(DONT_ENUM)); | |
2050 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); | |
2051 break; | |
2052 | |
2053 default: | |
2054 UNREACHABLE(); | |
2055 } | |
2056 } | |
2057 } | |
2058 | |
2059 | |
2060 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2004 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
2061 PopOperand(r4); | 2005 PopOperand(r4); |
2062 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); | 2006 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
2063 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2007 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2064 CallIC(code, expr->BinaryOperationFeedbackId()); | 2008 CallIC(code, expr->BinaryOperationFeedbackId()); |
2065 patch_site.EmitPatchInfo(); | 2009 patch_site.EmitPatchInfo(); |
2066 context()->Plug(r3); | 2010 context()->Plug(r3); |
2067 } | 2011 } |
2068 | 2012 |
2069 | 2013 |
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3761 | 3705 |
3762 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3706 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
3763 | 3707 |
3764 DCHECK(interrupt_address == | 3708 DCHECK(interrupt_address == |
3765 isolate->builtins()->OnStackReplacement()->entry()); | 3709 isolate->builtins()->OnStackReplacement()->entry()); |
3766 return ON_STACK_REPLACEMENT; | 3710 return ON_STACK_REPLACEMENT; |
3767 } | 3711 } |
3768 } // namespace internal | 3712 } // namespace internal |
3769 } // namespace v8 | 3713 } // namespace v8 |
3770 #endif // V8_TARGET_ARCH_PPC | 3714 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |