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/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 1931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1942 | 1942 |
1943 __ bind(&done); | 1943 __ bind(&done); |
1944 context()->Plug(r2); | 1944 context()->Plug(r2); |
1945 } | 1945 } |
1946 | 1946 |
1947 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { | 1947 void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
1948 for (int i = 0; i < lit->properties()->length(); i++) { | 1948 for (int i = 0; i < lit->properties()->length(); i++) { |
1949 ClassLiteral::Property* property = lit->properties()->at(i); | 1949 ClassLiteral::Property* property = lit->properties()->at(i); |
1950 Expression* value = property->value(); | 1950 Expression* value = property->value(); |
1951 | 1951 |
| 1952 if (property->kind() == ClassLiteral::Property::FIELD && |
| 1953 !property->is_static()) { |
| 1954 // This just does the ToName call on the field name and stores it in a |
| 1955 // variable (a proxy for which is the value() of this property) |
| 1956 DCHECK(property->value()->IsVariableProxy()); |
| 1957 Variable* variable = property->value()->AsVariableProxy()->var(); |
| 1958 VisitForStackValue(property->key()); |
| 1959 EmitVariableAssignment(variable, Token::INIT, |
| 1960 FeedbackVectorSlot::Invalid()); |
| 1961 DropOperands(1); |
| 1962 continue; |
| 1963 } |
| 1964 |
1952 Register scratch = r3; | 1965 Register scratch = r3; |
1953 if (property->is_static()) { | 1966 if (property->is_static()) { |
1954 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor | 1967 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor |
1955 } else { | 1968 } else { |
1956 __ LoadP(scratch, MemOperand(sp, 0)); // prototype | 1969 __ LoadP(scratch, MemOperand(sp, 0)); // prototype |
1957 } | 1970 } |
1958 PushOperand(scratch); | 1971 PushOperand(scratch); |
1959 EmitPropertyKey(property, lit->GetIdForProperty(i)); | 1972 EmitPropertyKey(property, lit->GetIdForProperty(i)); |
1960 | 1973 |
1961 // The static prototype property is read only. We handle the non computed | 1974 // The static prototype property is read only. We handle the non computed |
(...skipping 21 matching lines...) Expand all Loading... |
1983 PushOperand(Smi::FromInt(DONT_ENUM)); | 1996 PushOperand(Smi::FromInt(DONT_ENUM)); |
1984 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); | 1997 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); |
1985 break; | 1998 break; |
1986 | 1999 |
1987 case ClassLiteral::Property::SETTER: | 2000 case ClassLiteral::Property::SETTER: |
1988 PushOperand(Smi::FromInt(DONT_ENUM)); | 2001 PushOperand(Smi::FromInt(DONT_ENUM)); |
1989 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); | 2002 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); |
1990 break; | 2003 break; |
1991 | 2004 |
1992 case ClassLiteral::Property::FIELD: | 2005 case ClassLiteral::Property::FIELD: |
1993 default: | 2006 DCHECK(property->is_static()); |
1994 UNREACHABLE(); | 2007 PushOperand(Smi::FromInt(DONT_ENUM)); |
| 2008 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); |
| 2009 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); |
| 2010 break; |
1995 } | 2011 } |
1996 } | 2012 } |
1997 } | 2013 } |
1998 | 2014 |
1999 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { | 2015 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { |
2000 PopOperand(r3); | 2016 PopOperand(r3); |
2001 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); | 2017 Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); |
2002 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2018 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2003 CallIC(code, expr->BinaryOperationFeedbackId()); | 2019 CallIC(code, expr->BinaryOperationFeedbackId()); |
2004 patch_site.EmitPatchInfo(); | 2020 patch_site.EmitPatchInfo(); |
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3632 DCHECK(kOSRBranchInstruction == br_instr); | 3648 DCHECK(kOSRBranchInstruction == br_instr); |
3633 | 3649 |
3634 DCHECK(interrupt_address == | 3650 DCHECK(interrupt_address == |
3635 isolate->builtins()->OnStackReplacement()->entry()); | 3651 isolate->builtins()->OnStackReplacement()->entry()); |
3636 return ON_STACK_REPLACEMENT; | 3652 return ON_STACK_REPLACEMENT; |
3637 } | 3653 } |
3638 | 3654 |
3639 } // namespace internal | 3655 } // namespace internal |
3640 } // namespace v8 | 3656 } // namespace v8 |
3641 #endif // V8_TARGET_ARCH_S390 | 3657 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |