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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.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/crankshaft/hydrogen.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/assembler-inl.h" 7 #include "src/assembler-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 2223 matching lines...) Expand 10 before | Expand all | Expand 10 after
2234 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { 2234 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
2235 switch (expr->op()) { 2235 switch (expr->op()) {
2236 case Token::DELETE: { 2236 case Token::DELETE: {
2237 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); 2237 Comment cmnt(masm_, "[ UnaryOperation (DELETE)");
2238 Property* property = expr->expression()->AsProperty(); 2238 Property* property = expr->expression()->AsProperty();
2239 VariableProxy* proxy = expr->expression()->AsVariableProxy(); 2239 VariableProxy* proxy = expr->expression()->AsVariableProxy();
2240 2240
2241 if (property != NULL) { 2241 if (property != NULL) {
2242 VisitForStackValue(property->obj()); 2242 VisitForStackValue(property->obj());
2243 VisitForStackValue(property->key()); 2243 VisitForStackValue(property->key());
2244 CallRuntimeWithOperands(is_strict(language_mode()) 2244 PushOperand(Smi::FromInt(language_mode()));
2245 ? Runtime::kDeleteProperty_Strict 2245 CallRuntimeWithOperands(Runtime::kDeleteProperty);
2246 : Runtime::kDeleteProperty_Sloppy);
2247 context()->Plug(r0); 2246 context()->Plug(r0);
2248 } else if (proxy != NULL) { 2247 } else if (proxy != NULL) {
2249 Variable* var = proxy->var(); 2248 Variable* var = proxy->var();
2250 // Delete of an unqualified identifier is disallowed in strict mode but 2249 // Delete of an unqualified identifier is disallowed in strict mode but
2251 // "delete this" is allowed. 2250 // "delete this" is allowed.
2252 bool is_this = var->is_this(); 2251 bool is_this = var->is_this();
2253 DCHECK(is_sloppy(language_mode()) || is_this); 2252 DCHECK(is_sloppy(language_mode()) || is_this);
2254 if (var->IsUnallocated()) { 2253 if (var->IsUnallocated()) {
2255 __ LoadGlobalObject(r2); 2254 __ LoadGlobalObject(r2);
2256 __ mov(r1, Operand(var->name())); 2255 __ mov(r1, Operand(var->name()));
2257 __ Push(r2, r1); 2256 __ Push(r2, r1);
2258 __ CallRuntime(Runtime::kDeleteProperty_Sloppy); 2257 __ Push(Smi::FromInt(SLOPPY));
2258 __ CallRuntime(Runtime::kDeleteProperty);
2259 context()->Plug(r0); 2259 context()->Plug(r0);
2260 } else { 2260 } else {
2261 DCHECK(!var->IsLookupSlot()); 2261 DCHECK(!var->IsLookupSlot());
2262 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); 2262 DCHECK(var->IsStackAllocated() || var->IsContextSlot());
2263 // Result of deleting non-global, non-dynamic variables is false. 2263 // Result of deleting non-global, non-dynamic variables is false.
2264 // The subexpression does not have side effects. 2264 // The subexpression does not have side effects.
2265 context()->Plug(is_this); 2265 context()->Plug(is_this);
2266 } 2266 }
2267 } else { 2267 } else {
2268 // Result of deleting non-property, non-variable reference is true. 2268 // Result of deleting non-property, non-variable reference is true.
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
2855 DCHECK(interrupt_address == 2855 DCHECK(interrupt_address ==
2856 isolate->builtins()->OnStackReplacement()->entry()); 2856 isolate->builtins()->OnStackReplacement()->entry());
2857 return ON_STACK_REPLACEMENT; 2857 return ON_STACK_REPLACEMENT;
2858 } 2858 }
2859 2859
2860 2860
2861 } // namespace internal 2861 } // namespace internal
2862 } // namespace v8 2862 } // namespace v8
2863 2863
2864 #endif // V8_TARGET_ARCH_ARM 2864 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698