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 3042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3053 // The subexpression may have side effects. | 3053 // The subexpression may have side effects. |
3054 VisitForEffect(expr->expression()); | 3054 VisitForEffect(expr->expression()); |
3055 context()->Plug(true); | 3055 context()->Plug(true); |
3056 } else if (var != NULL && | 3056 } else if (var != NULL && |
3057 !var->is_global() && | 3057 !var->is_global() && |
3058 var->AsSlot() != NULL && | 3058 var->AsSlot() != NULL && |
3059 var->AsSlot()->type() != Slot::LOOKUP) { | 3059 var->AsSlot()->type() != Slot::LOOKUP) { |
3060 // Result of deleting non-global, non-dynamic variables is false. | 3060 // Result of deleting non-global, non-dynamic variables is false. |
3061 // The subexpression does not have side effects. | 3061 // The subexpression does not have side effects. |
3062 context()->Plug(false); | 3062 context()->Plug(false); |
3063 } else { | 3063 } else if (prop != NULL) { |
3064 // Property or variable reference. Call the delete builtin with | 3064 if (prop->is_synthetic()) { |
3065 // object and property name as arguments. | 3065 // Result of deleting parameters is false, even when they rewrite |
3066 if (prop != NULL) { | 3066 // to accesses on the arguments object. |
| 3067 context()->Plug(false); |
| 3068 } else { |
3067 VisitForStackValue(prop->obj()); | 3069 VisitForStackValue(prop->obj()); |
3068 VisitForStackValue(prop->key()); | 3070 VisitForStackValue(prop->key()); |
3069 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | 3071 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
3070 } else if (var->is_global()) { | 3072 context()->Plug(rax); |
3071 __ push(GlobalObjectOperand()); | |
3072 __ Push(var->name()); | |
3073 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); | |
3074 } else { | |
3075 // Non-global variable. Call the runtime to delete from the | |
3076 // context where the variable was introduced. | |
3077 __ push(context_register()); | |
3078 __ Push(var->name()); | |
3079 __ CallRuntime(Runtime::kDeleteContextSlot, 2); | |
3080 } | 3073 } |
| 3074 } else if (var->is_global()) { |
| 3075 __ push(GlobalObjectOperand()); |
| 3076 __ Push(var->name()); |
| 3077 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); |
| 3078 context()->Plug(rax); |
| 3079 } else { |
| 3080 // Non-global variable. Call the runtime to try to delete from the |
| 3081 // context where the variable was introduced. |
| 3082 __ push(context_register()); |
| 3083 __ Push(var->name()); |
| 3084 __ CallRuntime(Runtime::kDeleteContextSlot, 2); |
3081 context()->Plug(rax); | 3085 context()->Plug(rax); |
3082 } | 3086 } |
3083 break; | 3087 break; |
3084 } | 3088 } |
3085 | 3089 |
3086 case Token::VOID: { | 3090 case Token::VOID: { |
3087 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); | 3091 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); |
3088 VisitForEffect(expr->expression()); | 3092 VisitForEffect(expr->expression()); |
3089 context()->Plug(Heap::kUndefinedValueRootIndex); | 3093 context()->Plug(Heap::kUndefinedValueRootIndex); |
3090 break; | 3094 break; |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3740 __ ret(0); | 3744 __ ret(0); |
3741 } | 3745 } |
3742 | 3746 |
3743 | 3747 |
3744 #undef __ | 3748 #undef __ |
3745 | 3749 |
3746 | 3750 |
3747 } } // namespace v8::internal | 3751 } } // namespace v8::internal |
3748 | 3752 |
3749 #endif // V8_TARGET_ARCH_X64 | 3753 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |