| 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 8908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8919 // argument to the construct call. | 8919 // argument to the construct call. |
| 8920 bool use_call_new_array = FLAG_optimize_constructed_arrays && | 8920 bool use_call_new_array = FLAG_optimize_constructed_arrays && |
| 8921 !(expr->target().is_null()) && | 8921 !(expr->target().is_null()) && |
| 8922 *(expr->target()) == isolate()->global_context()->array_function(); | 8922 *(expr->target()) == isolate()->global_context()->array_function(); |
| 8923 | 8923 |
| 8924 CHECK_ALIVE(VisitArgument(expr->expression())); | 8924 CHECK_ALIVE(VisitArgument(expr->expression())); |
| 8925 HValue* constructor = HPushArgument::cast(Top())->argument(); | 8925 HValue* constructor = HPushArgument::cast(Top())->argument(); |
| 8926 CHECK_ALIVE(VisitArgumentList(expr->arguments())); | 8926 CHECK_ALIVE(VisitArgumentList(expr->arguments())); |
| 8927 HCallNew* call; | 8927 HCallNew* call; |
| 8928 if (use_call_new_array) { | 8928 if (use_call_new_array) { |
| 8929 // TODO(mvstanton): It would be better to use the already created global | 8929 Handle<JSGlobalPropertyCell> cell = expr->allocation_info_cell(); |
| 8930 // property cell that is shared by full code gen. That way, any transition | |
| 8931 // information that happened after crankshaft won't be lost. The right | |
| 8932 // way to do that is to begin passing the cell to the type feedback oracle | |
| 8933 // instead of just the value in the cell. Do this in a follow-up checkin. | |
| 8934 Handle<Smi> feedback = expr->allocation_elements_kind(); | |
| 8935 Handle<JSGlobalPropertyCell> cell = | |
| 8936 isolate()->factory()->NewJSGlobalPropertyCell(feedback); | |
| 8937 | |
| 8938 // TODO(mvstanton): Here we should probably insert code to check if the | |
| 8939 // type cell elements kind is different from when we compiled, and deopt | |
| 8940 // in that case. Do this in a follow-up checin. | |
| 8941 call = new(zone()) HCallNewArray(context, constructor, argument_count, | 8930 call = new(zone()) HCallNewArray(context, constructor, argument_count, |
| 8942 cell); | 8931 cell); |
| 8943 } else { | 8932 } else { |
| 8944 call = new(zone()) HCallNew(context, constructor, argument_count); | 8933 call = new(zone()) HCallNew(context, constructor, argument_count); |
| 8945 } | 8934 } |
| 8946 Drop(argument_count); | 8935 Drop(argument_count); |
| 8947 call->set_position(expr->position()); | 8936 call->set_position(expr->position()); |
| 8948 return ast_context()->ReturnInstruction(call, expr->id()); | 8937 return ast_context()->ReturnInstruction(call, expr->id()); |
| 8949 } | 8938 } |
| 8950 } | 8939 } |
| (...skipping 2659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11610 } | 11599 } |
| 11611 } | 11600 } |
| 11612 | 11601 |
| 11613 #ifdef DEBUG | 11602 #ifdef DEBUG |
| 11614 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 11603 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
| 11615 if (allocator_ != NULL) allocator_->Verify(); | 11604 if (allocator_ != NULL) allocator_->Verify(); |
| 11616 #endif | 11605 #endif |
| 11617 } | 11606 } |
| 11618 | 11607 |
| 11619 } } // namespace v8::internal | 11608 } } // namespace v8::internal |
| OLD | NEW |