| 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 4789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4800 // Our implementation of arguments (based on this stack frame or an | 4800 // Our implementation of arguments (based on this stack frame or an |
| 4801 // adapter below it) does not work for inlined functions. | 4801 // adapter below it) does not work for inlined functions. |
| 4802 if (function_state()->outer() != NULL) { | 4802 if (function_state()->outer() != NULL) { |
| 4803 Bailout("Function.prototype.apply optimization in inlined function"); | 4803 Bailout("Function.prototype.apply optimization in inlined function"); |
| 4804 return true; | 4804 return true; |
| 4805 } | 4805 } |
| 4806 | 4806 |
| 4807 // Found pattern f.apply(receiver, arguments). | 4807 // Found pattern f.apply(receiver, arguments). |
| 4808 VisitForValue(prop->obj()); | 4808 VisitForValue(prop->obj()); |
| 4809 if (HasStackOverflow() || current_block() == NULL) return true; | 4809 if (HasStackOverflow() || current_block() == NULL) return true; |
| 4810 HValue* function = Pop(); | 4810 HValue* function = Top(); |
| 4811 AddCheckConstantFunction(expr, function, function_map, true); |
| 4812 Drop(1); |
| 4813 |
| 4811 VisitForValue(args->at(0)); | 4814 VisitForValue(args->at(0)); |
| 4812 if (HasStackOverflow() || current_block() == NULL) return true; | 4815 if (HasStackOverflow() || current_block() == NULL) return true; |
| 4813 HValue* receiver = Pop(); | 4816 HValue* receiver = Pop(); |
| 4814 HInstruction* elements = AddInstruction(new(zone()) HArgumentsElements); | 4817 HInstruction* elements = AddInstruction(new(zone()) HArgumentsElements); |
| 4815 HInstruction* length = AddInstruction(new(zone()) HArgumentsLength(elements)); | 4818 HInstruction* length = AddInstruction(new(zone()) HArgumentsLength(elements)); |
| 4816 AddCheckConstantFunction(expr, function, function_map, true); | |
| 4817 HInstruction* result = | 4819 HInstruction* result = |
| 4818 new(zone()) HApplyArguments(function, receiver, length, elements); | 4820 new(zone()) HApplyArguments(function, receiver, length, elements); |
| 4819 result->set_position(expr->position()); | 4821 result->set_position(expr->position()); |
| 4820 ast_context()->ReturnInstruction(result, expr->id()); | 4822 ast_context()->ReturnInstruction(result, expr->id()); |
| 4821 return true; | 4823 return true; |
| 4822 } | 4824 } |
| 4823 | 4825 |
| 4824 | 4826 |
| 4825 void HGraphBuilder::VisitCall(Call* expr) { | 4827 void HGraphBuilder::VisitCall(Call* expr) { |
| 4826 ASSERT(!HasStackOverflow()); | 4828 ASSERT(!HasStackOverflow()); |
| (...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6760 } | 6762 } |
| 6761 } | 6763 } |
| 6762 | 6764 |
| 6763 #ifdef DEBUG | 6765 #ifdef DEBUG |
| 6764 if (graph_ != NULL) graph_->Verify(); | 6766 if (graph_ != NULL) graph_->Verify(); |
| 6765 if (allocator_ != NULL) allocator_->Verify(); | 6767 if (allocator_ != NULL) allocator_->Verify(); |
| 6766 #endif | 6768 #endif |
| 6767 } | 6769 } |
| 6768 | 6770 |
| 6769 } } // namespace v8::internal | 6771 } } // namespace v8::internal |
| OLD | NEW |