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

Side by Side Diff: src/hydrogen.cc

Issue 9370019: Implement inlined object allocation in Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Vyacheslav Egorov. Created 8 years, 9 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/ia32/lithium-codegen-ia32.cc » ('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 5872 matching lines...) Expand 10 before | Expand all | Expand 10 after
5883 expr->IsMonomorphic() && 5883 expr->IsMonomorphic() &&
5884 IsAllocationInlineable(expr->target())) { 5884 IsAllocationInlineable(expr->target())) {
5885 // The constructor function is on the stack in the unoptimized code 5885 // The constructor function is on the stack in the unoptimized code
5886 // during evaluation of the arguments. 5886 // during evaluation of the arguments.
5887 CHECK_ALIVE(VisitForValue(expr->expression())); 5887 CHECK_ALIVE(VisitForValue(expr->expression()));
5888 HValue* function = Top(); 5888 HValue* function = Top();
5889 CHECK_ALIVE(VisitExpressions(expr->arguments())); 5889 CHECK_ALIVE(VisitExpressions(expr->arguments()));
5890 Handle<JSFunction> constructor = expr->target(); 5890 Handle<JSFunction> constructor = expr->target();
5891 AddInstruction(new(zone()) HCheckFunction(function, constructor)); 5891 AddInstruction(new(zone()) HCheckFunction(function, constructor));
5892 5892
5893 // Force completion of inobject slack tracking before generating
5894 // allocation code to finalize instance size.
5895 if (constructor->shared()->IsInobjectSlackTrackingInProgress()) {
5896 constructor->shared()->CompleteInobjectSlackTracking();
5897 }
5898
5893 // Replace the constructor function with a newly allocated receiver. 5899 // Replace the constructor function with a newly allocated receiver.
5894 HInstruction* receiver = new(zone()) HAllocateObject(context, constructor); 5900 HInstruction* receiver = new(zone()) HAllocateObject(context, constructor);
5895 // Index of the receiver from the top of the expression stack. 5901 // Index of the receiver from the top of the expression stack.
5896 const int receiver_index = argument_count - 1; 5902 const int receiver_index = argument_count - 1;
5897 AddInstruction(receiver); 5903 AddInstruction(receiver);
5898 ASSERT(environment()->ExpressionStackAt(receiver_index) == function); 5904 ASSERT(environment()->ExpressionStackAt(receiver_index) == function);
5899 environment()->SetExpressionStackAt(receiver_index, receiver); 5905 environment()->SetExpressionStackAt(receiver_index, receiver);
5900 5906
5901 if (TryInlineConstruct(expr, receiver)) return; 5907 if (TryInlineConstruct(expr, receiver)) return;
5902 5908
(...skipping 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after
8019 } 8025 }
8020 } 8026 }
8021 8027
8022 #ifdef DEBUG 8028 #ifdef DEBUG
8023 if (graph_ != NULL) graph_->Verify(false); // No full verify. 8029 if (graph_ != NULL) graph_->Verify(false); // No full verify.
8024 if (allocator_ != NULL) allocator_->Verify(); 8030 if (allocator_ != NULL) allocator_->Verify();
8025 #endif 8031 #endif
8026 } 8032 }
8027 8033
8028 } } // namespace v8::internal 8034 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698