Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: src/full-codegen/arm64/full-codegen-arm64.cc

Issue 2810363003: [builtins] Introduce DeleteProperty builtin (Closed)
Patch Set: fix CallableFor not to create handles Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/arm64/macro-assembler-arm64-inl.h" 7 #include "src/arm64/macro-assembler-arm64-inl.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/builtins/builtins-constructor.h" 10 #include "src/builtins/builtins-constructor.h"
(...skipping 2188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2199 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { 2199 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
2200 switch (expr->op()) { 2200 switch (expr->op()) {
2201 case Token::DELETE: { 2201 case Token::DELETE: {
2202 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); 2202 Comment cmnt(masm_, "[ UnaryOperation (DELETE)");
2203 Property* property = expr->expression()->AsProperty(); 2203 Property* property = expr->expression()->AsProperty();
2204 VariableProxy* proxy = expr->expression()->AsVariableProxy(); 2204 VariableProxy* proxy = expr->expression()->AsVariableProxy();
2205 2205
2206 if (property != NULL) { 2206 if (property != NULL) {
2207 VisitForStackValue(property->obj()); 2207 VisitForStackValue(property->obj());
2208 VisitForStackValue(property->key()); 2208 VisitForStackValue(property->key());
2209 CallRuntimeWithOperands(is_strict(language_mode()) 2209 PushOperand(Smi::FromInt(language_mode()));
2210 ? Runtime::kDeleteProperty_Strict 2210 CallRuntimeWithOperands(Runtime::kDeleteProperty);
2211 : Runtime::kDeleteProperty_Sloppy);
2212 context()->Plug(x0); 2211 context()->Plug(x0);
2213 } else if (proxy != NULL) { 2212 } else if (proxy != NULL) {
2214 Variable* var = proxy->var(); 2213 Variable* var = proxy->var();
2215 // Delete of an unqualified identifier is disallowed in strict mode but 2214 // Delete of an unqualified identifier is disallowed in strict mode but
2216 // "delete this" is allowed. 2215 // "delete this" is allowed.
2217 bool is_this = var->is_this(); 2216 bool is_this = var->is_this();
2218 DCHECK(is_sloppy(language_mode()) || is_this); 2217 DCHECK(is_sloppy(language_mode()) || is_this);
2219 if (var->IsUnallocated()) { 2218 if (var->IsUnallocated()) {
2220 __ LoadGlobalObject(x12); 2219 __ LoadGlobalObject(x12);
2221 __ Mov(x11, Operand(var->name())); 2220 __ Mov(x11, Operand(var->name()));
2222 __ Push(x12, x11); 2221 __ Push(x12, x11);
2223 __ CallRuntime(Runtime::kDeleteProperty_Sloppy); 2222 __ Push(Smi::FromInt(SLOPPY));
2223 __ CallRuntime(Runtime::kDeleteProperty);
2224 context()->Plug(x0); 2224 context()->Plug(x0);
2225 } else { 2225 } else {
2226 DCHECK(!var->IsLookupSlot()); 2226 DCHECK(!var->IsLookupSlot());
2227 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); 2227 DCHECK(var->IsStackAllocated() || var->IsContextSlot());
2228 // Result of deleting non-global, non-dynamic variables is false. 2228 // Result of deleting non-global, non-dynamic variables is false.
2229 // The subexpression does not have side effects. 2229 // The subexpression does not have side effects.
2230 context()->Plug(is_this); 2230 context()->Plug(is_this);
2231 } 2231 }
2232 } else { 2232 } else {
2233 // Result of deleting non-property, non-variable reference is true. 2233 // Result of deleting non-property, non-variable reference is true.
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
2888 } 2888 }
2889 2889
2890 return INTERRUPT; 2890 return INTERRUPT;
2891 } 2891 }
2892 2892
2893 2893
2894 } // namespace internal 2894 } // namespace internal
2895 } // namespace v8 2895 } // namespace v8
2896 2896
2897 #endif // V8_TARGET_ARCH_ARM64 2897 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698