| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 8461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8472 new(zone()) HCallNew(context, function, argument_count)); | 8472 new(zone()) HCallNew(context, function, argument_count)); |
| 8473 call->set_position(expr->position()); | 8473 call->set_position(expr->position()); |
| 8474 return ast_context()->ReturnInstruction(call, expr->id()); | 8474 return ast_context()->ReturnInstruction(call, expr->id()); |
| 8475 } else { | 8475 } else { |
| 8476 // The constructor function is both an operand to the instruction and an | 8476 // The constructor function is both an operand to the instruction and an |
| 8477 // argument to the construct call. | 8477 // argument to the construct call. |
| 8478 CHECK_ALIVE(VisitArgument(expr->expression())); | 8478 CHECK_ALIVE(VisitArgument(expr->expression())); |
| 8479 HValue* constructor = HPushArgument::cast(Top())->argument(); | 8479 HValue* constructor = HPushArgument::cast(Top())->argument(); |
| 8480 CHECK_ALIVE(VisitArgumentList(expr->arguments())); | 8480 CHECK_ALIVE(VisitArgumentList(expr->arguments())); |
| 8481 HCallNew* call; | 8481 HCallNew* call; |
| 8482 if (!(expr->target().is_null()) && | 8482 if (FLAG_optimize_constructed_arrays && |
| 8483 !(expr->target().is_null()) && |
| 8483 *(expr->target()) == isolate()->global_context()->array_function()) { | 8484 *(expr->target()) == isolate()->global_context()->array_function()) { |
| 8484 Handle<Object> feedback = oracle()->GetInfo(expr->CallNewFeedbackId()); | 8485 Handle<Object> feedback = oracle()->GetInfo(expr->CallNewFeedbackId()); |
| 8485 ASSERT(feedback->IsSmi()); | 8486 ASSERT(feedback->IsSmi()); |
| 8486 Handle<JSGlobalPropertyCell> cell = | 8487 Handle<JSGlobalPropertyCell> cell = |
| 8487 isolate()->factory()->NewJSGlobalPropertyCell(feedback); | 8488 isolate()->factory()->NewJSGlobalPropertyCell(feedback); |
| 8488 AddInstruction(new(zone()) HCheckFunction(constructor, | 8489 AddInstruction(new(zone()) HCheckFunction(constructor, |
| 8489 Handle<JSFunction>(isolate()->global_context()->array_function()))); | 8490 Handle<JSFunction>(isolate()->global_context()->array_function()))); |
| 8490 call = new(zone()) HCallNewArray(context, constructor, argument_count, | 8491 call = new(zone()) HCallNewArray(context, constructor, argument_count, |
| 8491 cell); | 8492 cell); |
| 8492 } else { | 8493 } else { |
| (...skipping 2313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10806 } | 10807 } |
| 10807 } | 10808 } |
| 10808 | 10809 |
| 10809 #ifdef DEBUG | 10810 #ifdef DEBUG |
| 10810 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 10811 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 10811 if (allocator_ != NULL) allocator_->Verify(); | 10812 if (allocator_ != NULL) allocator_->Verify(); |
| 10812 #endif | 10813 #endif |
| 10813 } | 10814 } |
| 10814 | 10815 |
| 10815 } } // namespace v8::internal | 10816 } } // namespace v8::internal |
| OLD | NEW |