| 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 4553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4564 VISIT_FOR_EFFECT(expr->expression()); | 4564 VISIT_FOR_EFFECT(expr->expression()); |
| 4565 ast_context()->ReturnValue(graph()->GetConstantTrue()); | 4565 ast_context()->ReturnValue(graph()->GetConstantTrue()); |
| 4566 } else if (var != NULL && | 4566 } else if (var != NULL && |
| 4567 !var->is_global() && | 4567 !var->is_global() && |
| 4568 var->AsSlot() != NULL && | 4568 var->AsSlot() != NULL && |
| 4569 var->AsSlot()->type() != Slot::LOOKUP) { | 4569 var->AsSlot()->type() != Slot::LOOKUP) { |
| 4570 // Result of deleting non-global, non-dynamic variables is false. | 4570 // Result of deleting non-global, non-dynamic variables is false. |
| 4571 // The subexpression does not have side effects. | 4571 // The subexpression does not have side effects. |
| 4572 ast_context()->ReturnValue(graph()->GetConstantFalse()); | 4572 ast_context()->ReturnValue(graph()->GetConstantFalse()); |
| 4573 } else if (prop != NULL) { | 4573 } else if (prop != NULL) { |
| 4574 VISIT_FOR_VALUE(prop->obj()); | 4574 if (prop->is_synthetic()) { |
| 4575 VISIT_FOR_VALUE(prop->key()); | 4575 // Result of deleting parameters is false, even when they rewrite |
| 4576 HValue* key = Pop(); | 4576 // to accesses on the arguments object. |
| 4577 HValue* obj = Pop(); | 4577 ast_context()->ReturnValue(graph()->GetConstantFalse()); |
| 4578 ast_context()->ReturnInstruction(new HDeleteProperty(obj, key), | 4578 } else { |
| 4579 expr->id()); | 4579 VISIT_FOR_VALUE(prop->obj()); |
| 4580 VISIT_FOR_VALUE(prop->key()); |
| 4581 HValue* key = Pop(); |
| 4582 HValue* obj = Pop(); |
| 4583 HDeleteProperty* instr = new HDeleteProperty(obj, key); |
| 4584 ast_context()->ReturnInstruction(instr, expr->id()); |
| 4585 } |
| 4580 } else if (var->is_global()) { | 4586 } else if (var->is_global()) { |
| 4581 BAILOUT("delete with global variable"); | 4587 BAILOUT("delete with global variable"); |
| 4582 } else { | 4588 } else { |
| 4583 BAILOUT("delete with non-global variable"); | 4589 BAILOUT("delete with non-global variable"); |
| 4584 } | 4590 } |
| 4585 } else if (op == Token::NOT) { | 4591 } else if (op == Token::NOT) { |
| 4586 if (ast_context()->IsTest()) { | 4592 if (ast_context()->IsTest()) { |
| 4587 TestContext* context = TestContext::cast(ast_context()); | 4593 TestContext* context = TestContext::cast(ast_context()); |
| 4588 VisitForControl(expr->expression(), | 4594 VisitForControl(expr->expression(), |
| 4589 context->if_false(), | 4595 context->if_false(), |
| (...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5895 } | 5901 } |
| 5896 } | 5902 } |
| 5897 | 5903 |
| 5898 #ifdef DEBUG | 5904 #ifdef DEBUG |
| 5899 if (graph_ != NULL) graph_->Verify(); | 5905 if (graph_ != NULL) graph_->Verify(); |
| 5900 if (allocator_ != NULL) allocator_->Verify(); | 5906 if (allocator_ != NULL) allocator_->Verify(); |
| 5901 #endif | 5907 #endif |
| 5902 } | 5908 } |
| 5903 | 5909 |
| 5904 } } // namespace v8::internal | 5910 } } // namespace v8::internal |
| OLD | NEW |