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 6010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6021 } | 6021 } |
6022 | 6022 |
6023 call->set_position(expr->position()); | 6023 call->set_position(expr->position()); |
6024 return ast_context()->ReturnInstruction(call, expr->id()); | 6024 return ast_context()->ReturnInstruction(call, expr->id()); |
6025 } | 6025 } |
6026 | 6026 |
6027 | 6027 |
6028 // Checks whether allocation using the given constructor can be inlined. | 6028 // Checks whether allocation using the given constructor can be inlined. |
6029 static bool IsAllocationInlineable(Handle<JSFunction> constructor) { | 6029 static bool IsAllocationInlineable(Handle<JSFunction> constructor) { |
6030 return constructor->has_initial_map() && | 6030 return constructor->has_initial_map() && |
6031 constructor->initial_map()->instance_type() == JS_OBJECT_TYPE; | 6031 constructor->initial_map()->instance_type() == JS_OBJECT_TYPE && |
| 6032 constructor->initial_map()->instance_size() < HAllocateObject::kMaxSize; |
6032 } | 6033 } |
6033 | 6034 |
6034 | 6035 |
6035 void HGraphBuilder::VisitCallNew(CallNew* expr) { | 6036 void HGraphBuilder::VisitCallNew(CallNew* expr) { |
6036 ASSERT(!HasStackOverflow()); | 6037 ASSERT(!HasStackOverflow()); |
6037 ASSERT(current_block() != NULL); | 6038 ASSERT(current_block() != NULL); |
6038 ASSERT(current_block()->HasPredecessor()); | 6039 ASSERT(current_block()->HasPredecessor()); |
6039 expr->RecordTypeFeedback(oracle()); | 6040 expr->RecordTypeFeedback(oracle()); |
6040 int argument_count = expr->arguments()->length() + 1; // Plus constructor. | 6041 int argument_count = expr->arguments()->length() + 1; // Plus constructor. |
6041 HValue* context = environment()->LookupContext(); | 6042 HValue* context = environment()->LookupContext(); |
(...skipping 2168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8210 } | 8211 } |
8211 } | 8212 } |
8212 | 8213 |
8213 #ifdef DEBUG | 8214 #ifdef DEBUG |
8214 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 8215 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
8215 if (allocator_ != NULL) allocator_->Verify(); | 8216 if (allocator_ != NULL) allocator_->Verify(); |
8216 #endif | 8217 #endif |
8217 } | 8218 } |
8218 | 8219 |
8219 } } // namespace v8::internal | 8220 } } // namespace v8::internal |
OLD | NEW |