OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 ReadObject(OLD_DATA_SPACE, Heap::old_data_space(), current++); | 695 ReadObject(OLD_DATA_SPACE, Heap::old_data_space(), current++); |
696 break; | 696 break; |
697 case OBJECT_SERIALIZATION + OLD_POINTER_SPACE: | 697 case OBJECT_SERIALIZATION + OLD_POINTER_SPACE: |
698 ReadObject(OLD_POINTER_SPACE, Heap::old_pointer_space(), current++); | 698 ReadObject(OLD_POINTER_SPACE, Heap::old_pointer_space(), current++); |
699 break; | 699 break; |
700 case OBJECT_SERIALIZATION + MAP_SPACE: | 700 case OBJECT_SERIALIZATION + MAP_SPACE: |
701 ReadObject(MAP_SPACE, Heap::map_space(), current++); | 701 ReadObject(MAP_SPACE, Heap::map_space(), current++); |
702 break; | 702 break; |
703 case OBJECT_SERIALIZATION + CODE_SPACE: | 703 case OBJECT_SERIALIZATION + CODE_SPACE: |
704 ReadObject(CODE_SPACE, Heap::code_space(), current++); | 704 ReadObject(CODE_SPACE, Heap::code_space(), current++); |
705 LOG(LogCodeObject(current[-1])); | |
706 break; | 705 break; |
707 case OBJECT_SERIALIZATION + CELL_SPACE: | 706 case OBJECT_SERIALIZATION + CELL_SPACE: |
708 ReadObject(CELL_SPACE, Heap::cell_space(), current++); | 707 ReadObject(CELL_SPACE, Heap::cell_space(), current++); |
709 break; | 708 break; |
710 case OBJECT_SERIALIZATION + kLargeData: | 709 case OBJECT_SERIALIZATION + kLargeData: |
711 ReadObject(kLargeData, Heap::lo_space(), current++); | 710 ReadObject(kLargeData, Heap::lo_space(), current++); |
712 break; | 711 break; |
713 case OBJECT_SERIALIZATION + kLargeCode: | 712 case OBJECT_SERIALIZATION + kLargeCode: |
714 ReadObject(kLargeCode, Heap::lo_space(), current++); | 713 ReadObject(kLargeCode, Heap::lo_space(), current++); |
715 LOG(LogCodeObject(current[-1])); | |
716 break; | 714 break; |
717 case OBJECT_SERIALIZATION + kLargeFixedArray: | 715 case OBJECT_SERIALIZATION + kLargeFixedArray: |
718 ReadObject(kLargeFixedArray, Heap::lo_space(), current++); | 716 ReadObject(kLargeFixedArray, Heap::lo_space(), current++); |
719 break; | 717 break; |
720 case CODE_OBJECT_SERIALIZATION + kLargeCode: { | 718 case CODE_OBJECT_SERIALIZATION + kLargeCode: { |
721 Object* new_code_object = NULL; | 719 Object* new_code_object = NULL; |
722 ReadObject(kLargeCode, Heap::lo_space(), &new_code_object); | 720 ReadObject(kLargeCode, Heap::lo_space(), &new_code_object); |
723 Code* code_object = reinterpret_cast<Code*>(new_code_object); | 721 Code* code_object = reinterpret_cast<Code*>(new_code_object); |
724 LOG(LogCodeObject(code_object)); | |
725 // Setting a branch/call to another code object from code. | 722 // Setting a branch/call to another code object from code. |
726 Address location_of_branch_data = reinterpret_cast<Address>(current); | 723 Address location_of_branch_data = reinterpret_cast<Address>(current); |
727 Assembler::set_target_at(location_of_branch_data, | 724 Assembler::set_target_at(location_of_branch_data, |
728 code_object->instruction_start()); | 725 code_object->instruction_start()); |
729 location_of_branch_data += Assembler::kCallTargetSize; | 726 location_of_branch_data += Assembler::kCallTargetSize; |
730 current = reinterpret_cast<Object**>(location_of_branch_data); | 727 current = reinterpret_cast<Object**>(location_of_branch_data); |
731 break; | 728 break; |
732 } | 729 } |
733 case CODE_OBJECT_SERIALIZATION + CODE_SPACE: { | 730 case CODE_OBJECT_SERIALIZATION + CODE_SPACE: { |
734 Object* new_code_object = NULL; | 731 Object* new_code_object = NULL; |
735 ReadObject(CODE_SPACE, Heap::code_space(), &new_code_object); | 732 ReadObject(CODE_SPACE, Heap::code_space(), &new_code_object); |
736 Code* code_object = reinterpret_cast<Code*>(new_code_object); | 733 Code* code_object = reinterpret_cast<Code*>(new_code_object); |
737 LOG(LogCodeObject(code_object)); | |
738 // Setting a branch/call to another code object from code. | 734 // Setting a branch/call to another code object from code. |
739 Address location_of_branch_data = reinterpret_cast<Address>(current); | 735 Address location_of_branch_data = reinterpret_cast<Address>(current); |
740 Assembler::set_target_at(location_of_branch_data, | 736 Assembler::set_target_at(location_of_branch_data, |
741 code_object->instruction_start()); | 737 code_object->instruction_start()); |
742 location_of_branch_data += Assembler::kCallTargetSize; | 738 location_of_branch_data += Assembler::kCallTargetSize; |
743 current = reinterpret_cast<Object**>(location_of_branch_data); | 739 current = reinterpret_cast<Object**>(location_of_branch_data); |
744 break; | 740 break; |
745 } | 741 } |
746 ONE_CASE_PER_SPACE(BACKREF_SERIALIZATION) { | 742 ONE_CASE_PER_SPACE(BACKREF_SERIALIZATION) { |
747 // Write a backreference to an object we unpacked earlier. | 743 // Write a backreference to an object we unpacked earlier. |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); | 1352 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); |
1357 } | 1353 } |
1358 } | 1354 } |
1359 int allocation_address = fullness_[space]; | 1355 int allocation_address = fullness_[space]; |
1360 fullness_[space] = allocation_address + size; | 1356 fullness_[space] = allocation_address + size; |
1361 return allocation_address; | 1357 return allocation_address; |
1362 } | 1358 } |
1363 | 1359 |
1364 | 1360 |
1365 } } // namespace v8::internal | 1361 } } // namespace v8::internal |
OLD | NEW |