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

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

Issue 254623002: Simplify feedback vector creation and store in SharedFunctionInfo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Code comments Created 6 years, 7 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 | « 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 3039 matching lines...) Expand 10 before | Expand all | Expand 10 after
3050 // originating from two different native contexts. 3050 // originating from two different native contexts.
3051 CcTest::global()->Set(v8_str("fun1"), fun1); 3051 CcTest::global()->Set(v8_str("fun1"), fun1);
3052 CcTest::global()->Set(v8_str("fun2"), fun2); 3052 CcTest::global()->Set(v8_str("fun2"), fun2);
3053 CompileRun("function f(a, b) { a(); b(); } f(fun1, fun2);"); 3053 CompileRun("function f(a, b) { a(); b(); } f(fun1, fun2);");
3054 3054
3055 Handle<JSFunction> f = 3055 Handle<JSFunction> f =
3056 v8::Utils::OpenHandle( 3056 v8::Utils::OpenHandle(
3057 *v8::Handle<v8::Function>::Cast( 3057 *v8::Handle<v8::Function>::Cast(
3058 CcTest::global()->Get(v8_str("f")))); 3058 CcTest::global()->Get(v8_str("f"))));
3059 3059
3060 Handle<FixedArray> feedback_vector(TypeFeedbackInfo::cast( 3060 Handle<FixedArray> feedback_vector(f->shared()->feedback_vector());
3061 f->shared()->code()->type_feedback_info())->feedback_vector());
3062 3061
3063 CHECK_EQ(2, feedback_vector->length()); 3062 CHECK_EQ(2, feedback_vector->length());
3064 CHECK(feedback_vector->get(0)->IsJSFunction()); 3063 CHECK(feedback_vector->get(0)->IsJSFunction());
3065 CHECK(feedback_vector->get(1)->IsJSFunction()); 3064 CHECK(feedback_vector->get(1)->IsJSFunction());
3066 3065
3067 SimulateIncrementalMarking(); 3066 SimulateIncrementalMarking();
3068 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags); 3067 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags);
3069 3068
3070 CHECK_EQ(2, feedback_vector->length()); 3069 CHECK_EQ(2, feedback_vector->length());
3071 CHECK_EQ(feedback_vector->get(0), 3070 CHECK_EQ(feedback_vector->get(0),
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after
4214 "array;"); 4213 "array;");
4215 4214
4216 Handle<JSObject> o = 4215 Handle<JSObject> o =
4217 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(result)); 4216 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(result));
4218 CHECK(heap->InOldPointerSpace(o->elements())); 4217 CHECK(heap->InOldPointerSpace(o->elements()));
4219 CHECK(heap->InOldPointerSpace(*o)); 4218 CHECK(heap->InOldPointerSpace(*o));
4220 Page* page = Page::FromAddress(o->elements()->address()); 4219 Page* page = Page::FromAddress(o->elements()->address());
4221 CHECK(page->WasSwept() || 4220 CHECK(page->WasSwept() ||
4222 Marking::IsBlack(Marking::MarkBitFrom(o->elements()))); 4221 Marking::IsBlack(Marking::MarkBitFrom(o->elements())));
4223 } 4222 }
OLDNEW
« no previous file with comments | « test/cctest/test-compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698