OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
734 Object** write_back) { | 734 Object** write_back) { |
735 int size = source_->GetInt() << kObjectAlignmentBits; | 735 int size = source_->GetInt() << kObjectAlignmentBits; |
736 Address address = Allocate(space_number, space, size); | 736 Address address = Allocate(space_number, space, size); |
737 *write_back = HeapObject::FromAddress(address); | 737 *write_back = HeapObject::FromAddress(address); |
738 Object** current = reinterpret_cast<Object**>(address); | 738 Object** current = reinterpret_cast<Object**>(address); |
739 Object** limit = current + (size >> kPointerSizeLog2); | 739 Object** limit = current + (size >> kPointerSizeLog2); |
740 if (FLAG_log_snapshot_positions) { | 740 if (FLAG_log_snapshot_positions) { |
741 LOG(isolate_, SnapshotPositionEvent(address, source_->position())); | 741 LOG(isolate_, SnapshotPositionEvent(address, source_->position())); |
742 } | 742 } |
743 ReadChunk(current, limit, space_number, address); | 743 ReadChunk(current, limit, space_number, address); |
744 Object* object = HeapObject::FromAddress(reinterpret_cast<Address>(address)); | |
745 if (object->IsCode()) | |
danno
2012/08/02 12:38:11
Deserialization is very performance sensitive, so
| |
746 VTUNEJIT(AddCode("deserialized", reinterpret_cast<Code*>(object))); | |
747 | |
744 #ifdef DEBUG | 748 #ifdef DEBUG |
745 bool is_codespace = (space == HEAP->code_space()) || | 749 bool is_codespace = (space == HEAP->code_space()) || |
746 ((space == HEAP->lo_space()) && (space_number == kLargeCode)); | 750 ((space == HEAP->lo_space()) && (space_number == kLargeCode)); |
747 ASSERT(HeapObject::FromAddress(address)->IsCode() == is_codespace); | 751 ASSERT(HeapObject::FromAddress(address)->IsCode() == is_codespace); |
748 #endif | 752 #endif |
749 } | 753 } |
750 | 754 |
751 | 755 |
752 // This macro is always used with a constant argument so it should all fold | 756 // This macro is always used with a constant argument so it should all fold |
753 // away to almost nothing in the generated code. It might be nicer to do this | 757 // away to almost nothing in the generated code. It might be nicer to do this |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1682 int Serializer::SpaceAreaSize(int space) { | 1686 int Serializer::SpaceAreaSize(int space) { |
1683 if (space == CODE_SPACE) { | 1687 if (space == CODE_SPACE) { |
1684 return isolate_->memory_allocator()->CodePageAreaSize(); | 1688 return isolate_->memory_allocator()->CodePageAreaSize(); |
1685 } else { | 1689 } else { |
1686 return Page::kPageSize - Page::kObjectStartOffset; | 1690 return Page::kPageSize - Page::kObjectStartOffset; |
1687 } | 1691 } |
1688 } | 1692 } |
1689 | 1693 |
1690 | 1694 |
1691 } } // namespace v8::internal | 1695 } } // namespace v8::internal |
OLD | NEW |