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 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1651 CHECK_EQ(12, CompileRun("foo(2)")->ToInt32(isolate)->Int32Value()); | 1651 CHECK_EQ(12, CompileRun("foo(2)")->ToInt32(isolate)->Int32Value()); |
1652 CHECK_EQ(12, CompileRun("foo(3)")->ToInt32(isolate)->Int32Value()); | 1652 CHECK_EQ(12, CompileRun("foo(3)")->ToInt32(isolate)->Int32Value()); |
1653 CHECK_EQ(23, CompileRun("foo(4)")->ToInt32(isolate)->Int32Value()); | 1653 CHECK_EQ(23, CompileRun("foo(4)")->ToInt32(isolate)->Int32Value()); |
1654 CHECK_EQ(23, CompileRun("foo(5)")->ToInt32(isolate)->Int32Value()); | 1654 CHECK_EQ(23, CompileRun("foo(5)")->ToInt32(isolate)->Int32Value()); |
1655 CHECK_EQ(10, CompileRun("foo(6)")->ToInt32(isolate)->Int32Value()); | 1655 CHECK_EQ(10, CompileRun("foo(6)")->ToInt32(isolate)->Int32Value()); |
1656 } | 1656 } |
1657 isolate->Dispose(); | 1657 isolate->Dispose(); |
1658 } | 1658 } |
1659 | 1659 |
1660 | 1660 |
| 1661 TEST(Regress503552) { |
| 1662 // Test that the code serializer can deal with weak cells that form a linked |
| 1663 // list during incremental marking. |
| 1664 |
| 1665 CcTest::InitializeVM(); |
| 1666 Isolate* isolate = CcTest::i_isolate(); |
| 1667 |
| 1668 HandleScope scope(isolate); |
| 1669 Handle<String> source = isolate->factory()->NewStringFromAsciiChecked( |
| 1670 "function f() {} function g() {}"); |
| 1671 ScriptData* script_data = NULL; |
| 1672 Handle<SharedFunctionInfo> shared = Compiler::CompileScript( |
| 1673 source, Handle<String>(), 0, 0, v8::ScriptOriginOptions(), |
| 1674 Handle<Object>(), Handle<Context>(isolate->native_context()), NULL, |
| 1675 &script_data, v8::ScriptCompiler::kProduceCodeCache, NOT_NATIVES_CODE, |
| 1676 false); |
| 1677 delete script_data; |
| 1678 |
| 1679 SimulateIncrementalMarking(isolate->heap()); |
| 1680 |
| 1681 script_data = CodeSerializer::Serialize(isolate, shared, source); |
| 1682 delete script_data; |
| 1683 } |
| 1684 |
| 1685 |
1661 TEST(SerializationMemoryStats) { | 1686 TEST(SerializationMemoryStats) { |
1662 FLAG_profile_deserialization = true; | 1687 FLAG_profile_deserialization = true; |
1663 FLAG_always_opt = false; | 1688 FLAG_always_opt = false; |
1664 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); | 1689 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); |
1665 delete[] blob.data; | 1690 delete[] blob.data; |
1666 } | 1691 } |
OLD | NEW |