| 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 2970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2981 // The subexpression may have side effects. | 2981 // The subexpression may have side effects. |
| 2982 VisitForEffect(expr->expression()); | 2982 VisitForEffect(expr->expression()); |
| 2983 context()->Plug(true); | 2983 context()->Plug(true); |
| 2984 } else if (var != NULL && | 2984 } else if (var != NULL && |
| 2985 !var->is_global() && | 2985 !var->is_global() && |
| 2986 var->AsSlot() != NULL && | 2986 var->AsSlot() != NULL && |
| 2987 var->AsSlot()->type() != Slot::LOOKUP) { | 2987 var->AsSlot()->type() != Slot::LOOKUP) { |
| 2988 // Result of deleting non-global, non-dynamic variables is false. | 2988 // Result of deleting non-global, non-dynamic variables is false. |
| 2989 // The subexpression does not have side effects. | 2989 // The subexpression does not have side effects. |
| 2990 context()->Plug(false); | 2990 context()->Plug(false); |
| 2991 } else { | 2991 } else if (prop != NULL) { |
| 2992 // Property or variable reference. Call the delete builtin with | 2992 if (prop->is_synthetic()) { |
| 2993 // object and property name as arguments. | 2993 // Result of deleting parameters is false, even when they rewrite |
| 2994 if (prop != NULL) { | 2994 // to accesses on the arguments object. |
| 2995 context()->Plug(false); |
| 2996 } else { |
| 2995 VisitForStackValue(prop->obj()); | 2997 VisitForStackValue(prop->obj()); |
| 2996 VisitForStackValue(prop->key()); | 2998 VisitForStackValue(prop->key()); |
| 2997 __ InvokeBuiltin(Builtins::DELETE, CALL_JS); | 2999 __ InvokeBuiltin(Builtins::DELETE, CALL_JS); |
| 2998 } else if (var->is_global()) { | 3000 context()->Plug(r0); |
| 2999 __ ldr(r1, GlobalObjectOperand()); | |
| 3000 __ mov(r0, Operand(var->name())); | |
| 3001 __ Push(r1, r0); | |
| 3002 __ InvokeBuiltin(Builtins::DELETE, CALL_JS); | |
| 3003 } else { | |
| 3004 // Non-global variable. Call the runtime to delete from the | |
| 3005 // context where the variable was introduced. | |
| 3006 __ push(context_register()); | |
| 3007 __ mov(r2, Operand(var->name())); | |
| 3008 __ push(r2); | |
| 3009 __ CallRuntime(Runtime::kDeleteContextSlot, 2); | |
| 3010 } | 3001 } |
| 3002 } else if (var->is_global()) { |
| 3003 __ ldr(r1, GlobalObjectOperand()); |
| 3004 __ mov(r0, Operand(var->name())); |
| 3005 __ Push(r1, r0); |
| 3006 __ InvokeBuiltin(Builtins::DELETE, CALL_JS); |
| 3007 context()->Plug(r0); |
| 3008 } else { |
| 3009 // Non-global variable. Call the runtime to try to delete from the |
| 3010 // context where the variable was introduced. |
| 3011 __ push(context_register()); |
| 3012 __ mov(r2, Operand(var->name())); |
| 3013 __ push(r2); |
| 3014 __ CallRuntime(Runtime::kDeleteContextSlot, 2); |
| 3011 context()->Plug(r0); | 3015 context()->Plug(r0); |
| 3012 } | 3016 } |
| 3013 break; | 3017 break; |
| 3014 } | 3018 } |
| 3015 | 3019 |
| 3016 case Token::VOID: { | 3020 case Token::VOID: { |
| 3017 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); | 3021 Comment cmnt(masm_, "[ UnaryOperation (VOID)"); |
| 3018 VisitForEffect(expr->expression()); | 3022 VisitForEffect(expr->expression()); |
| 3019 context()->Plug(Heap::kUndefinedValueRootIndex); | 3023 context()->Plug(Heap::kUndefinedValueRootIndex); |
| 3020 break; | 3024 break; |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3613 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 3617 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
| 3614 __ add(pc, r1, Operand(masm_->CodeObject())); | 3618 __ add(pc, r1, Operand(masm_->CodeObject())); |
| 3615 } | 3619 } |
| 3616 | 3620 |
| 3617 | 3621 |
| 3618 #undef __ | 3622 #undef __ |
| 3619 | 3623 |
| 3620 } } // namespace v8::internal | 3624 } } // namespace v8::internal |
| 3621 | 3625 |
| 3622 #endif // V8_TARGET_ARCH_ARM | 3626 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |