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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.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/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 2242 matching lines...) Expand 10 before | Expand all | Expand 10 after
2253 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { 2253 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
2254 switch (expr->op()) { 2254 switch (expr->op()) {
2255 case Token::DELETE: { 2255 case Token::DELETE: {
2256 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); 2256 Comment cmnt(masm_, "[ UnaryOperation (DELETE)");
2257 Property* property = expr->expression()->AsProperty(); 2257 Property* property = expr->expression()->AsProperty();
2258 VariableProxy* proxy = expr->expression()->AsVariableProxy(); 2258 VariableProxy* proxy = expr->expression()->AsVariableProxy();
2259 2259
2260 if (property != NULL) { 2260 if (property != NULL) {
2261 VisitForStackValue(property->obj()); 2261 VisitForStackValue(property->obj());
2262 VisitForStackValue(property->key()); 2262 VisitForStackValue(property->key());
2263 CallRuntimeWithOperands(is_strict(language_mode()) 2263 PushOperand(Smi::FromInt(language_mode()));
2264 ? Runtime::kDeleteProperty_Strict 2264 CallRuntimeWithOperands(Runtime::kDeleteProperty);
2265 : Runtime::kDeleteProperty_Sloppy);
2266 context()->Plug(v0); 2265 context()->Plug(v0);
2267 } else if (proxy != NULL) { 2266 } else if (proxy != NULL) {
2268 Variable* var = proxy->var(); 2267 Variable* var = proxy->var();
2269 // Delete of an unqualified identifier is disallowed in strict mode but 2268 // Delete of an unqualified identifier is disallowed in strict mode but
2270 // "delete this" is allowed. 2269 // "delete this" is allowed.
2271 bool is_this = var->is_this(); 2270 bool is_this = var->is_this();
2272 DCHECK(is_sloppy(language_mode()) || is_this); 2271 DCHECK(is_sloppy(language_mode()) || is_this);
2273 if (var->IsUnallocated()) { 2272 if (var->IsUnallocated()) {
2274 __ LoadGlobalObject(a2); 2273 __ LoadGlobalObject(a2);
2275 __ li(a1, Operand(var->name())); 2274 __ li(a1, Operand(var->name()));
2276 __ Push(a2, a1); 2275 __ Push(a2, a1);
2277 __ CallRuntime(Runtime::kDeleteProperty_Sloppy); 2276 __ Push(Smi::FromInt(SLOPPY));
2277 __ CallRuntime(Runtime::kDeleteProperty);
2278 context()->Plug(v0); 2278 context()->Plug(v0);
2279 } else { 2279 } else {
2280 DCHECK(!var->IsLookupSlot()); 2280 DCHECK(!var->IsLookupSlot());
2281 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); 2281 DCHECK(var->IsStackAllocated() || var->IsContextSlot());
2282 // Result of deleting non-global, non-dynamic variables is false. 2282 // Result of deleting non-global, non-dynamic variables is false.
2283 // The subexpression does not have side effects. 2283 // The subexpression does not have side effects.
2284 context()->Plug(is_this); 2284 context()->Plug(is_this);
2285 } 2285 }
2286 } else { 2286 } else {
2287 // Result of deleting non-property, non-variable reference is true. 2287 // Result of deleting non-property, non-variable reference is true.
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
2855 reinterpret_cast<uint64_t>( 2855 reinterpret_cast<uint64_t>(
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_MIPS64 2864 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698