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 5056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5067 CHECK_ALIVE(VisitForEffect(expr->expression())); | 5067 CHECK_ALIVE(VisitForEffect(expr->expression())); |
5068 return ast_context()->ReturnValue(graph()->GetConstantTrue()); | 5068 return ast_context()->ReturnValue(graph()->GetConstantTrue()); |
5069 } else if (var != NULL && | 5069 } else if (var != NULL && |
5070 !var->is_global() && | 5070 !var->is_global() && |
5071 var->AsSlot() != NULL && | 5071 var->AsSlot() != NULL && |
5072 var->AsSlot()->type() != Slot::LOOKUP) { | 5072 var->AsSlot()->type() != Slot::LOOKUP) { |
5073 // Result of deleting non-global, non-dynamic variables is false. | 5073 // Result of deleting non-global, non-dynamic variables is false. |
5074 // The subexpression does not have side effects. | 5074 // The subexpression does not have side effects. |
5075 return ast_context()->ReturnValue(graph()->GetConstantFalse()); | 5075 return ast_context()->ReturnValue(graph()->GetConstantFalse()); |
5076 } else if (prop != NULL) { | 5076 } else if (prop != NULL) { |
5077 if (prop->is_synthetic()) { | 5077 CHECK_ALIVE(VisitForValue(prop->obj())); |
5078 // Result of deleting parameters is false, even when they rewrite | 5078 CHECK_ALIVE(VisitForValue(prop->key())); |
5079 // to accesses on the arguments object. | 5079 HValue* key = Pop(); |
5080 return ast_context()->ReturnValue(graph()->GetConstantFalse()); | 5080 HValue* obj = Pop(); |
5081 } else { | 5081 HValue* context = environment()->LookupContext(); |
5082 CHECK_ALIVE(VisitForValue(prop->obj())); | 5082 HDeleteProperty* instr = new(zone()) HDeleteProperty(context, obj, key); |
5083 CHECK_ALIVE(VisitForValue(prop->key())); | 5083 return ast_context()->ReturnInstruction(instr, expr->id()); |
5084 HValue* key = Pop(); | |
5085 HValue* obj = Pop(); | |
5086 HValue* context = environment()->LookupContext(); | |
5087 HDeleteProperty* instr = new(zone()) HDeleteProperty(context, obj, key); | |
5088 return ast_context()->ReturnInstruction(instr, expr->id()); | |
5089 } | |
5090 } else if (var->is_global()) { | 5084 } else if (var->is_global()) { |
5091 Bailout("delete with global variable"); | 5085 Bailout("delete with global variable"); |
5092 } else { | 5086 } else { |
5093 Bailout("delete with non-global variable"); | 5087 Bailout("delete with non-global variable"); |
5094 } | 5088 } |
5095 } | 5089 } |
5096 | 5090 |
5097 | 5091 |
5098 void HGraphBuilder::VisitVoid(UnaryOperation* expr) { | 5092 void HGraphBuilder::VisitVoid(UnaryOperation* expr) { |
5099 CHECK_ALIVE(VisitForEffect(expr->expression())); | 5093 CHECK_ALIVE(VisitForEffect(expr->expression())); |
(...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6751 } | 6745 } |
6752 } | 6746 } |
6753 | 6747 |
6754 #ifdef DEBUG | 6748 #ifdef DEBUG |
6755 if (graph_ != NULL) graph_->Verify(); | 6749 if (graph_ != NULL) graph_->Verify(); |
6756 if (allocator_ != NULL) allocator_->Verify(); | 6750 if (allocator_ != NULL) allocator_->Verify(); |
6757 #endif | 6751 #endif |
6758 } | 6752 } |
6759 | 6753 |
6760 } } // namespace v8::internal | 6754 } } // namespace v8::internal |
OLD | NEW |