| 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 4619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4630 HValue* value = Pop(); | 4630 HValue* value = Pop(); |
| 4631 HInstruction* instr = new(zone()) HMul(value, graph_->GetConstant1()); | 4631 HInstruction* instr = new(zone()) HMul(value, graph_->GetConstant1()); |
| 4632 ast_context()->ReturnInstruction(instr, expr->id()); | 4632 ast_context()->ReturnInstruction(instr, expr->id()); |
| 4633 } | 4633 } |
| 4634 | 4634 |
| 4635 | 4635 |
| 4636 void HGraphBuilder::VisitSub(UnaryOperation* expr) { | 4636 void HGraphBuilder::VisitSub(UnaryOperation* expr) { |
| 4637 CHECK_ALIVE(VisitForValue(expr->expression())); | 4637 CHECK_ALIVE(VisitForValue(expr->expression())); |
| 4638 HValue* value = Pop(); | 4638 HValue* value = Pop(); |
| 4639 HInstruction* instr = new(zone()) HMul(value, graph_->GetConstantMinus1()); | 4639 HInstruction* instr = new(zone()) HMul(value, graph_->GetConstantMinus1()); |
| 4640 | |
| 4641 Representation rep = ToRepresentation(oracle()->UnaryType(expr)); | |
| 4642 AssumeRepresentation(instr, rep); | |
| 4643 | |
| 4644 ast_context()->ReturnInstruction(instr, expr->id()); | 4640 ast_context()->ReturnInstruction(instr, expr->id()); |
| 4645 } | 4641 } |
| 4646 | 4642 |
| 4647 | 4643 |
| 4648 void HGraphBuilder::VisitBitNot(UnaryOperation* expr) { | 4644 void HGraphBuilder::VisitBitNot(UnaryOperation* expr) { |
| 4649 CHECK_ALIVE(VisitForValue(expr->expression())); | 4645 CHECK_ALIVE(VisitForValue(expr->expression())); |
| 4650 HValue* value = Pop(); | 4646 HValue* value = Pop(); |
| 4651 HInstruction* instr = new(zone()) HBitNot(value); | 4647 HInstruction* instr = new(zone()) HBitNot(value); |
| 4652 ast_context()->ReturnInstruction(instr, expr->id()); | 4648 ast_context()->ReturnInstruction(instr, expr->id()); |
| 4653 } | 4649 } |
| (...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6117 } | 6113 } |
| 6118 } | 6114 } |
| 6119 | 6115 |
| 6120 #ifdef DEBUG | 6116 #ifdef DEBUG |
| 6121 if (graph_ != NULL) graph_->Verify(); | 6117 if (graph_ != NULL) graph_->Verify(); |
| 6122 if (allocator_ != NULL) allocator_->Verify(); | 6118 if (allocator_ != NULL) allocator_->Verify(); |
| 6123 #endif | 6119 #endif |
| 6124 } | 6120 } |
| 6125 | 6121 |
| 6126 } } // namespace v8::internal | 6122 } } // namespace v8::internal |
| OLD | NEW |