Index: src/codegen.cc |
=================================================================== |
--- src/codegen.cc (revision 2034) |
+++ src/codegen.cc (working copy) |
@@ -170,7 +170,9 @@ |
CodeDesc desc; |
cgen.masm()->GetCode(&desc); |
ZoneScopeInfo sinfo(flit->scope()); |
- Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); |
+ InlineCacheInLoop in_loop = |
+ (cgen.loop_nesting() != 0) ? IN_LOOP : NOT_IN_LOOP; |
+ Code::Flags flags = Code::ComputeFlags(Code::FUNCTION, in_loop); |
Handle<Code> code = Factory::NewCode(desc, |
&sinfo, |
flags, |
@@ -322,20 +324,21 @@ |
} |
-Handle<Code> CodeGenerator::ComputeCallInitialize(int argc) { |
- CALL_HEAP_FUNCTION(StubCache::ComputeCallInitialize(argc), Code); |
+Handle<Code> CodeGenerator::ComputeCallInitialize( |
+ int argc, |
+ InlineCacheInLoop in_loop) { |
+ if (in_loop) { |
Kevin Millikin (Chromium)
2009/05/25 11:00:42
My opinion is mixed about making these two value,
|
+ // Force the creation of the corresponding stub outside loops, |
+ // because it may be used when clearing the ICs later - it is |
+ // possible for a series of IC transitions to lose the in-loop |
+ // information, and the IC clearing code can't generate a stub |
+ // that it needs so we need to ensure it is generated already. |
+ ComputeCallInitialize(argc, NOT_IN_LOOP); |
+ } |
+ CALL_HEAP_FUNCTION(StubCache::ComputeCallInitialize(argc, in_loop), Code); |
} |
-Handle<Code> CodeGenerator::ComputeCallInitializeInLoop(int argc) { |
- // Force the creation of the corresponding stub outside loops, |
- // because it will be used when clearing the ICs later - when we |
- // don't know if we're inside a loop or not. |
- ComputeCallInitialize(argc); |
- CALL_HEAP_FUNCTION(StubCache::ComputeCallInitializeInLoop(argc), Code); |
-} |
- |
- |
void CodeGenerator::ProcessDeclarations(ZoneList<Declaration*>* declarations) { |
int length = declarations->length(); |
int globals = 0; |