| 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/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 2189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2200 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { | 2200 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { |
| 2201 switch (expr->op()) { | 2201 switch (expr->op()) { |
| 2202 case Token::DELETE: { | 2202 case Token::DELETE: { |
| 2203 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); | 2203 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); |
| 2204 Property* property = expr->expression()->AsProperty(); | 2204 Property* property = expr->expression()->AsProperty(); |
| 2205 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 2205 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
| 2206 | 2206 |
| 2207 if (property != NULL) { | 2207 if (property != NULL) { |
| 2208 VisitForStackValue(property->obj()); | 2208 VisitForStackValue(property->obj()); |
| 2209 VisitForStackValue(property->key()); | 2209 VisitForStackValue(property->key()); |
| 2210 CallRuntimeWithOperands(is_strict(language_mode()) | 2210 PushOperand(Smi::FromInt(language_mode())); |
| 2211 ? Runtime::kDeleteProperty_Strict | 2211 CallRuntimeWithOperands(Runtime::kDeleteProperty); |
| 2212 : Runtime::kDeleteProperty_Sloppy); | |
| 2213 context()->Plug(r2); | 2212 context()->Plug(r2); |
| 2214 } else if (proxy != NULL) { | 2213 } else if (proxy != NULL) { |
| 2215 Variable* var = proxy->var(); | 2214 Variable* var = proxy->var(); |
| 2216 // Delete of an unqualified identifier is disallowed in strict mode but | 2215 // Delete of an unqualified identifier is disallowed in strict mode but |
| 2217 // "delete this" is allowed. | 2216 // "delete this" is allowed. |
| 2218 bool is_this = var->is_this(); | 2217 bool is_this = var->is_this(); |
| 2219 DCHECK(is_sloppy(language_mode()) || is_this); | 2218 DCHECK(is_sloppy(language_mode()) || is_this); |
| 2220 if (var->IsUnallocated()) { | 2219 if (var->IsUnallocated()) { |
| 2221 __ LoadGlobalObject(r4); | 2220 __ LoadGlobalObject(r4); |
| 2222 __ mov(r3, Operand(var->name())); | 2221 __ mov(r3, Operand(var->name())); |
| 2223 __ Push(r4, r3); | 2222 __ Push(r4, r3); |
| 2224 __ CallRuntime(Runtime::kDeleteProperty_Sloppy); | 2223 __ Push(Smi::FromInt(SLOPPY)); |
| 2224 __ CallRuntime(Runtime::kDeleteProperty); |
| 2225 context()->Plug(r2); | 2225 context()->Plug(r2); |
| 2226 } else { | 2226 } else { |
| 2227 DCHECK(!var->IsLookupSlot()); | 2227 DCHECK(!var->IsLookupSlot()); |
| 2228 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2228 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
| 2229 // Result of deleting non-global, non-dynamic variables is false. | 2229 // Result of deleting non-global, non-dynamic variables is false. |
| 2230 // The subexpression does not have side effects. | 2230 // The subexpression does not have side effects. |
| 2231 context()->Plug(is_this); | 2231 context()->Plug(is_this); |
| 2232 } | 2232 } |
| 2233 } else { | 2233 } else { |
| 2234 // Result of deleting non-property, non-variable reference is true. | 2234 // Result of deleting non-property, non-variable reference is true. |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2777 USE(kOSRBranchInstruction); | 2777 USE(kOSRBranchInstruction); |
| 2778 DCHECK(kOSRBranchInstruction == br_instr); | 2778 DCHECK(kOSRBranchInstruction == br_instr); |
| 2779 | 2779 |
| 2780 DCHECK(interrupt_address == | 2780 DCHECK(interrupt_address == |
| 2781 isolate->builtins()->OnStackReplacement()->entry()); | 2781 isolate->builtins()->OnStackReplacement()->entry()); |
| 2782 return ON_STACK_REPLACEMENT; | 2782 return ON_STACK_REPLACEMENT; |
| 2783 } | 2783 } |
| 2784 } // namespace internal | 2784 } // namespace internal |
| 2785 } // namespace v8 | 2785 } // namespace v8 |
| 2786 #endif // V8_TARGET_ARCH_S390 | 2786 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |