Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/serialize.h

Issue 115080: X64: Serialization fixed to use intptr_t/Address where needed. (Closed)
Patch Set: Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/serialize.cc » ('j') | src/serialize.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 if (str_ >= end_) return EOF; 224 if (str_ >= end_) return EOF;
225 return *str_++; 225 return *str_++;
226 } 226 }
227 227
228 int GetInt() { 228 int GetInt() {
229 int result; 229 int result;
230 GetBytes(reinterpret_cast<Address>(&result), sizeof(result)); 230 GetBytes(reinterpret_cast<Address>(&result), sizeof(result));
231 return result; 231 return result;
232 } 232 }
233 233
234 Address GetAddress() {
235 Address result;
236 GetBytes(reinterpret_cast<Address>(&result), sizeof(result));
237 return result;
238 }
239
234 void GetBytes(Address a, int size) { 240 void GetBytes(Address a, int size) {
235 ASSERT(str_ + size <= end_); 241 ASSERT(str_ + size <= end_);
236 memcpy(a, str_, size); 242 memcpy(a, str_, size);
237 str_ += size; 243 str_ += size;
238 } 244 }
239 245
240 char* GetString() { 246 char* GetString() {
241 ExpectC('['); 247 ExpectC('[');
242 int size = GetInt(); 248 int size = GetInt();
243 ExpectC(']'); 249 ExpectC(']');
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 #ifdef DEBUG 332 #ifdef DEBUG
327 bool expect_debug_information_; 333 bool expect_debug_information_;
328 #endif 334 #endif
329 335
330 DISALLOW_COPY_AND_ASSIGN(Deserializer); 336 DISALLOW_COPY_AND_ASSIGN(Deserializer);
331 }; 337 };
332 338
333 } } // namespace v8::internal 339 } } // namespace v8::internal
334 340
335 #endif // V8_SERIALIZE_H_ 341 #endif // V8_SERIALIZE_H_
OLDNEW
« no previous file with comments | « no previous file | src/serialize.cc » ('j') | src/serialize.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698