| 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 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 Object** write_back) { | 724 Object** write_back) { |
| 725 int size = source_->GetInt() << kObjectAlignmentBits; | 725 int size = source_->GetInt() << kObjectAlignmentBits; |
| 726 Address address = Allocate(space_number, space, size); | 726 Address address = Allocate(space_number, space, size); |
| 727 *write_back = HeapObject::FromAddress(address); | 727 *write_back = HeapObject::FromAddress(address); |
| 728 Object** current = reinterpret_cast<Object**>(address); | 728 Object** current = reinterpret_cast<Object**>(address); |
| 729 Object** limit = current + (size >> kPointerSizeLog2); | 729 Object** limit = current + (size >> kPointerSizeLog2); |
| 730 if (FLAG_log_snapshot_positions) { | 730 if (FLAG_log_snapshot_positions) { |
| 731 LOG(SnapshotPositionEvent(address, source_->position())); | 731 LOG(SnapshotPositionEvent(address, source_->position())); |
| 732 } | 732 } |
| 733 ReadChunk(current, limit, space_number, address); | 733 ReadChunk(current, limit, space_number, address); |
| 734 #ifdef DEBUG |
| 735 bool is_codespace = (space == Heap::code_space()) || |
| 736 ((space == Heap::lo_space()) && (space_number == kLargeCode)); |
| 737 ASSERT(HeapObject::FromAddress(address)->IsCode() == is_codespace); |
| 738 #endif |
| 734 } | 739 } |
| 735 | 740 |
| 736 | 741 |
| 737 // This macro is always used with a constant argument so it should all fold | 742 // This macro is always used with a constant argument so it should all fold |
| 738 // away to almost nothing in the generated code. It might be nicer to do this | 743 // away to almost nothing in the generated code. It might be nicer to do this |
| 739 // with the ternary operator but there are type issues with that. | 744 // with the ternary operator but there are type issues with that. |
| 740 #define ASSIGN_DEST_SPACE(space_number) \ | 745 #define ASSIGN_DEST_SPACE(space_number) \ |
| 741 Space* dest_space; \ | 746 Space* dest_space; \ |
| 742 if (space_number == NEW_SPACE) { \ | 747 if (space_number == NEW_SPACE) { \ |
| 743 dest_space = Heap::new_space(); \ | 748 dest_space = Heap::new_space(); \ |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 CASE_STATEMENT(where, how, within, MAP_SPACE) \ | 884 CASE_STATEMENT(where, how, within, MAP_SPACE) \ |
| 880 CASE_STATEMENT(where, how, within, kLargeData) \ | 885 CASE_STATEMENT(where, how, within, kLargeData) \ |
| 881 CASE_STATEMENT(where, how, within, kLargeCode) \ | 886 CASE_STATEMENT(where, how, within, kLargeCode) \ |
| 882 CASE_STATEMENT(where, how, within, kLargeFixedArray) \ | 887 CASE_STATEMENT(where, how, within, kLargeFixedArray) \ |
| 883 CASE_BODY(where, how, within, kAnyOldSpace, kUnknownOffsetFromStart) | 888 CASE_BODY(where, how, within, kAnyOldSpace, kUnknownOffsetFromStart) |
| 884 | 889 |
| 885 #define ONE_PER_CODE_SPACE(where, how, within) \ | 890 #define ONE_PER_CODE_SPACE(where, how, within) \ |
| 886 CASE_STATEMENT(where, how, within, CODE_SPACE) \ | 891 CASE_STATEMENT(where, how, within, CODE_SPACE) \ |
| 887 CASE_BODY(where, how, within, CODE_SPACE, kUnknownOffsetFromStart) \ | 892 CASE_BODY(where, how, within, CODE_SPACE, kUnknownOffsetFromStart) \ |
| 888 CASE_STATEMENT(where, how, within, kLargeCode) \ | 893 CASE_STATEMENT(where, how, within, kLargeCode) \ |
| 889 CASE_BODY(where, how, within, LO_SPACE, kUnknownOffsetFromStart) | 894 CASE_BODY(where, how, within, kLargeCode, kUnknownOffsetFromStart) |
| 890 | 895 |
| 891 #define EMIT_COMMON_REFERENCE_PATTERNS(pseudo_space_number, \ | 896 #define EMIT_COMMON_REFERENCE_PATTERNS(pseudo_space_number, \ |
| 892 space_number, \ | 897 space_number, \ |
| 893 offset_from_start) \ | 898 offset_from_start) \ |
| 894 CASE_STATEMENT(kFromStart, kPlain, kStartOfObject, pseudo_space_number) \ | 899 CASE_STATEMENT(kFromStart, kPlain, kStartOfObject, pseudo_space_number) \ |
| 895 CASE_BODY(kFromStart, kPlain, kStartOfObject, space_number, offset_from_start) | 900 CASE_BODY(kFromStart, kPlain, kStartOfObject, space_number, offset_from_start) |
| 896 | 901 |
| 897 // We generate 15 cases and bodies that process special tags that combine | 902 // We generate 15 cases and bodies that process special tags that combine |
| 898 // the raw data tag and the length into one byte. | 903 // the raw data tag and the length into one byte. |
| 899 #define RAW_CASE(index, size) \ | 904 #define RAW_CASE(index, size) \ |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1541 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); | 1546 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); |
| 1542 } | 1547 } |
| 1543 } | 1548 } |
| 1544 int allocation_address = fullness_[space]; | 1549 int allocation_address = fullness_[space]; |
| 1545 fullness_[space] = allocation_address + size; | 1550 fullness_[space] = allocation_address + size; |
| 1546 return allocation_address; | 1551 return allocation_address; |
| 1547 } | 1552 } |
| 1548 | 1553 |
| 1549 | 1554 |
| 1550 } } // namespace v8::internal | 1555 } } // namespace v8::internal |
| OLD | NEW |