| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/snapshot/deserializer.h" | 5 #include "src/snapshot/deserializer.h" |
| 6 | 6 |
| 7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/heap/heap.h" | 8 #include "src/heap/heap.h" |
| 9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
| 10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 // pointer because it points at the entry point, not at the start of the | 577 // pointer because it points at the entry point, not at the start of the |
| 578 // code object. | 578 // code object. |
| 579 SINGLE_CASE(kNewObject, kPlain, kInnerPointer, CODE_SPACE) | 579 SINGLE_CASE(kNewObject, kPlain, kInnerPointer, CODE_SPACE) |
| 580 // Deserialize a new code object and write a pointer to its first | 580 // Deserialize a new code object and write a pointer to its first |
| 581 // instruction to the current code object. | 581 // instruction to the current code object. |
| 582 ALL_SPACES(kNewObject, kFromCode, kInnerPointer) | 582 ALL_SPACES(kNewObject, kFromCode, kInnerPointer) |
| 583 // Find a recently deserialized object using its offset from the current | 583 // Find a recently deserialized object using its offset from the current |
| 584 // allocation point and write a pointer to it to the current object. | 584 // allocation point and write a pointer to it to the current object. |
| 585 ALL_SPACES(kBackref, kPlain, kStartOfObject) | 585 ALL_SPACES(kBackref, kPlain, kStartOfObject) |
| 586 ALL_SPACES(kBackrefWithSkip, kPlain, kStartOfObject) | 586 ALL_SPACES(kBackrefWithSkip, kPlain, kStartOfObject) |
| 587 #if defined(V8_TARGET_ARCH_MIPS) || defined(V8_TARGET_ARCH_MIPS64) || \ | 587 #if V8_CODE_EMBEDS_OBJECT_POINTER |
| 588 defined(V8_TARGET_ARCH_PPC) || V8_EMBEDDED_CONSTANT_POOL | |
| 589 // Deserialize a new object from pointer found in code and write | 588 // Deserialize a new object from pointer found in code and write |
| 590 // a pointer to it to the current object. Required only for MIPS, PPC or | 589 // a pointer to it to the current object. Required only for MIPS, PPC, ARM |
| 591 // ARM with embedded constant pool, and omitted on the other architectures | 590 // or S390 with embedded constant pool, and omitted on the other |
| 592 // because it is fully unrolled and would cause bloat. | 591 // architectures because it is fully unrolled and would cause bloat. |
| 593 ALL_SPACES(kNewObject, kFromCode, kStartOfObject) | 592 ALL_SPACES(kNewObject, kFromCode, kStartOfObject) |
| 594 // Find a recently deserialized code object using its offset from the | 593 // Find a recently deserialized code object using its offset from the |
| 595 // current allocation point and write a pointer to it to the current | 594 // current allocation point and write a pointer to it to the current |
| 596 // object. Required only for MIPS, PPC or ARM with embedded constant pool. | 595 // object. Required only for MIPS, PPC, ARM or S390 with embedded |
| 596 // constant pool. |
| 597 ALL_SPACES(kBackref, kFromCode, kStartOfObject) | 597 ALL_SPACES(kBackref, kFromCode, kStartOfObject) |
| 598 ALL_SPACES(kBackrefWithSkip, kFromCode, kStartOfObject) | 598 ALL_SPACES(kBackrefWithSkip, kFromCode, kStartOfObject) |
| 599 #endif | 599 #endif |
| 600 // Find a recently deserialized code object using its offset from the | 600 // Find a recently deserialized code object using its offset from the |
| 601 // current allocation point and write a pointer to its first instruction | 601 // current allocation point and write a pointer to its first instruction |
| 602 // to the current code object or the instruction pointer in a function | 602 // to the current code object or the instruction pointer in a function |
| 603 // object. | 603 // object. |
| 604 ALL_SPACES(kBackref, kFromCode, kInnerPointer) | 604 ALL_SPACES(kBackref, kFromCode, kInnerPointer) |
| 605 ALL_SPACES(kBackrefWithSkip, kFromCode, kInnerPointer) | 605 ALL_SPACES(kBackrefWithSkip, kFromCode, kInnerPointer) |
| 606 ALL_SPACES(kBackref, kPlain, kInnerPointer) | 606 ALL_SPACES(kBackref, kPlain, kInnerPointer) |
| 607 ALL_SPACES(kBackrefWithSkip, kPlain, kInnerPointer) | 607 ALL_SPACES(kBackrefWithSkip, kPlain, kInnerPointer) |
| 608 // Find an object in the roots array and write a pointer to it to the | 608 // Find an object in the roots array and write a pointer to it to the |
| 609 // current object. | 609 // current object. |
| 610 SINGLE_CASE(kRootArray, kPlain, kStartOfObject, 0) | 610 SINGLE_CASE(kRootArray, kPlain, kStartOfObject, 0) |
| 611 #if defined(V8_TARGET_ARCH_MIPS) || defined(V8_TARGET_ARCH_MIPS64) || \ | 611 #if V8_CODE_EMBEDS_OBJECT_POINTER |
| 612 defined(V8_TARGET_ARCH_PPC) || V8_EMBEDDED_CONSTANT_POOL | |
| 613 // Find an object in the roots array and write a pointer to it to in code. | 612 // Find an object in the roots array and write a pointer to it to in code. |
| 614 SINGLE_CASE(kRootArray, kFromCode, kStartOfObject, 0) | 613 SINGLE_CASE(kRootArray, kFromCode, kStartOfObject, 0) |
| 615 #endif | 614 #endif |
| 616 // Find an object in the partial snapshots cache and write a pointer to it | 615 // Find an object in the partial snapshots cache and write a pointer to it |
| 617 // to the current object. | 616 // to the current object. |
| 618 SINGLE_CASE(kPartialSnapshotCache, kPlain, kStartOfObject, 0) | 617 SINGLE_CASE(kPartialSnapshotCache, kPlain, kStartOfObject, 0) |
| 619 // Find an code entry in the partial snapshots cache and | 618 // Find an code entry in the partial snapshots cache and |
| 620 // write a pointer to it to the current object. | 619 // write a pointer to it to the current object. |
| 621 SINGLE_CASE(kPartialSnapshotCache, kPlain, kInnerPointer, 0) | 620 SINGLE_CASE(kPartialSnapshotCache, kPlain, kInnerPointer, 0) |
| 622 // Find an external reference and write a pointer to it to the current | 621 // Find an external reference and write a pointer to it to the current |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 | 804 |
| 806 default: | 805 default: |
| 807 CHECK(false); | 806 CHECK(false); |
| 808 } | 807 } |
| 809 } | 808 } |
| 810 CHECK_EQ(limit, current); | 809 CHECK_EQ(limit, current); |
| 811 return true; | 810 return true; |
| 812 } | 811 } |
| 813 } // namespace internal | 812 } // namespace internal |
| 814 } // namespace v8 | 813 } // namespace v8 |
| OLD | NEW |