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

Side by Side Diff: src/full-codegen/x87/full-codegen-x87.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/x64/full-codegen-x64.cc ('k') | src/interpreter/interpreter-generator.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_X87 5 #if V8_TARGET_ARCH_X87
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 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after
2140 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { 2140 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
2141 switch (expr->op()) { 2141 switch (expr->op()) {
2142 case Token::DELETE: { 2142 case Token::DELETE: {
2143 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); 2143 Comment cmnt(masm_, "[ UnaryOperation (DELETE)");
2144 Property* property = expr->expression()->AsProperty(); 2144 Property* property = expr->expression()->AsProperty();
2145 VariableProxy* proxy = expr->expression()->AsVariableProxy(); 2145 VariableProxy* proxy = expr->expression()->AsVariableProxy();
2146 2146
2147 if (property != NULL) { 2147 if (property != NULL) {
2148 VisitForStackValue(property->obj()); 2148 VisitForStackValue(property->obj());
2149 VisitForStackValue(property->key()); 2149 VisitForStackValue(property->key());
2150 CallRuntimeWithOperands(is_strict(language_mode()) 2150 PushOperand(Smi::FromInt(language_mode()));
2151 ? Runtime::kDeleteProperty_Strict 2151 CallRuntimeWithOperands(Runtime::kDeleteProperty);
2152 : Runtime::kDeleteProperty_Sloppy);
2153 context()->Plug(eax); 2152 context()->Plug(eax);
2154 } else if (proxy != NULL) { 2153 } else if (proxy != NULL) {
2155 Variable* var = proxy->var(); 2154 Variable* var = proxy->var();
2156 // Delete of an unqualified identifier is disallowed in strict mode but 2155 // Delete of an unqualified identifier is disallowed in strict mode but
2157 // "delete this" is allowed. 2156 // "delete this" is allowed.
2158 bool is_this = var->is_this(); 2157 bool is_this = var->is_this();
2159 DCHECK(is_sloppy(language_mode()) || is_this); 2158 DCHECK(is_sloppy(language_mode()) || is_this);
2160 if (var->IsUnallocated()) { 2159 if (var->IsUnallocated()) {
2161 __ mov(eax, NativeContextOperand()); 2160 __ mov(eax, NativeContextOperand());
2162 __ push(ContextOperand(eax, Context::EXTENSION_INDEX)); 2161 __ push(ContextOperand(eax, Context::EXTENSION_INDEX));
2163 __ push(Immediate(var->name())); 2162 __ push(Immediate(var->name()));
2164 __ CallRuntime(Runtime::kDeleteProperty_Sloppy); 2163 __ Push(Smi::FromInt(SLOPPY));
2164 __ CallRuntime(Runtime::kDeleteProperty);
2165 context()->Plug(eax); 2165 context()->Plug(eax);
2166 } else { 2166 } else {
2167 DCHECK(!var->IsLookupSlot()); 2167 DCHECK(!var->IsLookupSlot());
2168 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); 2168 DCHECK(var->IsStackAllocated() || var->IsContextSlot());
2169 // Result of deleting non-global variables is false. 'this' is 2169 // Result of deleting non-global variables is false. 'this' is
2170 // not really a variable, though we implement it as one. The 2170 // not really a variable, though we implement it as one. The
2171 // subexpression does not have side effects. 2171 // subexpression does not have side effects.
2172 context()->Plug(is_this); 2172 context()->Plug(is_this);
2173 } 2173 }
2174 } else { 2174 } else {
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
2747 isolate->builtins()->OnStackReplacement()->entry(), 2747 isolate->builtins()->OnStackReplacement()->entry(),
2748 Assembler::target_address_at(call_target_address, unoptimized_code)); 2748 Assembler::target_address_at(call_target_address, unoptimized_code));
2749 return ON_STACK_REPLACEMENT; 2749 return ON_STACK_REPLACEMENT;
2750 } 2750 }
2751 2751
2752 2752
2753 } // namespace internal 2753 } // namespace internal
2754 } // namespace v8 2754 } // namespace v8
2755 2755
2756 #endif // V8_TARGET_ARCH_X87 2756 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/interpreter/interpreter-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698