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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 virtual int Position() { return data_.length(); } | 102 virtual int Position() { return data_.length(); } |
103 void Print(FILE* fp) { | 103 void Print(FILE* fp) { |
104 int length = Position(); | 104 int length = Position(); |
105 for (int j = 0; j < length; j++) { | 105 for (int j = 0; j < length; j++) { |
106 if ((j & 0x1f) == 0x1f) { | 106 if ((j & 0x1f) == 0x1f) { |
107 fprintf(fp, "\n"); | 107 fprintf(fp, "\n"); |
108 } | 108 } |
109 if (j != 0) { | 109 if (j != 0) { |
110 fprintf(fp, ","); | 110 fprintf(fp, ","); |
111 } | 111 } |
112 fprintf(fp, "%d", at(j)); | 112 fprintf(fp, "%u", static_cast<unsigned char>(at(j))); |
113 } | 113 } |
114 } | 114 } |
115 char at(int i) { return data_[i]; } | 115 char at(int i) { return data_[i]; } |
116 bool Compress(Compressor* compressor) { | 116 bool Compress(Compressor* compressor) { |
117 ASSERT_EQ(-1, raw_size_); | 117 ASSERT_EQ(-1, raw_size_); |
118 raw_size_ = data_.length(); | 118 raw_size_ = data_.length(); |
119 if (!compressor->Compress(data_.ToVector())) return false; | 119 if (!compressor->Compress(data_.ToVector())) return false; |
120 data_.Clear(); | 120 data_.Clear(); |
121 data_.AddAll(*compressor->output()); | 121 data_.AddAll(*compressor->output()); |
122 return true; | 122 return true; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 sink.WriteSpaceUsed( | 339 sink.WriteSpaceUsed( |
340 partial_ser.CurrentAllocationAddress(i::NEW_SPACE), | 340 partial_ser.CurrentAllocationAddress(i::NEW_SPACE), |
341 partial_ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE), | 341 partial_ser.CurrentAllocationAddress(i::OLD_POINTER_SPACE), |
342 partial_ser.CurrentAllocationAddress(i::OLD_DATA_SPACE), | 342 partial_ser.CurrentAllocationAddress(i::OLD_DATA_SPACE), |
343 partial_ser.CurrentAllocationAddress(i::CODE_SPACE), | 343 partial_ser.CurrentAllocationAddress(i::CODE_SPACE), |
344 partial_ser.CurrentAllocationAddress(i::MAP_SPACE), | 344 partial_ser.CurrentAllocationAddress(i::MAP_SPACE), |
345 partial_ser.CurrentAllocationAddress(i::CELL_SPACE), | 345 partial_ser.CurrentAllocationAddress(i::CELL_SPACE), |
346 partial_ser.CurrentAllocationAddress(i::LO_SPACE)); | 346 partial_ser.CurrentAllocationAddress(i::LO_SPACE)); |
347 return 0; | 347 return 0; |
348 } | 348 } |
OLD | NEW |