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

Side by Side Diff: test/cctest/test-heap.cc

Issue 24512003: Reset IC to premonomorphic rather than uninitialized. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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/ic.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 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 2804 matching lines...) Expand 10 before | Expand all | Expand 10 after
2815 2815
2816 Code* ic_before = FindFirstIC(f->shared()->code(), Code::LOAD_IC); 2816 Code* ic_before = FindFirstIC(f->shared()->code(), Code::LOAD_IC);
2817 CHECK(ic_before->ic_state() == MONOMORPHIC); 2817 CHECK(ic_before->ic_state() == MONOMORPHIC);
2818 2818
2819 // Fire context dispose notification. 2819 // Fire context dispose notification.
2820 v8::V8::ContextDisposedNotification(); 2820 v8::V8::ContextDisposedNotification();
2821 SimulateIncrementalMarking(); 2821 SimulateIncrementalMarking();
2822 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags); 2822 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags);
2823 2823
2824 Code* ic_after = FindFirstIC(f->shared()->code(), Code::LOAD_IC); 2824 Code* ic_after = FindFirstIC(f->shared()->code(), Code::LOAD_IC);
2825 CHECK(ic_after->ic_state() == UNINITIALIZED); 2825 CHECK(IC::IsCleared(ic_after));
2826 } 2826 }
2827 2827
2828 2828
2829 TEST(IncrementalMarkingClearsPolymorhpicIC) { 2829 TEST(IncrementalMarkingClearsPolymorhpicIC) {
2830 if (i::FLAG_always_opt) return; 2830 if (i::FLAG_always_opt) return;
2831 CcTest::InitializeVM(); 2831 CcTest::InitializeVM();
2832 v8::HandleScope scope(CcTest::isolate()); 2832 v8::HandleScope scope(CcTest::isolate());
2833 v8::Local<v8::Value> obj1, obj2; 2833 v8::Local<v8::Value> obj1, obj2;
2834 2834
2835 { 2835 {
(...skipping 20 matching lines...) Expand all
2856 2856
2857 Code* ic_before = FindFirstIC(f->shared()->code(), Code::LOAD_IC); 2857 Code* ic_before = FindFirstIC(f->shared()->code(), Code::LOAD_IC);
2858 CHECK(ic_before->ic_state() == POLYMORPHIC); 2858 CHECK(ic_before->ic_state() == POLYMORPHIC);
2859 2859
2860 // Fire context dispose notification. 2860 // Fire context dispose notification.
2861 v8::V8::ContextDisposedNotification(); 2861 v8::V8::ContextDisposedNotification();
2862 SimulateIncrementalMarking(); 2862 SimulateIncrementalMarking();
2863 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags); 2863 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags);
2864 2864
2865 Code* ic_after = FindFirstIC(f->shared()->code(), Code::LOAD_IC); 2865 Code* ic_after = FindFirstIC(f->shared()->code(), Code::LOAD_IC);
2866 CHECK(ic_after->ic_state() == UNINITIALIZED); 2866 CHECK(IC::IsCleared(ic_after));
2867 } 2867 }
2868 2868
2869 2869
2870 class SourceResource: public v8::String::ExternalAsciiStringResource { 2870 class SourceResource: public v8::String::ExternalAsciiStringResource {
2871 public: 2871 public:
2872 explicit SourceResource(const char* data) 2872 explicit SourceResource(const char* data)
2873 : data_(data), length_(strlen(data)) { } 2873 : data_(data), length_(strlen(data)) { }
2874 2874
2875 virtual void Dispose() { 2875 virtual void Dispose() {
2876 i::DeleteArray(data_); 2876 i::DeleteArray(data_);
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
3440 " var a = new Array(n);" 3440 " var a = new Array(n);"
3441 " for (var i = 0; i < n; i += 100) a[i] = i;" 3441 " for (var i = 0; i < n; i += 100) a[i] = i;"
3442 "};" 3442 "};"
3443 "f(10 * 1024 * 1024);"); 3443 "f(10 * 1024 * 1024);");
3444 IncrementalMarking* marking = CcTest::heap()->incremental_marking(); 3444 IncrementalMarking* marking = CcTest::heap()->incremental_marking();
3445 if (marking->IsStopped()) marking->Start(); 3445 if (marking->IsStopped()) marking->Start();
3446 // This big step should be sufficient to mark the whole array. 3446 // This big step should be sufficient to mark the whole array.
3447 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); 3447 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD);
3448 ASSERT(marking->IsComplete()); 3448 ASSERT(marking->IsComplete());
3449 } 3449 }
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698