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

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

Issue 150168: Removed virtual behavior from Dictionaries. (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/objects.cc ('K') | « src/runtime.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 Dictionary* dictionary = Heap::non_monomorphic_cache(); 565 NumberDictionary* dictionary = Heap::non_monomorphic_cache();
566 int entry = dictionary->FindNumberEntry(flags); 566 int entry = dictionary->FindEntry(flags);
567 if (entry != -1) return dictionary->ValueAt(entry); 567 if (entry != -1) return dictionary->ValueAt(entry);
568 return Heap::undefined_value(); 568 return Heap::undefined_value();
569 } 569 }
570 570
571 571
572 static Object* ProbeCache(Code::Flags flags) { 572 static Object* ProbeCache(Code::Flags flags) {
573 Object* probe = GetProbeValue(flags); 573 Object* probe = GetProbeValue(flags);
574 if (probe != Heap::undefined_value()) return probe; 574 if (probe != Heap::undefined_value()) return probe;
575 // Seed the cache with an undefined value to make sure that any 575 // Seed the cache with an undefined value to make sure that any
576 // generated code object can always be inserted into the cache 576 // generated code object can always be inserted into the cache
577 // without causing allocation failures. 577 // without causing allocation failures.
578 Object* result = 578 Object* result =
579 Heap::non_monomorphic_cache()->AtNumberPut(flags, 579 Heap::non_monomorphic_cache()->AtNumberPut(flags,
580 Heap::undefined_value()); 580 Heap::undefined_value());
581 if (result->IsFailure()) return result; 581 if (result->IsFailure()) return result;
582 Heap::set_non_monomorphic_cache(Dictionary::cast(result)); 582 Heap::set_non_monomorphic_cache(NumberDictionary::cast(result));
583 return probe; 583 return probe;
584 } 584 }
585 585
586 586
587 static Object* FillCache(Object* code) { 587 static Object* FillCache(Object* code) {
588 if (code->IsCode()) { 588 if (code->IsCode()) {
589 int entry = 589 int entry =
590 Heap::non_monomorphic_cache()->FindNumberEntry( 590 Heap::non_monomorphic_cache()->FindEntry(
591 Code::cast(code)->flags()); 591 Code::cast(code)->flags());
592 // The entry must be present see comment in ProbeCache. 592 // The entry must be present see comment in ProbeCache.
593 ASSERT(entry != -1); 593 ASSERT(entry != -1);
594 ASSERT(Heap::non_monomorphic_cache()->ValueAt(entry) == 594 ASSERT(Heap::non_monomorphic_cache()->ValueAt(entry) ==
595 Heap::undefined_value()); 595 Heap::undefined_value());
596 Heap::non_monomorphic_cache()->ValueAtPut(entry, code); 596 Heap::non_monomorphic_cache()->ValueAtPut(entry, code);
597 CHECK(GetProbeValue(Code::cast(code)->flags()) == code); 597 CHECK(GetProbeValue(Code::cast(code)->flags()) == code);
598 } 598 }
599 return code; 599 return code;
600 } 600 }
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 int argc = arguments_.immediate(); 998 int argc = arguments_.immediate();
999 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::CALL_IC, 999 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::CALL_IC,
1000 type, 1000 type,
1001 in_loop_, 1001 in_loop_,
1002 argc); 1002 argc);
1003 return GetCodeWithFlags(flags, name); 1003 return GetCodeWithFlags(flags, name);
1004 } 1004 }
1005 1005
1006 1006
1007 } } // namespace v8::internal 1007 } } // namespace v8::internal
OLDNEW
« src/objects.cc ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698