Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(857)

Side by Side Diff: src/hydrogen.cc

Issue 10008007: Ensure HAllocateObject always allocates in new-space. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Improved test case to use small objects. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698