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

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

Issue 410153002: Make --always-opt also optimize toplevel code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
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 4018 matching lines...) Expand 10 before | Expand all | Expand 10 after
4029 return result; 4029 return result;
4030 } 4030 }
4031 4031
4032 4032
4033 TEST(NextCodeLinkIsWeak) { 4033 TEST(NextCodeLinkIsWeak) {
4034 i::FLAG_allow_natives_syntax = true; 4034 i::FLAG_allow_natives_syntax = true;
4035 CcTest::InitializeVM(); 4035 CcTest::InitializeVM();
4036 Isolate* isolate = CcTest::i_isolate(); 4036 Isolate* isolate = CcTest::i_isolate();
4037 v8::internal::Heap* heap = CcTest::heap(); 4037 v8::internal::Heap* heap = CcTest::heap();
4038 4038
4039 if (i::FLAG_always_opt) return;
titzer 2014/07/28 09:56:10 Can we get a TODO in here? It needs some thought o
Michael Starzinger 2014/07/28 15:10:51 Done.
4039 if (!isolate->use_crankshaft()) return; 4040 if (!isolate->use_crankshaft()) return;
4040 HandleScope outer_scope(heap->isolate()); 4041 HandleScope outer_scope(heap->isolate());
4041 Handle<Code> code; 4042 Handle<Code> code;
4042 heap->CollectAllAvailableGarbage(); 4043 heap->CollectAllAvailableGarbage();
4043 int code_chain_length_before, code_chain_length_after; 4044 int code_chain_length_before, code_chain_length_after;
4044 { 4045 {
4045 HandleScope scope(heap->isolate()); 4046 HandleScope scope(heap->isolate());
4046 Handle<JSFunction> mortal = OptimizeDummyFunction("mortal"); 4047 Handle<JSFunction> mortal = OptimizeDummyFunction("mortal");
4047 Handle<JSFunction> immortal = OptimizeDummyFunction("immortal"); 4048 Handle<JSFunction> immortal = OptimizeDummyFunction("immortal");
4048 CHECK_EQ(immortal->code()->next_code_link(), mortal->code()); 4049 CHECK_EQ(immortal->code()->next_code_link(), mortal->code());
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
4408 #ifdef DEBUG 4409 #ifdef DEBUG
4409 TEST(PathTracer) { 4410 TEST(PathTracer) {
4410 CcTest::InitializeVM(); 4411 CcTest::InitializeVM();
4411 v8::HandleScope scope(CcTest::isolate()); 4412 v8::HandleScope scope(CcTest::isolate());
4412 4413
4413 v8::Local<v8::Value> result = CompileRun("'abc'"); 4414 v8::Local<v8::Value> result = CompileRun("'abc'");
4414 Handle<Object> o = v8::Utils::OpenHandle(*result); 4415 Handle<Object> o = v8::Utils::OpenHandle(*result);
4415 CcTest::i_isolate()->heap()->TracePathToObject(*o); 4416 CcTest::i_isolate()->heap()->TracePathToObject(*o);
4416 } 4417 }
4417 #endif // DEBUG 4418 #endif // DEBUG
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698