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 4621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 4640 |
4641 Representation rep = ToRepresentation(oracle()->UnaryType(expr)); | 4641 Representation rep = ToRepresentation(oracle()->UnaryType(expr)); |
4642 PrintF("********************** Old: %s, New: %s\n", instr->representation().Mn
emonic(), rep.Mnemonic()); | |
4643 AssumeRepresentation(instr, rep); | 4642 AssumeRepresentation(instr, rep); |
4644 | 4643 |
4645 ast_context()->ReturnInstruction(instr, expr->id()); | 4644 ast_context()->ReturnInstruction(instr, expr->id()); |
4646 } | 4645 } |
4647 | 4646 |
4648 | 4647 |
4649 void HGraphBuilder::VisitBitNot(UnaryOperation* expr) { | 4648 void HGraphBuilder::VisitBitNot(UnaryOperation* expr) { |
4650 CHECK_ALIVE(VisitForValue(expr->expression())); | 4649 CHECK_ALIVE(VisitForValue(expr->expression())); |
4651 HValue* value = Pop(); | 4650 HValue* value = Pop(); |
4652 HInstruction* instr = new(zone()) HBitNot(value); | 4651 HInstruction* instr = new(zone()) HBitNot(value); |
(...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6118 } | 6117 } |
6119 } | 6118 } |
6120 | 6119 |
6121 #ifdef DEBUG | 6120 #ifdef DEBUG |
6122 if (graph_ != NULL) graph_->Verify(); | 6121 if (graph_ != NULL) graph_->Verify(); |
6123 if (allocator_ != NULL) allocator_->Verify(); | 6122 if (allocator_ != NULL) allocator_->Verify(); |
6124 #endif | 6123 #endif |
6125 } | 6124 } |
6126 | 6125 |
6127 } } // namespace v8::internal | 6126 } } // namespace v8::internal |
OLD | NEW |