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/ia32/full-codegen-ia32.cc

Issue 6484023: Fix the semantics of delete on parameters. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build/ia32
Patch Set: Created 9 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.cc ('k') | src/x64/full-codegen-x64.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3703 matching lines...) Expand 10 before | Expand all | Expand 10 after
3714 // The subexpression may have side effects. 3714 // The subexpression may have side effects.
3715 VisitForEffect(expr->expression()); 3715 VisitForEffect(expr->expression());
3716 context()->Plug(true); 3716 context()->Plug(true);
3717 } else if (var != NULL && 3717 } else if (var != NULL &&
3718 !var->is_global() && 3718 !var->is_global() &&
3719 var->AsSlot() != NULL && 3719 var->AsSlot() != NULL &&
3720 var->AsSlot()->type() != Slot::LOOKUP) { 3720 var->AsSlot()->type() != Slot::LOOKUP) {
3721 // Result of deleting non-global, non-dynamic variables is false. 3721 // Result of deleting non-global, non-dynamic variables is false.
3722 // The subexpression does not have side effects. 3722 // The subexpression does not have side effects.
3723 context()->Plug(false); 3723 context()->Plug(false);
3724 } else { 3724 } else if (prop != NULL) {
3725 // Property or variable reference. Call the delete builtin with 3725 if (prop->is_synthetic()) {
3726 // object and property name as arguments. 3726 // Result of deleting parameters is false, even when they rewrite
3727 if (prop != NULL) { 3727 // to accesses on the arguments object.
3728 context()->Plug(false);
3729 } else {
3728 VisitForStackValue(prop->obj()); 3730 VisitForStackValue(prop->obj());
3729 VisitForStackValue(prop->key()); 3731 VisitForStackValue(prop->key());
3730 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); 3732 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
3731 } else if (var->is_global()) { 3733 context()->Plug(eax);
3732 __ push(GlobalObjectOperand());
3733 __ push(Immediate(var->name()));
3734 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
3735 } else {
3736 // Non-global variable. Call the runtime to delete from the
3737 // context where the variable was introduced.
3738 __ push(context_register());
3739 __ push(Immediate(var->name()));
3740 __ CallRuntime(Runtime::kDeleteContextSlot, 2);
3741 } 3734 }
3735 } else if (var->is_global()) {
3736 __ push(GlobalObjectOperand());
3737 __ push(Immediate(var->name()));
3738 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
3739 context()->Plug(eax);
3740 } else {
3741 // Non-global variable. Call the runtime to try to delete from the
3742 // context where the variable was introduced.
3743 __ push(context_register());
3744 __ push(Immediate(var->name()));
3745 __ CallRuntime(Runtime::kDeleteContextSlot, 2);
3742 context()->Plug(eax); 3746 context()->Plug(eax);
3743 } 3747 }
3744 break; 3748 break;
3745 } 3749 }
3746 3750
3747 case Token::VOID: { 3751 case Token::VOID: {
3748 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); 3752 Comment cmnt(masm_, "[ UnaryOperation (VOID)");
3749 VisitForEffect(expr->expression()); 3753 VisitForEffect(expr->expression());
3750 context()->Plug(Factory::undefined_value()); 3754 context()->Plug(Factory::undefined_value());
3751 break; 3755 break;
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
4401 // And return. 4405 // And return.
4402 __ ret(0); 4406 __ ret(0);
4403 } 4407 }
4404 4408
4405 4409
4406 #undef __ 4410 #undef __
4407 4411
4408 } } // namespace v8::internal 4412 } } // namespace v8::internal
4409 4413
4410 #endif // V8_TARGET_ARCH_IA32 4414 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698