| 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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 | 981 |
| 982 case kNewPage: { | 982 case kNewPage: { |
| 983 int space = source_->Get(); | 983 int space = source_->Get(); |
| 984 pages_[space].Add(last_object_address_); | 984 pages_[space].Add(last_object_address_); |
| 985 if (space == CODE_SPACE) { | 985 if (space == CODE_SPACE) { |
| 986 CPU::FlushICache(last_object_address_, Page::kPageSize); | 986 CPU::FlushICache(last_object_address_, Page::kPageSize); |
| 987 } | 987 } |
| 988 break; | 988 break; |
| 989 } | 989 } |
| 990 | 990 |
| 991 case kSkip: { |
| 992 current++; |
| 993 break; |
| 994 } |
| 995 |
| 991 case kNativesStringResource: { | 996 case kNativesStringResource: { |
| 992 int index = source_->Get(); | 997 int index = source_->Get(); |
| 993 Vector<const char> source_vector = Natives::GetScriptSource(index); | 998 Vector<const char> source_vector = Natives::GetScriptSource(index); |
| 994 NativesExternalStringResource* resource = | 999 NativesExternalStringResource* resource = |
| 995 new NativesExternalStringResource(source_vector.start()); | 1000 new NativesExternalStringResource(source_vector.start()); |
| 996 *current++ = reinterpret_cast<Object*>(resource); | 1001 *current++ = reinterpret_cast<Object*>(resource); |
| 997 break; | 1002 break; |
| 998 } | 1003 } |
| 999 | 1004 |
| 1000 case kSynchronize: { | 1005 case kSynchronize: { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 index++) { | 1101 index++) { |
| 1097 partial_snapshot_cache_[index] = Heap::undefined_value(); | 1102 partial_snapshot_cache_[index] = Heap::undefined_value(); |
| 1098 startup_serializer_->VisitPointer(&partial_snapshot_cache_[index]); | 1103 startup_serializer_->VisitPointer(&partial_snapshot_cache_[index]); |
| 1099 } | 1104 } |
| 1100 partial_snapshot_cache_length_ = kPartialSnapshotCacheCapacity; | 1105 partial_snapshot_cache_length_ = kPartialSnapshotCacheCapacity; |
| 1101 } | 1106 } |
| 1102 | 1107 |
| 1103 | 1108 |
| 1104 void Serializer::VisitPointers(Object** start, Object** end) { | 1109 void Serializer::VisitPointers(Object** start, Object** end) { |
| 1105 for (Object** current = start; current < end; current++) { | 1110 for (Object** current = start; current < end; current++) { |
| 1106 if ((*current)->IsSmi()) { | 1111 if (reinterpret_cast<Address>(current) == StoreBuffer::TopAddress()) { |
| 1112 sink_->Put(kSkip, "Skip"); |
| 1113 } else if ((*current)->IsSmi()) { |
| 1107 sink_->Put(kRawData, "RawData"); | 1114 sink_->Put(kRawData, "RawData"); |
| 1108 sink_->PutInt(kPointerSize, "length"); | 1115 sink_->PutInt(kPointerSize, "length"); |
| 1109 for (int i = 0; i < kPointerSize; i++) { | 1116 for (int i = 0; i < kPointerSize; i++) { |
| 1110 sink_->Put(reinterpret_cast<byte*>(current)[i], "Byte"); | 1117 sink_->Put(reinterpret_cast<byte*>(current)[i], "Byte"); |
| 1111 } | 1118 } |
| 1112 } else { | 1119 } else { |
| 1113 SerializeObject(*current, kPlain, kStartOfObject); | 1120 SerializeObject(*current, kPlain, kStartOfObject); |
| 1114 } | 1121 } |
| 1115 } | 1122 } |
| 1116 } | 1123 } |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1525 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); | 1532 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); |
| 1526 } | 1533 } |
| 1527 } | 1534 } |
| 1528 int allocation_address = fullness_[space]; | 1535 int allocation_address = fullness_[space]; |
| 1529 fullness_[space] = allocation_address + size; | 1536 fullness_[space] = allocation_address + size; |
| 1530 return allocation_address; | 1537 return allocation_address; |
| 1531 } | 1538 } |
| 1532 | 1539 |
| 1533 | 1540 |
| 1534 } } // namespace v8::internal | 1541 } } // namespace v8::internal |
| OLD | NEW |