OLD | NEW |
1 // Copyright 2007-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2010 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 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1799 v8::ScriptCompiler::CompileUnboundScript( | 1799 v8::ScriptCompiler::CompileUnboundScript( |
1800 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache) | 1800 isolate2, &source, v8::ScriptCompiler::kConsumeCodeCache) |
1801 .ToLocalChecked(); | 1801 .ToLocalChecked(); |
1802 | 1802 |
1803 CHECK(!cache->rejected); | 1803 CHECK(!cache->rejected); |
1804 | 1804 |
1805 Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate2); | 1805 Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate2); |
1806 HandleScope i_scope(i_isolate); | 1806 HandleScope i_scope(i_isolate); |
1807 Handle<SharedFunctionInfo> toplevel = v8::Utils::OpenHandle(*unbound); | 1807 Handle<SharedFunctionInfo> toplevel = v8::Utils::OpenHandle(*unbound); |
1808 Handle<Script> script(Script::cast(toplevel->script())); | 1808 Handle<Script> script(Script::cast(toplevel->script())); |
1809 WeakFixedArray::Iterator iterator(script->shared_function_infos()); | |
1810 // Every function has been pre-compiled from the code cache. | 1809 // Every function has been pre-compiled from the code cache. |
1811 int count = 0; | 1810 int count = 0; |
1812 while (SharedFunctionInfo* shared = iterator.Next<SharedFunctionInfo>()) { | 1811 SharedFunctionInfo::ScriptIterator iterator(script); |
| 1812 while (SharedFunctionInfo* shared = iterator.Next()) { |
1813 CHECK(shared->is_compiled()); | 1813 CHECK(shared->is_compiled()); |
1814 CHECK_EQ(Code::kPreAgedCodeAge, shared->code()->GetAge()); | 1814 CHECK_EQ(Code::kPreAgedCodeAge, shared->code()->GetAge()); |
1815 count++; | 1815 count++; |
1816 } | 1816 } |
1817 CHECK_EQ(3, count); | 1817 CHECK_EQ(3, count); |
1818 } | 1818 } |
1819 isolate2->Dispose(); | 1819 isolate2->Dispose(); |
1820 } | 1820 } |
1821 | 1821 |
1822 TEST(Regress503552) { | 1822 TEST(Regress503552) { |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2458 } | 2458 } |
2459 delete[] blob.data; | 2459 delete[] blob.data; |
2460 } | 2460 } |
2461 | 2461 |
2462 TEST(SerializationMemoryStats) { | 2462 TEST(SerializationMemoryStats) { |
2463 FLAG_profile_deserialization = true; | 2463 FLAG_profile_deserialization = true; |
2464 FLAG_always_opt = false; | 2464 FLAG_always_opt = false; |
2465 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); | 2465 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); |
2466 delete[] blob.data; | 2466 delete[] blob.data; |
2467 } | 2467 } |
OLD | NEW |