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 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 } | 1269 } |
1270 CHECK_NE(*orig, *copy); | 1270 CHECK_NE(*orig, *copy); |
1271 | 1271 |
1272 Handle<JSFunction> copy_fun = | 1272 Handle<JSFunction> copy_fun = |
1273 isolate->factory()->NewFunctionFromSharedFunctionInfo( | 1273 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
1274 copy, isolate->native_context()); | 1274 copy, isolate->native_context()); |
1275 | 1275 |
1276 Handle<Object> copy_result = | 1276 Handle<Object> copy_result = |
1277 Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked(); | 1277 Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked(); |
1278 | 1278 |
1279 CHECK_EQ(15.0f, copy_result->Number()); | 1279 CHECK_EQ(15.0, copy_result->Number()); |
1280 | 1280 |
1281 delete cache; | 1281 delete cache; |
1282 } | 1282 } |
1283 | 1283 |
1284 | 1284 |
1285 TEST(SerializeToplevelLargeExternalString) { | 1285 TEST(SerializeToplevelLargeExternalString) { |
1286 FLAG_serialize_toplevel = true; | 1286 FLAG_serialize_toplevel = true; |
1287 LocalContext context; | 1287 LocalContext context; |
1288 Isolate* isolate = CcTest::i_isolate(); | 1288 Isolate* isolate = CcTest::i_isolate(); |
1289 isolate->compilation_cache()->Disable(); // Disable same-isolate code cache. | 1289 isolate->compilation_cache()->Disable(); // Disable same-isolate code cache. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 v8::ScriptCompiler::kConsumeCodeCache); | 1327 v8::ScriptCompiler::kConsumeCodeCache); |
1328 } | 1328 } |
1329 CHECK_NE(*orig, *copy); | 1329 CHECK_NE(*orig, *copy); |
1330 | 1330 |
1331 Handle<JSFunction> copy_fun = | 1331 Handle<JSFunction> copy_fun = |
1332 f->NewFunctionFromSharedFunctionInfo(copy, isolate->native_context()); | 1332 f->NewFunctionFromSharedFunctionInfo(copy, isolate->native_context()); |
1333 | 1333 |
1334 Handle<Object> copy_result = | 1334 Handle<Object> copy_result = |
1335 Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked(); | 1335 Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked(); |
1336 | 1336 |
1337 CHECK_EQ(42.0f, copy_result->Number()); | 1337 CHECK_EQ(42.0, copy_result->Number()); |
1338 | 1338 |
1339 delete cache; | 1339 delete cache; |
1340 string.Dispose(); | 1340 string.Dispose(); |
1341 } | 1341 } |
1342 | 1342 |
1343 | 1343 |
1344 TEST(SerializeToplevelExternalScriptName) { | 1344 TEST(SerializeToplevelExternalScriptName) { |
1345 FLAG_serialize_toplevel = true; | 1345 FLAG_serialize_toplevel = true; |
1346 LocalContext context; | 1346 LocalContext context; |
1347 Isolate* isolate = CcTest::i_isolate(); | 1347 Isolate* isolate = CcTest::i_isolate(); |
(...skipping 30 matching lines...) Expand all Loading... |
1378 v8::ScriptCompiler::kConsumeCodeCache); | 1378 v8::ScriptCompiler::kConsumeCodeCache); |
1379 } | 1379 } |
1380 CHECK_NE(*orig, *copy); | 1380 CHECK_NE(*orig, *copy); |
1381 | 1381 |
1382 Handle<JSFunction> copy_fun = | 1382 Handle<JSFunction> copy_fun = |
1383 f->NewFunctionFromSharedFunctionInfo(copy, isolate->native_context()); | 1383 f->NewFunctionFromSharedFunctionInfo(copy, isolate->native_context()); |
1384 | 1384 |
1385 Handle<Object> copy_result = | 1385 Handle<Object> copy_result = |
1386 Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked(); | 1386 Execution::Call(isolate, copy_fun, global, 0, NULL).ToHandleChecked(); |
1387 | 1387 |
1388 CHECK_EQ(10.0f, copy_result->Number()); | 1388 CHECK_EQ(10.0, copy_result->Number()); |
1389 | 1389 |
1390 delete cache; | 1390 delete cache; |
1391 } | 1391 } |
1392 | 1392 |
1393 | 1393 |
1394 static bool toplevel_test_code_event_found = false; | 1394 static bool toplevel_test_code_event_found = false; |
1395 | 1395 |
1396 | 1396 |
1397 static void SerializerCodeEventListener(const v8::JitCodeEvent* event) { | 1397 static void SerializerCodeEventListener(const v8::JitCodeEvent* event) { |
1398 if (event->type == v8::JitCodeEvent::CODE_ADDED && | 1398 if (event->type == v8::JitCodeEvent::CODE_ADDED && |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1686 delete script_data; | 1686 delete script_data; |
1687 } | 1687 } |
1688 | 1688 |
1689 | 1689 |
1690 TEST(SerializationMemoryStats) { | 1690 TEST(SerializationMemoryStats) { |
1691 FLAG_profile_deserialization = true; | 1691 FLAG_profile_deserialization = true; |
1692 FLAG_always_opt = false; | 1692 FLAG_always_opt = false; |
1693 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); | 1693 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); |
1694 delete[] blob.data; | 1694 delete[] blob.data; |
1695 } | 1695 } |
OLD | NEW |