| OLD | NEW |
| 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 2987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2998 // The subexpression may have side effects. | 2998 // The subexpression may have side effects. |
| 2999 VisitForEffect(expr->expression()); | 2999 VisitForEffect(expr->expression()); |
| 3000 context()->Plug(true); | 3000 context()->Plug(true); |
| 3001 } else if (var != NULL && | 3001 } else if (var != NULL && |
| 3002 !var->is_global() && | 3002 !var->is_global() && |
| 3003 var->AsSlot() != NULL && | 3003 var->AsSlot() != NULL && |
| 3004 var->AsSlot()->type() != Slot::LOOKUP) { | 3004 var->AsSlot()->type() != Slot::LOOKUP) { |
| 3005 // Result of deleting non-global, non-dynamic variables is false. | 3005 // Result of deleting non-global, non-dynamic variables is false. |
| 3006 // The subexpression does not have side effects. | 3006 // The subexpression does not have side effects. |
| 3007 context()->Plug(false); | 3007 context()->Plug(false); |
| 3008 } else { | 3008 } else if (prop != NULL) { |
| 3009 // Property or variable reference. Call the delete builtin with | 3009 if (prop->is_synthetic()) { |
| 3010 // object and property name as arguments. | 3010 // Result of deleting parameters is false, even when they rewrite |
| 3011 if (prop != NULL) { | 3011 // to accesses on the arguments object. |
| 3012 context()->Plug(false); |
| 3013 } else { |
| 3012 VisitForStackValue(prop->obj()); | 3014 VisitForStackValue(prop->obj()); |
| 3013 VisitForStackValue(prop->key()); | 3015 VisitForStackValue(prop->key()); |
| 3014 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | 3016 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
| 3015 } else if (var->is_global()) { | 3017 context()->Plug(rax); |
| 3016 __ push(GlobalObjectOperand()); | |
| 3017 __ Push(var->name()); | |
| 3018 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | |
| 3019 } else { | |
| 3020 // Non-global variable. Call the runtime to delete from the | |
| 3021 // context where the variable was introduced. | |
| 3022 __ push(context_register()); | |
| 3023 __ Push(var->name()); | |
| 3024 __ CallRuntime(Runtime::kDeleteContextSlot, 2); | |
| 3025 } | 3018 } |
| 3019 } else if (var->is_global()) { |
| 3020 __ push(GlobalObjectOperand()); |
| 3021 __ Push(var->name()); |
| 3022 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
| 3023 context()->Plug(rax); |
| 3024 } else { |
| 3025 // Non-global variable. Call the runtime to try to delete from the |
| 3026 // context where the variable was introduced. |
| 3027 __ push(context_register()); |
| 3028 __ Push(var->name()); |
| 3029 __ CallRuntime(Runtime::kDeleteContextSlot, 2); |
| 3026 context()->Plug(rax); | 3030 context()->Plug(rax); |
| 3027 } | 3031 } |
| 3028 break; | 3032 break; |
| 3029 } | 3033 } |
| 3030 | 3034 |
| 3031 case Token::VOID: { | 3035 case Token::VOID: { |
| 3032 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); | 3036 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); |
| 3033 VisitForEffect(expr->expression()); | 3037 VisitForEffect(expr->expression()); |
| 3034 context()->Plug(Heap::kUndefinedValueRootIndex); | 3038 context()->Plug(Heap::kUndefinedValueRootIndex); |
| 3035 break; | 3039 break; |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3647 __ ret(0); | 3651 __ ret(0); |
| 3648 } | 3652 } |
| 3649 | 3653 |
| 3650 | 3654 |
| 3651 #undef __ | 3655 #undef __ |
| 3652 | 3656 |
| 3653 | 3657 |
| 3654 } } // namespace v8::internal | 3658 } } // namespace v8::internal |
| 3655 | 3659 |
| 3656 #endif // V8_TARGET_ARCH_X64 | 3660 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |