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 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1939 default: | 1939 default: |
1940 UNREACHABLE(); | 1940 UNREACHABLE(); |
1941 } | 1941 } |
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 ObjectLiteral::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 Register scratch = r3; | 1952 Register scratch = r3; |
1953 if (property->is_static()) { | 1953 if (property->is_static()) { |
1954 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor | 1954 __ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor |
1955 } else { | 1955 } else { |
1956 __ LoadP(scratch, MemOperand(sp, 0)); // prototype | 1956 __ LoadP(scratch, MemOperand(sp, 0)); // prototype |
1957 } | 1957 } |
1958 PushOperand(scratch); | 1958 PushOperand(scratch); |
1959 EmitPropertyKey(property, lit->GetIdForProperty(i)); | 1959 EmitPropertyKey(property, lit->GetIdForProperty(i)); |
1960 | 1960 |
1961 // The static prototype property is read only. We handle the non computed | 1961 // The static prototype property is read only. We handle the non computed |
1962 // property name case in the parser. Since this is the only case where we | 1962 // property name case in the parser. Since this is the only case where we |
1963 // need to check for an own read only property we special case this so we do | 1963 // need to check for an own read only property we special case this so we do |
1964 // not need to do this for every property. | 1964 // not need to do this for every property. |
1965 if (property->is_static() && property->is_computed_name()) { | 1965 if (property->is_static() && property->is_computed_name()) { |
1966 __ CallRuntime(Runtime::kThrowIfStaticPrototype); | 1966 __ CallRuntime(Runtime::kThrowIfStaticPrototype); |
1967 __ push(r2); | 1967 __ push(r2); |
1968 } | 1968 } |
1969 | 1969 |
1970 VisitForStackValue(value); | 1970 VisitForStackValue(value); |
1971 if (NeedsHomeObject(value)) { | 1971 if (NeedsHomeObject(value)) { |
1972 EmitSetHomeObject(value, 2, property->GetSlot()); | 1972 EmitSetHomeObject(value, 2, property->GetSlot()); |
1973 } | 1973 } |
1974 | 1974 |
1975 switch (property->kind()) { | 1975 switch (property->kind()) { |
1976 case ObjectLiteral::Property::CONSTANT: | 1976 case ClassLiteral::Property::METHOD: |
1977 case ObjectLiteral::Property::MATERIALIZED_LITERAL: | |
1978 case ObjectLiteral::Property::PROTOTYPE: | |
1979 UNREACHABLE(); | |
1980 case ObjectLiteral::Property::COMPUTED: | |
1981 PushOperand(Smi::FromInt(DONT_ENUM)); | 1977 PushOperand(Smi::FromInt(DONT_ENUM)); |
1982 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); | 1978 PushOperand(Smi::FromInt(property->NeedsSetFunctionName())); |
1983 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); | 1979 CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral); |
1984 break; | 1980 break; |
1985 | 1981 |
1986 case ObjectLiteral::Property::GETTER: | 1982 case ClassLiteral::Property::GETTER: |
1987 PushOperand(Smi::FromInt(DONT_ENUM)); | 1983 PushOperand(Smi::FromInt(DONT_ENUM)); |
1988 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); | 1984 CallRuntimeWithOperands(Runtime::kDefineGetterPropertyUnchecked); |
1989 break; | 1985 break; |
1990 | 1986 |
1991 case ObjectLiteral::Property::SETTER: | 1987 case ClassLiteral::Property::SETTER: |
1992 PushOperand(Smi::FromInt(DONT_ENUM)); | 1988 PushOperand(Smi::FromInt(DONT_ENUM)); |
1993 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); | 1989 CallRuntimeWithOperands(Runtime::kDefineSetterPropertyUnchecked); |
1994 break; | 1990 break; |
1995 | 1991 |
1996 default: | 1992 default: |
1997 UNREACHABLE(); | 1993 UNREACHABLE(); |
1998 } | 1994 } |
1999 } | 1995 } |
2000 } | 1996 } |
2001 | 1997 |
(...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3635 DCHECK(kOSRBranchInstruction == br_instr); | 3631 DCHECK(kOSRBranchInstruction == br_instr); |
3636 | 3632 |
3637 DCHECK(interrupt_address == | 3633 DCHECK(interrupt_address == |
3638 isolate->builtins()->OnStackReplacement()->entry()); | 3634 isolate->builtins()->OnStackReplacement()->entry()); |
3639 return ON_STACK_REPLACEMENT; | 3635 return ON_STACK_REPLACEMENT; |
3640 } | 3636 } |
3641 | 3637 |
3642 } // namespace internal | 3638 } // namespace internal |
3643 } // namespace v8 | 3639 } // namespace v8 |
3644 #endif // V8_TARGET_ARCH_S390 | 3640 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |