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

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

Issue 178463007: Moved type feedback vector to SharedFunctionInfo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports and comment response. Created 6 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
« src/runtime.cc ('K') | « test/cctest/test-compiler.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 2837 matching lines...) Expand 10 before | Expand all | Expand 10 after
2848 // originating from two different native contexts. 2848 // originating from two different native contexts.
2849 CcTest::global()->Set(v8_str("fun1"), fun1); 2849 CcTest::global()->Set(v8_str("fun1"), fun1);
2850 CcTest::global()->Set(v8_str("fun2"), fun2); 2850 CcTest::global()->Set(v8_str("fun2"), fun2);
2851 CompileRun("function f(a, b) { a(); b(); } f(fun1, fun2);"); 2851 CompileRun("function f(a, b) { a(); b(); } f(fun1, fun2);");
2852 2852
2853 Handle<JSFunction> f = 2853 Handle<JSFunction> f =
2854 v8::Utils::OpenHandle( 2854 v8::Utils::OpenHandle(
2855 *v8::Handle<v8::Function>::Cast( 2855 *v8::Handle<v8::Function>::Cast(
2856 CcTest::global()->Get(v8_str("f")))); 2856 CcTest::global()->Get(v8_str("f"))));
2857 2857
2858 Handle<FixedArray> feedback_vector(TypeFeedbackInfo::cast( 2858 Handle<FixedArray> feedback_vector(f->shared()->feedback_vector());
2859 f->shared()->code()->type_feedback_info())->feedback_vector());
2860 2859
2861 CHECK_EQ(2, feedback_vector->length()); 2860 CHECK_EQ(2, feedback_vector->length());
2862 CHECK(feedback_vector->get(0)->IsJSFunction()); 2861 CHECK(feedback_vector->get(0)->IsJSFunction());
2863 CHECK(feedback_vector->get(1)->IsJSFunction()); 2862 CHECK(feedback_vector->get(1)->IsJSFunction());
2864 2863
2865 SimulateIncrementalMarking(); 2864 SimulateIncrementalMarking();
2866 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags); 2865 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags);
2867 2866
2868 CHECK_EQ(2, feedback_vector->length()); 2867 CHECK_EQ(2, feedback_vector->length());
2869 CHECK(feedback_vector->get(0)->IsTheHole()); 2868 CHECK(feedback_vector->get(0)->IsTheHole());
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
3681 code = scope.CloseAndEscape(Handle<Code>(bar->code())); 3680 code = scope.CloseAndEscape(Handle<Code>(bar->code()));
3682 } 3681 }
3683 3682
3684 // Now make sure that a gc should get rid of the function 3683 // Now make sure that a gc should get rid of the function
3685 for (int i = 0; i < 4; i++) { 3684 for (int i = 0; i < 4; i++) {
3686 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); 3685 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
3687 } 3686 }
3688 3687
3689 ASSERT(code->marked_for_deoptimization()); 3688 ASSERT(code->marked_for_deoptimization());
3690 } 3689 }
OLDNEW
« src/runtime.cc ('K') | « test/cctest/test-compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698