| 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 8320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8331 HInstruction* call = PreProcessCall( | 8331 HInstruction* call = PreProcessCall( |
| 8332 new(zone()) HCallNew(context, function, argument_count)); | 8332 new(zone()) HCallNew(context, function, argument_count)); |
| 8333 call->set_position(expr->position()); | 8333 call->set_position(expr->position()); |
| 8334 return ast_context()->ReturnInstruction(call, expr->id()); | 8334 return ast_context()->ReturnInstruction(call, expr->id()); |
| 8335 } else { | 8335 } else { |
| 8336 // The constructor function is both an operand to the instruction and an | 8336 // The constructor function is both an operand to the instruction and an |
| 8337 // argument to the construct call. | 8337 // argument to the construct call. |
| 8338 CHECK_ALIVE(VisitArgument(expr->expression())); | 8338 CHECK_ALIVE(VisitArgument(expr->expression())); |
| 8339 HValue* constructor = HPushArgument::cast(Top())->argument(); | 8339 HValue* constructor = HPushArgument::cast(Top())->argument(); |
| 8340 CHECK_ALIVE(VisitArgumentList(expr->arguments())); | 8340 CHECK_ALIVE(VisitArgumentList(expr->arguments())); |
| 8341 HInstruction* call = | 8341 HCallNew* call; |
| 8342 new(zone()) HCallNew(context, constructor, argument_count); | 8342 if (!(expr->target().is_null()) && |
| 8343 *(expr->target()) == isolate()->global_context()->array_function()) { |
| 8344 Handle<Object> feedback = oracle()->GetInfo(expr->CallNewFeedbackId()); |
| 8345 ASSERT(feedback->IsSmi()); |
| 8346 Handle<JSGlobalPropertyCell> cell = |
| 8347 isolate()->factory()->NewJSGlobalPropertyCell(feedback); |
| 8348 AddInstruction(new(zone()) HCheckFunction(constructor, |
| 8349 Handle<JSFunction>(isolate()->global_context()->array_function()))); |
| 8350 call = new(zone()) HCallNewArray(context, constructor, argument_count, |
| 8351 cell); |
| 8352 } else { |
| 8353 call = new(zone()) HCallNew(context, constructor, argument_count); |
| 8354 } |
| 8343 Drop(argument_count); | 8355 Drop(argument_count); |
| 8344 call->set_position(expr->position()); | 8356 call->set_position(expr->position()); |
| 8345 return ast_context()->ReturnInstruction(call, expr->id()); | 8357 return ast_context()->ReturnInstruction(call, expr->id()); |
| 8346 } | 8358 } |
| 8347 } | 8359 } |
| 8348 | 8360 |
| 8349 | 8361 |
| 8350 // Support for generating inlined runtime functions. | 8362 // Support for generating inlined runtime functions. |
| 8351 | 8363 |
| 8352 // Lookup table for generators for runtime calls that are generated inline. | 8364 // Lookup table for generators for runtime calls that are generated inline. |
| (...skipping 2278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10631 } | 10643 } |
| 10632 } | 10644 } |
| 10633 | 10645 |
| 10634 #ifdef DEBUG | 10646 #ifdef DEBUG |
| 10635 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 10647 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 10636 if (allocator_ != NULL) allocator_->Verify(); | 10648 if (allocator_ != NULL) allocator_->Verify(); |
| 10637 #endif | 10649 #endif |
| 10638 } | 10650 } |
| 10639 | 10651 |
| 10640 } } // namespace v8::internal | 10652 } } // namespace v8::internal |
| OLD | NEW |