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