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

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: Port to other architectures. Created 6 years, 4 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 // TODO(titzer): Test should be resilient against optimization decisions.
4040 if (i::FLAG_always_opt) return;
4039 if (!isolate->use_crankshaft()) return; 4041 if (!isolate->use_crankshaft()) return;
4042
4040 HandleScope outer_scope(heap->isolate()); 4043 HandleScope outer_scope(heap->isolate());
4041 Handle<Code> code; 4044 Handle<Code> code;
4042 heap->CollectAllAvailableGarbage(); 4045 heap->CollectAllAvailableGarbage();
4043 int code_chain_length_before, code_chain_length_after; 4046 int code_chain_length_before, code_chain_length_after;
4044 { 4047 {
4045 HandleScope scope(heap->isolate()); 4048 HandleScope scope(heap->isolate());
4046 Handle<JSFunction> mortal = OptimizeDummyFunction("mortal"); 4049 Handle<JSFunction> mortal = OptimizeDummyFunction("mortal");
4047 Handle<JSFunction> immortal = OptimizeDummyFunction("immortal"); 4050 Handle<JSFunction> immortal = OptimizeDummyFunction("immortal");
4048 CHECK_EQ(immortal->code()->next_code_link(), mortal->code()); 4051 CHECK_EQ(immortal->code()->next_code_link(), mortal->code());
4049 code_chain_length_before = GetCodeChainLength(immortal->code()); 4052 code_chain_length_before = GetCodeChainLength(immortal->code());
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
4408 #ifdef DEBUG 4411 #ifdef DEBUG
4409 TEST(PathTracer) { 4412 TEST(PathTracer) {
4410 CcTest::InitializeVM(); 4413 CcTest::InitializeVM();
4411 v8::HandleScope scope(CcTest::isolate()); 4414 v8::HandleScope scope(CcTest::isolate());
4412 4415
4413 v8::Local<v8::Value> result = CompileRun("'abc'"); 4416 v8::Local<v8::Value> result = CompileRun("'abc'");
4414 Handle<Object> o = v8::Utils::OpenHandle(*result); 4417 Handle<Object> o = v8::Utils::OpenHandle(*result);
4415 CcTest::i_isolate()->heap()->TracePathToObject(*o); 4418 CcTest::i_isolate()->heap()->TracePathToObject(*o);
4416 } 4419 }
4417 #endif // DEBUG 4420 #endif // DEBUG
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698