OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
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 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1959 __ XorP(right, left); | 1959 __ XorP(right, left); |
1960 break; | 1960 break; |
1961 default: | 1961 default: |
1962 UNREACHABLE(); | 1962 UNREACHABLE(); |
1963 } | 1963 } |
1964 | 1964 |
1965 __ bind(&done); | 1965 __ bind(&done); |
1966 context()->Plug(r2); | 1966 context()->Plug(r2); |
1967 } | 1967 } |
1968 | 1968 |
1969 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { | |
1970 for (int i = 0; i < lit->properties()->length(); i++) { | |
1971 ObjectLiteral::Property* property = lit->properties()->at(i); | |
1972 Expression* value = property->value(); | |
1973 | |
1974 Register scratch = r3; | |
1975 if (property->is_static()) { | |
1976 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor | |
1977 } else { | |
1978 __ LoadP(scratch, MemOperand(sp, 0)); // prototype | |
1979 } | |
1980 PushOperand(scratch); | |
1981 EmitPropertyKey(property, lit->GetIdForProperty(i)); | |
1982 | |
1983 // The static prototype property is read only. We handle the non computed | |
1984 // property name case in the parser. Since this is the only case where we | |
1985 // need to check for an own read only property we special case this so we do | |
1986 // not need to do this for every property. | |
1987 if (property->is_static() && property->is_computed_name()) { | |
1988 __ CallRuntime(Runtime::kThrowIfStaticPrototype); | |
1989 __ push(r2); | |
1990 } | |
1991 | |
1992 VisitForStackValue(value); | |
1993 if (NeedsHomeObject(value)) { | |
1994 EmitSetHomeObject(value, 2, property->GetSlot()); | |
1995 } | |
1996 | |
1997 switch (property->kind()) { | |
1998 case ObjectLiteral::Property::CONSTANT: | |
1999 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | |
2000 case ObjectLiteral::Property::PROTOTYPE: | |
2001 UNREACHABLE(); | |
2002 case ObjectLiteral::Property::COMPUTED: | |
2003 PushOperand(Smi::FromInt(DONT_ENUM)); | |
2004 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); | |
2005 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); | |
2006 break; | |
2007 | |
2008 case ObjectLiteral::Property::GETTER: | |
2009 PushOperand(Smi::FromInt(DONT_ENUM)); | |
2010 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); | |
2011 break; | |
2012 | |
2013 case ObjectLiteral::Property::SETTER: | |
2014 PushOperand(Smi::FromInt(DONT_ENUM)); | |
2015 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); | |
2016 break; | |
2017 | |
2018 default: | |
2019 UNREACHABLE(); | |
2020 } | |
2021 } | |
2022 } | |
2023 | |
2024 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 1969 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
2025 PopOperand(r3); | 1970 PopOperand(r3); |
2026 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); | 1971 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
2027 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 1972 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2028 CallIC(code, expr->BinaryOperationFeedbackId()); | 1973 CallIC(code, expr->BinaryOperationFeedbackId()); |
2029 patch_site.EmitPatchInfo(); | 1974 patch_site.EmitPatchInfo(); |
2030 context()->Plug(r2); | 1975 context()->Plug(r2); |
2031 } | 1976 } |
2032 | 1977 |
2033 void FullCodeGenerator::EmitAssignment(Expression* expr, | 1978 void FullCodeGenerator::EmitAssignment(Expression* expr, |
(...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3680 DCHECK(kOSRBranchInstruction == br_instr); | 3625 DCHECK(kOSRBranchInstruction == br_instr); |
3681 | 3626 |
3682 DCHECK(interrupt_address == | 3627 DCHECK(interrupt_address == |
3683 isolate->builtins()->OnStackReplacement()->entry()); | 3628 isolate->builtins()->OnStackReplacement()->entry()); |
3684 return ON_STACK_REPLACEMENT; | 3629 return ON_STACK_REPLACEMENT; |
3685 } | 3630 } |
3686 | 3631 |
3687 } // namespace internal | 3632 } // namespace internal |
3688 } // namespace v8 | 3633 } // namespace v8 |
3689 #endif // V8_TARGET_ARCH_S390 | 3634 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |