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

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

Issue 1291973002: [runtime] Remove useless DELETE builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 4625 matching lines...) Expand 10 before | Expand all | Expand 10 after
4636 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) { 4636 void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
4637 switch (expr->op()) { 4637 switch (expr->op()) {
4638 case Token::DELETE: { 4638 case Token::DELETE: {
4639 Comment cmnt(masm_, "[ UnaryOperation (DELETE)"); 4639 Comment cmnt(masm_, "[ UnaryOperation (DELETE)");
4640 Property* property = expr->expression()->AsProperty(); 4640 Property* property = expr->expression()->AsProperty();
4641 VariableProxy* proxy = expr->expression()->AsVariableProxy(); 4641 VariableProxy* proxy = expr->expression()->AsVariableProxy();
4642 4642
4643 if (property != NULL) { 4643 if (property != NULL) {
4644 VisitForStackValue(property->obj()); 4644 VisitForStackValue(property->obj());
4645 VisitForStackValue(property->key()); 4645 VisitForStackValue(property->key());
4646 __ li(a1, Operand(Smi::FromInt(language_mode()))); 4646 __ CallRuntime(is_strict(language_mode())
4647 __ push(a1); 4647 ? Runtime::kDeleteProperty_Strict
4648 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); 4648 : Runtime::kDeleteProperty_Sloppy,
4649 2);
4649 context()->Plug(v0); 4650 context()->Plug(v0);
4650 } else if (proxy != NULL) { 4651 } else if (proxy != NULL) {
4651 Variable* var = proxy->var(); 4652 Variable* var = proxy->var();
4652 // Delete of an unqualified identifier is disallowed in strict mode but 4653 // Delete of an unqualified identifier is disallowed in strict mode but
4653 // "delete this" is allowed. 4654 // "delete this" is allowed.
4654 bool is_this = var->HasThisName(isolate()); 4655 bool is_this = var->HasThisName(isolate());
4655 DCHECK(is_sloppy(language_mode()) || is_this); 4656 DCHECK(is_sloppy(language_mode()) || is_this);
4656 if (var->IsUnallocatedOrGlobalSlot()) { 4657 if (var->IsUnallocatedOrGlobalSlot()) {
4657 __ ld(a2, GlobalObjectOperand()); 4658 __ ld(a2, GlobalObjectOperand());
4658 __ li(a1, Operand(var->name())); 4659 __ li(a1, Operand(var->name()));
4659 __ li(a0, Operand(Smi::FromInt(SLOPPY))); 4660 __ Push(a2, a1);
4660 __ Push(a2, a1, a0); 4661 __ CallRuntime(Runtime::kDeleteProperty_Sloppy, 2);
4661 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
4662 context()->Plug(v0); 4662 context()->Plug(v0);
4663 } else if (var->IsStackAllocated() || var->IsContextSlot()) { 4663 } else if (var->IsStackAllocated() || var->IsContextSlot()) {
4664 // Result of deleting non-global, non-dynamic variables is false. 4664 // Result of deleting non-global, non-dynamic variables is false.
4665 // The subexpression does not have side effects. 4665 // The subexpression does not have side effects.
4666 context()->Plug(is_this); 4666 context()->Plug(is_this);
4667 } else { 4667 } else {
4668 // Non-global variable. Call the runtime to try to delete from the 4668 // Non-global variable. Call the runtime to try to delete from the
4669 // context where the variable was introduced. 4669 // context where the variable was introduced.
4670 DCHECK(!context_register().is(a2)); 4670 DCHECK(!context_register().is(a2));
4671 __ li(a2, Operand(var->name())); 4671 __ li(a2, Operand(var->name()));
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
5382 reinterpret_cast<uint64_t>( 5382 reinterpret_cast<uint64_t>(
5383 isolate->builtins()->OsrAfterStackCheck()->entry())); 5383 isolate->builtins()->OsrAfterStackCheck()->entry()));
5384 return OSR_AFTER_STACK_CHECK; 5384 return OSR_AFTER_STACK_CHECK;
5385 } 5385 }
5386 5386
5387 5387
5388 } // namespace internal 5388 } // namespace internal
5389 } // namespace v8 5389 } // namespace v8
5390 5390
5391 #endif // V8_TARGET_ARCH_MIPS64 5391 #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