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

Side by Side Diff: src/stub-cache.cc

Issue 149324: * Move almost all roots into an array ready for use by a constant-pool... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 5 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
« src/mark-compact.cc ('K') | « src/spaces.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 ASSERT_EQ(flags, Code::cast(code)->flags()); 555 ASSERT_EQ(flags, Code::cast(code)->flags());
556 LOG(CodeCreateEvent(Logger::CALL_IC_TAG, Code::cast(code), name)); 556 LOG(CodeCreateEvent(Logger::CALL_IC_TAG, Code::cast(code), name));
557 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code)); 557 Object* result = receiver->map()->UpdateCodeCache(name, Code::cast(code));
558 if (result->IsFailure()) return code; 558 if (result->IsFailure()) return code;
559 } 559 }
560 return Set(name, receiver->map(), Code::cast(code)); 560 return Set(name, receiver->map(), Code::cast(code));
561 } 561 }
562 562
563 563
564 static Object* GetProbeValue(Code::Flags flags) { 564 static Object* GetProbeValue(Code::Flags flags) {
565 NumberDictionary* dictionary = Heap::non_monomorphic_cache(); 565 // Use raw_unchecked... so we don't get assert failures during GC.
566 NumberDictionary* dictionary = Heap::raw_unchecked_non_monomorphic_cache();
566 int entry = dictionary->FindEntry(flags); 567 int entry = dictionary->FindEntry(flags);
567 if (entry != -1) return dictionary->ValueAt(entry); 568 if (entry != -1) return dictionary->ValueAt(entry);
568 return Heap::undefined_value(); 569 return Heap::raw_unchecked_undefined_value();
569 } 570 }
570 571
571 572
572 static Object* ProbeCache(Code::Flags flags) { 573 static Object* ProbeCache(Code::Flags flags) {
573 Object* probe = GetProbeValue(flags); 574 Object* probe = GetProbeValue(flags);
574 if (probe != Heap::undefined_value()) return probe; 575 if (probe != Heap::undefined_value()) return probe;
575 // Seed the cache with an undefined value to make sure that any 576 // Seed the cache with an undefined value to make sure that any
576 // generated code object can always be inserted into the cache 577 // generated code object can always be inserted into the cache
577 // without causing allocation failures. 578 // without causing allocation failures.
578 Object* result = 579 Object* result =
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 int argc = arguments_.immediate(); 999 int argc = arguments_.immediate();
999 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::CALL_IC, 1000 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::CALL_IC,
1000 type, 1001 type,
1001 in_loop_, 1002 in_loop_,
1002 argc); 1003 argc);
1003 return GetCodeWithFlags(flags, name); 1004 return GetCodeWithFlags(flags, name);
1004 } 1005 }
1005 1006
1006 1007
1007 } } // namespace v8::internal 1008 } } // namespace v8::internal
OLDNEW
« src/mark-compact.cc ('K') | « src/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698