| 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 4483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4494 VISIT_FOR_EFFECT(expr->expression()); | 4494 VISIT_FOR_EFFECT(expr->expression()); |
| 4495 ast_context()->ReturnValue(graph()->GetConstantTrue()); | 4495 ast_context()->ReturnValue(graph()->GetConstantTrue()); |
| 4496 } else if (var != NULL && | 4496 } else if (var != NULL && |
| 4497 !var->is_global() && | 4497 !var->is_global() && |
| 4498 var->AsSlot() != NULL && | 4498 var->AsSlot() != NULL && |
| 4499 var->AsSlot()->type() != Slot::LOOKUP) { | 4499 var->AsSlot()->type() != Slot::LOOKUP) { |
| 4500 // Result of deleting non-global, non-dynamic variables is false. | 4500 // Result of deleting non-global, non-dynamic variables is false. |
| 4501 // The subexpression does not have side effects. | 4501 // The subexpression does not have side effects. |
| 4502 ast_context()->ReturnValue(graph()->GetConstantFalse()); | 4502 ast_context()->ReturnValue(graph()->GetConstantFalse()); |
| 4503 } else if (prop != NULL) { | 4503 } else if (prop != NULL) { |
| 4504 if (prop->is_synthetic()) { | 4504 VISIT_FOR_VALUE(prop->obj()); |
| 4505 // Result of deleting parameters is false, even when they rewrite | 4505 VISIT_FOR_VALUE(prop->key()); |
| 4506 // to accesses on the arguments object. | 4506 HValue* key = Pop(); |
| 4507 ast_context()->ReturnValue(graph()->GetConstantFalse()); | 4507 HValue* obj = Pop(); |
| 4508 } else { | 4508 HDeleteProperty* instr = new HDeleteProperty(obj, key); |
| 4509 VISIT_FOR_VALUE(prop->obj()); | 4509 ast_context()->ReturnInstruction(instr, expr->id()); |
| 4510 VISIT_FOR_VALUE(prop->key()); | |
| 4511 HValue* key = Pop(); | |
| 4512 HValue* obj = Pop(); | |
| 4513 HDeleteProperty* instr = new HDeleteProperty(obj, key); | |
| 4514 ast_context()->ReturnInstruction(instr, expr->id()); | |
| 4515 } | |
| 4516 } else if (var->is_global()) { | 4510 } else if (var->is_global()) { |
| 4517 BAILOUT("delete with global variable"); | 4511 BAILOUT("delete with global variable"); |
| 4518 } else { | 4512 } else { |
| 4519 BAILOUT("delete with non-global variable"); | 4513 BAILOUT("delete with non-global variable"); |
| 4520 } | 4514 } |
| 4521 } else if (op == Token::NOT) { | 4515 } else if (op == Token::NOT) { |
| 4522 if (ast_context()->IsTest()) { | 4516 if (ast_context()->IsTest()) { |
| 4523 TestContext* context = TestContext::cast(ast_context()); | 4517 TestContext* context = TestContext::cast(ast_context()); |
| 4524 VisitForControl(expr->expression(), | 4518 VisitForControl(expr->expression(), |
| 4525 context->if_false(), | 4519 context->if_false(), |
| (...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5941 } | 5935 } |
| 5942 } | 5936 } |
| 5943 | 5937 |
| 5944 #ifdef DEBUG | 5938 #ifdef DEBUG |
| 5945 if (graph_ != NULL) graph_->Verify(); | 5939 if (graph_ != NULL) graph_->Verify(); |
| 5946 if (allocator_ != NULL) allocator_->Verify(); | 5940 if (allocator_ != NULL) allocator_->Verify(); |
| 5947 #endif | 5941 #endif |
| 5948 } | 5942 } |
| 5949 | 5943 |
| 5950 } } // namespace v8::internal | 5944 } } // namespace v8::internal |
| OLD | NEW |