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 3035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3046 // The subexpression may have side effects. | 3046 // The subexpression may have side effects. |
3047 VisitForEffect(expr->expression()); | 3047 VisitForEffect(expr->expression()); |
3048 context()->Plug(true); | 3048 context()->Plug(true); |
3049 } else if (var != NULL && | 3049 } else if (var != NULL && |
3050 !var->is_global() && | 3050 !var->is_global() && |
3051 var->AsSlot() != NULL && | 3051 var->AsSlot() != NULL && |
3052 var->AsSlot()->type() != Slot::LOOKUP) { | 3052 var->AsSlot()->type() != Slot::LOOKUP) { |
3053 // Result of deleting non-global, non-dynamic variables is false. | 3053 // Result of deleting non-global, non-dynamic variables is false. |
3054 // The subexpression does not have side effects. | 3054 // The subexpression does not have side effects. |
3055 context()->Plug(false); | 3055 context()->Plug(false); |
3056 } else { | 3056 } else if (prop != NULL) { |
3057 // Property or variable reference. Call the delete builtin with | 3057 if (prop->is_synthetic()) { |
3058 // object and property name as arguments. | 3058 // Result of deleting parameters is false, even when they rewrite |
3059 if (prop != NULL) { | 3059 // to accesses on the arguments object. |
| 3060 context()->Plug(false); |
| 3061 } else { |
3060 VisitForStackValue(prop->obj()); | 3062 VisitForStackValue(prop->obj()); |
3061 VisitForStackValue(prop->key()); | 3063 VisitForStackValue(prop->key()); |
3062 __ InvokeBuiltin(Builtins::DELETE, CALL_JS); | 3064 __ InvokeBuiltin(Builtins::DELETE, CALL_JS); |
3063 } else if (var->is_global()) { | 3065 context()->Plug(r0); |
3064 __ ldr(r1, GlobalObjectOperand()); | |
3065 __ mov(r0, Operand(var->name())); | |
3066 __ Push(r1, r0); | |
3067 __ InvokeBuiltin(Builtins::DELETE, CALL_JS); | |
3068 } else { | |
3069 // Non-global variable. Call the runtime to delete from the | |
3070 // context where the variable was introduced. | |
3071 __ push(context_register()); | |
3072 __ mov(r2, Operand(var->name())); | |
3073 __ push(r2); | |
3074 __ CallRuntime(Runtime::kDeleteContextSlot, 2); | |
3075 } | 3066 } |
| 3067 } else if (var->is_global()) { |
| 3068 __ ldr(r1, GlobalObjectOperand()); |
| 3069 __ mov(r0, Operand(var->name())); |
| 3070 __ Push(r1, r0); |
| 3071 __ InvokeBuiltin(Builtins::DELETE, CALL_JS); |
| 3072 context()->Plug(r0); |
| 3073 } else { |
| 3074 // Non-global variable. Call the runtime to try to delete from the |
| 3075 // context where the variable was introduced. |
| 3076 __ push(context_register()); |
| 3077 __ mov(r2, Operand(var->name())); |
| 3078 __ push(r2); |
| 3079 __ CallRuntime(Runtime::kDeleteContextSlot, 2); |
3076 context()->Plug(r0); | 3080 context()->Plug(r0); |
3077 } | 3081 } |
3078 break; | 3082 break; |
3079 } | 3083 } |
3080 | 3084 |
3081 case Token::VOID: { | 3085 case Token::VOID: { |
3082 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); | 3086 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); |
3083 VisitForEffect(expr->expression()); | 3087 VisitForEffect(expr->expression()); |
3084 context()->Plug(Heap::kUndefinedValueRootIndex); | 3088 context()->Plug(Heap::kUndefinedValueRootIndex); |
3085 break; | 3089 break; |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3689 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 3693 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
3690 __ add(pc, r1, Operand(masm_->CodeObject())); | 3694 __ add(pc, r1, Operand(masm_->CodeObject())); |
3691 } | 3695 } |
3692 | 3696 |
3693 | 3697 |
3694 #undef __ | 3698 #undef __ |
3695 | 3699 |
3696 } } // namespace v8::internal | 3700 } } // namespace v8::internal |
3697 | 3701 |
3698 #endif // V8_TARGET_ARCH_ARM | 3702 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |