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

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

Issue 6280013: Fix a bug in delete for lookup slots. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 11 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
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 2988 matching lines...) Expand 10 before | Expand all | Expand 10 after
2999 var->AsSlot()->type() != Slot::LOOKUP) { 2999 var->AsSlot()->type() != Slot::LOOKUP) {
3000 // Result of deleting non-global, non-dynamic variables is false. 3000 // Result of deleting non-global, non-dynamic variables is false.
3001 // The subexpression does not have side effects. 3001 // The subexpression does not have side effects.
3002 context()->Plug(false); 3002 context()->Plug(false);
3003 } else { 3003 } else {
3004 // Property or variable reference. Call the delete builtin with 3004 // Property or variable reference. Call the delete builtin with
3005 // object and property name as arguments. 3005 // object and property name as arguments.
3006 if (prop != NULL) { 3006 if (prop != NULL) {
3007 VisitForStackValue(prop->obj()); 3007 VisitForStackValue(prop->obj());
3008 VisitForStackValue(prop->key()); 3008 VisitForStackValue(prop->key());
3009 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
3009 } else if (var->is_global()) { 3010 } else if (var->is_global()) {
3010 __ push(GlobalObjectOperand()); 3011 __ push(GlobalObjectOperand());
3011 __ Push(var->name()); 3012 __ Push(var->name());
3013 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
3012 } else { 3014 } else {
3013 // Non-global variable. Call the runtime to look up the context 3015 // Non-global variable. Call the runtime to delete from the
3014 // where the variable was introduced. 3016 // context where the variable was introduced.
3015 __ push(context_register()); 3017 __ push(context_register());
3016 __ Push(var->name()); 3018 __ Push(var->name());
3017 __ CallRuntime(Runtime::kLookupContext, 2); 3019 __ CallRuntime(Runtime::kDeleteContextSlot, 2);
3018 __ push(rax);
3019 __ Push(var->name());
3020 } 3020 }
3021 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
3022 context()->Plug(rax); 3021 context()->Plug(rax);
3023 } 3022 }
3024 break; 3023 break;
3025 } 3024 }
3026 3025
3027 case Token::VOID: { 3026 case Token::VOID: {
3028 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); 3027 Comment cmnt(masm_, "[ UnaryOperation (VOID)");
3029 VisitForEffect(expr->expression()); 3028 VisitForEffect(expr->expression());
3030 context()->Plug(Heap::kUndefinedValueRootIndex); 3029 context()->Plug(Heap::kUndefinedValueRootIndex);
3031 break; 3030 break;
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
3643 __ ret(0); 3642 __ ret(0);
3644 } 3643 }
3645 3644
3646 3645
3647 #undef __ 3646 #undef __
3648 3647
3649 3648
3650 } } // namespace v8::internal 3649 } } // namespace v8::internal
3651 3650
3652 #endif // V8_TARGET_ARCH_X64 3651 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698