| 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 5106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5117 result = new(zone()) HMul(context, left, left); | 5117 result = new(zone()) HMul(context, left, left); |
| 5118 } | 5118 } |
| 5119 | 5119 |
| 5120 if (result == NULL) { | 5120 if (result == NULL) { |
| 5121 result = new(zone()) HPower(left, right); | 5121 result = new(zone()) HPower(left, right); |
| 5122 } | 5122 } |
| 5123 ast_context()->ReturnInstruction(result, expr->id()); | 5123 ast_context()->ReturnInstruction(result, expr->id()); |
| 5124 return true; | 5124 return true; |
| 5125 } | 5125 } |
| 5126 break; | 5126 break; |
| 5127 case kMathMax: |
| 5128 case kMathMin: |
| 5129 if (argument_count == 3 && check_type == RECEIVER_MAP_CHECK) { |
| 5130 AddCheckConstantFunction(expr, receiver, receiver_map, true); |
| 5131 HValue* right = Pop(); |
| 5132 HValue* left = Pop(); |
| 5133 // Do not inline if the result representation is uncertain. |
| 5134 if (!right->representation().Equals(left->representation())) { |
| 5135 Push(left); |
| 5136 Push(right); |
| 5137 return false; |
| 5138 } |
| 5139 Pop(); // Pop receiver. |
| 5140 HInstruction* result = |
| 5141 new(zone()) HMathMinMax(left, right, id); |
| 5142 ast_context()->ReturnInstruction(result, expr->id()); |
| 5143 return true; |
| 5144 } |
| 5145 break; |
| 5127 default: | 5146 default: |
| 5128 // Not yet supported for inlining. | 5147 // Not yet supported for inlining. |
| 5129 break; | 5148 break; |
| 5130 } | 5149 } |
| 5131 return false; | 5150 return false; |
| 5132 } | 5151 } |
| 5133 | 5152 |
| 5134 | 5153 |
| 5135 bool HGraphBuilder::TryCallApply(Call* expr) { | 5154 bool HGraphBuilder::TryCallApply(Call* expr) { |
| 5136 Expression* callee = expr->expression(); | 5155 Expression* callee = expr->expression(); |
| (...skipping 2174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7311 } | 7330 } |
| 7312 } | 7331 } |
| 7313 | 7332 |
| 7314 #ifdef DEBUG | 7333 #ifdef DEBUG |
| 7315 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 7334 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 7316 if (allocator_ != NULL) allocator_->Verify(); | 7335 if (allocator_ != NULL) allocator_->Verify(); |
| 7317 #endif | 7336 #endif |
| 7318 } | 7337 } |
| 7319 | 7338 |
| 7320 } } // namespace v8::internal | 7339 } } // namespace v8::internal |
| OLD | NEW |