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

Side by Side Diff: src/serialize.cc

Issue 9910029: MIPS: Fix NaN value inconsistency with snapshots (alternate implementation). (Closed)
Patch Set: Fix debug build, by removing use of HeapNumber::set_value() Created 8 years, 8 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 1437
1438 // Mark this object as already serialized. 1438 // Mark this object as already serialized.
1439 bool start_new_page; 1439 bool start_new_page;
1440 int offset = serializer_->Allocate(space, size, &start_new_page); 1440 int offset = serializer_->Allocate(space, size, &start_new_page);
1441 serializer_->address_mapper()->AddMapping(object_, offset); 1441 serializer_->address_mapper()->AddMapping(object_, offset);
1442 if (start_new_page) { 1442 if (start_new_page) {
1443 sink_->Put(kNewPage, "NewPage"); 1443 sink_->Put(kNewPage, "NewPage");
1444 sink_->PutSection(space, "NewPageSpace"); 1444 sink_->PutSection(space, "NewPageSpace");
1445 } 1445 }
1446 1446
1447 #ifdef V8_TARGET_ARCH_MIPS
1448 #define MIPS_QNAN_HI 0x7ff7ffff
1449 #define MIPS_QNAN_LO 0xffffffff
1450 // Mips has a different encoding of qNaN than ia32, so any heap NaN built
1451 // with simulator must be re-encoded for the snapshot. Performance hit not
1452 // critical at mksnapshot/build time.
1453 if (object_->IsNaN()) {
1454 uint64_t mips_qnan_bits =
1455 (static_cast<uint64_t>(MIPS_QNAN_HI) << 32) | MIPS_QNAN_LO;
1456 Address value_ptr = (reinterpret_cast<byte*>(object_) +
1457 HeapNumber::kValueOffset - kHeapObjectTag);
1458 memcpy(value_ptr, &mips_qnan_bits, sizeof(mips_qnan_bits));
1459 }
1460 #endif // V8_TARGET_ARCH_MIPS
1461
1447 // Serialize the map (first word of the object). 1462 // Serialize the map (first word of the object).
1448 serializer_->SerializeObject(object_->map(), kPlain, kStartOfObject); 1463 serializer_->SerializeObject(object_->map(), kPlain, kStartOfObject);
1449 1464
1450 // Serialize the rest of the object. 1465 // Serialize the rest of the object.
1451 CHECK_EQ(0, bytes_processed_so_far_); 1466 CHECK_EQ(0, bytes_processed_so_far_);
1452 bytes_processed_so_far_ = kPointerSize; 1467 bytes_processed_so_far_ = kPointerSize;
1453 object_->IterateBody(object_->map()->instance_type(), size, this); 1468 object_->IterateBody(object_->map()->instance_type(), size, this);
1454 OutputRawData(object_->address() + size); 1469 OutputRawData(object_->address() + size);
1455 } 1470 }
1456 1471
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 int Serializer::SpaceAreaSize(int space) { 1714 int Serializer::SpaceAreaSize(int space) {
1700 if (space == CODE_SPACE) { 1715 if (space == CODE_SPACE) {
1701 return isolate_->memory_allocator()->CodePageAreaSize(); 1716 return isolate_->memory_allocator()->CodePageAreaSize();
1702 } else { 1717 } else {
1703 return Page::kPageSize - Page::kObjectStartOffset; 1718 return Page::kPageSize - Page::kObjectStartOffset;
1704 } 1719 }
1705 } 1720 }
1706 1721
1707 1722
1708 } } // namespace v8::internal 1723 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698