| 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 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 ClassLiteral::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 if (property->kind() == ClassLiteral::Property::FIELD && |
| 1995 !property->is_static()) { |
| 1996 // This just does the ToName call on the field name and stores it in a |
| 1997 // variable (a proxy for which is the value() of this property) |
| 1998 DCHECK(property->value()->IsVariableProxy()); |
| 1999 Variable* variable = property->value()->AsVariableProxy()->var(); |
| 2000 VisitForStackValue(property->key()); |
| 2001 EmitVariableAssignment(variable, Token::INIT, |
| 2002 FeedbackVectorSlot::Invalid()); |
| 2003 DropOperands(1); |
| 2004 continue; |
| 2005 } |
| 2006 |
| 1994 Register scratch = r4; | 2007 Register scratch = r4; |
| 1995 if (property->is_static()) { | 2008 if (property->is_static()) { |
| 1996 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor | 2009 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor |
| 1997 } else { | 2010 } else { |
| 1998 __ LoadP(scratch, MemOperand(sp, 0)); // prototype | 2011 __ LoadP(scratch, MemOperand(sp, 0)); // prototype |
| 1999 } | 2012 } |
| 2000 PushOperand(scratch); | 2013 PushOperand(scratch); |
| 2001 EmitPropertyKey(property, lit->GetIdForProperty(i)); | 2014 EmitPropertyKey(property, lit->GetIdForProperty(i)); |
| 2002 | 2015 |
| 2003 // The static prototype property is read only. We handle the non computed | 2016 // The static prototype property is read only. We handle the non computed |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2025 PushOperand(Smi::FromInt(DONT_ENUM)); | 2038 PushOperand(Smi::FromInt(DONT_ENUM)); |
| 2026 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); | 2039 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); |
| 2027 break; | 2040 break; |
| 2028 | 2041 |
| 2029 case ClassLiteral::Property::SETTER: | 2042 case ClassLiteral::Property::SETTER: |
| 2030 PushOperand(Smi::FromInt(DONT_ENUM)); | 2043 PushOperand(Smi::FromInt(DONT_ENUM)); |
| 2031 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); | 2044 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); |
| 2032 break; | 2045 break; |
| 2033 | 2046 |
| 2034 case ClassLiteral::Property::FIELD: | 2047 case ClassLiteral::Property::FIELD: |
| 2035 default: | 2048 DCHECK(property->is_static()); |
| 2036 UNREACHABLE(); | 2049 PushOperand(Smi::FromInt(DONT_ENUM)); |
| 2050 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); |
| 2051 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); |
| 2052 break; |
| 2037 } | 2053 } |
| 2038 } | 2054 } |
| 2039 } | 2055 } |
| 2040 | 2056 |
| 2041 | 2057 |
| 2042 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2058 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
| 2043 PopOperand(r4); | 2059 PopOperand(r4); |
| 2044 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); | 2060 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
| 2045 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2061 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
| 2046 CallIC(code, expr->BinaryOperationFeedbackId()); | 2062 CallIC(code, expr->BinaryOperationFeedbackId()); |
| (...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3720 | 3736 |
| 3721 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3737 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
| 3722 | 3738 |
| 3723 DCHECK(interrupt_address == | 3739 DCHECK(interrupt_address == |
| 3724 isolate->builtins()->OnStackReplacement()->entry()); | 3740 isolate->builtins()->OnStackReplacement()->entry()); |
| 3725 return ON_STACK_REPLACEMENT; | 3741 return ON_STACK_REPLACEMENT; |
| 3726 } | 3742 } |
| 3727 } // namespace internal | 3743 } // namespace internal |
| 3728 } // namespace v8 | 3744 } // namespace v8 |
| 3729 #endif // V8_TARGET_ARCH_PPC | 3745 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |