| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 byte* snapshot = ReadBytes(file_name, &snapshot_size); | 452 byte* snapshot = ReadBytes(file_name, &snapshot_size); |
| 453 | 453 |
| 454 Object* root; | 454 Object* root; |
| 455 { | 455 { |
| 456 SnapshotByteSource source(snapshot, snapshot_size); | 456 SnapshotByteSource source(snapshot, snapshot_size); |
| 457 Deserializer deserializer(&source); | 457 Deserializer deserializer(&source); |
| 458 deserializer.DeserializePartial(&root); | 458 deserializer.DeserializePartial(&root); |
| 459 CHECK(root->IsString()); | 459 CHECK(root->IsString()); |
| 460 } | 460 } |
| 461 v8::HandleScope handle_scope; | 461 v8::HandleScope handle_scope; |
| 462 Handle<Object>root_handle(root); | 462 Handle<Object> root_handle(root); |
| 463 |
| 464 ReserveSpaceForPartialSnapshot(file_name); |
| 463 | 465 |
| 464 Object* root2; | 466 Object* root2; |
| 465 { | 467 { |
| 466 SnapshotByteSource source(snapshot, snapshot_size); | 468 SnapshotByteSource source(snapshot, snapshot_size); |
| 467 Deserializer deserializer(&source); | 469 Deserializer deserializer(&source); |
| 468 deserializer.DeserializePartial(&root2); | 470 deserializer.DeserializePartial(&root2); |
| 469 CHECK(root2->IsString()); | 471 CHECK(root2->IsString()); |
| 470 CHECK(*root_handle == root2); | 472 CHECK(*root_handle == root2); |
| 471 } | 473 } |
| 472 } | 474 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 byte* snapshot = ReadBytes(file_name, &snapshot_size); | 537 byte* snapshot = ReadBytes(file_name, &snapshot_size); |
| 536 | 538 |
| 537 Object* root; | 539 Object* root; |
| 538 { | 540 { |
| 539 SnapshotByteSource source(snapshot, snapshot_size); | 541 SnapshotByteSource source(snapshot, snapshot_size); |
| 540 Deserializer deserializer(&source); | 542 Deserializer deserializer(&source); |
| 541 deserializer.DeserializePartial(&root); | 543 deserializer.DeserializePartial(&root); |
| 542 CHECK(root->IsContext()); | 544 CHECK(root->IsContext()); |
| 543 } | 545 } |
| 544 v8::HandleScope handle_scope; | 546 v8::HandleScope handle_scope; |
| 545 Handle<Object>root_handle(root); | 547 Handle<Object> root_handle(root); |
| 548 |
| 549 ReserveSpaceForPartialSnapshot(file_name); |
| 546 | 550 |
| 547 Object* root2; | 551 Object* root2; |
| 548 { | 552 { |
| 549 SnapshotByteSource source(snapshot, snapshot_size); | 553 SnapshotByteSource source(snapshot, snapshot_size); |
| 550 Deserializer deserializer(&source); | 554 Deserializer deserializer(&source); |
| 551 deserializer.DeserializePartial(&root2); | 555 deserializer.DeserializePartial(&root2); |
| 552 CHECK(root2->IsContext()); | 556 CHECK(root2->IsContext()); |
| 553 CHECK(*root_handle != root2); | 557 CHECK(*root_handle != root2); |
| 554 } | 558 } |
| 555 } | 559 } |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 TEST(TestThatAlwaysFails) { | 674 TEST(TestThatAlwaysFails) { |
| 671 bool ArtificialFailure = false; | 675 bool ArtificialFailure = false; |
| 672 CHECK(ArtificialFailure); | 676 CHECK(ArtificialFailure); |
| 673 } | 677 } |
| 674 | 678 |
| 675 | 679 |
| 676 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { | 680 DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { |
| 677 bool ArtificialFailure2 = false; | 681 bool ArtificialFailure2 = false; |
| 678 CHECK(ArtificialFailure2); | 682 CHECK(ArtificialFailure2); |
| 679 } | 683 } |
| OLD | NEW |