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

Side by Side Diff: src/serialize.cc

Issue 10093008: MIPS: Convert NaN values back for ia32 when running on simulator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | Annotate | Revision Log
« 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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 Object** limit = current + (size >> kPointerSizeLog2); 742 Object** limit = current + (size >> kPointerSizeLog2);
743 if (FLAG_log_snapshot_positions) { 743 if (FLAG_log_snapshot_positions) {
744 LOG(isolate_, SnapshotPositionEvent(address, source_->position())); 744 LOG(isolate_, SnapshotPositionEvent(address, source_->position()));
745 } 745 }
746 ReadChunk(current, limit, space_number, address); 746 ReadChunk(current, limit, space_number, address);
747 #ifdef DEBUG 747 #ifdef DEBUG
748 bool is_codespace = (space == HEAP->code_space()) || 748 bool is_codespace = (space == HEAP->code_space()) ||
749 ((space == HEAP->lo_space()) && (space_number == kLargeCode)); 749 ((space == HEAP->lo_space()) && (space_number == kLargeCode));
750 ASSERT(HeapObject::FromAddress(address)->IsCode() == is_codespace); 750 ASSERT(HeapObject::FromAddress(address)->IsCode() == is_codespace);
751 #endif 751 #endif
752
753 #ifdef USE_SIMULATOR
754 // The serializer may have converted all x86 NaN values to MIPS NaN values.
755 // Convert them back. IsNaN returns true for both kinds of NaN.
756 // Alignment and speed are non-issues, as this only happens on the simulator.
757 HeapObject* obj = HeapObject::cast(*write_back);
758 if (obj->IsNaN()) HeapNumber::cast(obj)->set_value(OS::nan_value());
759 #endif
752 } 760 }
753 761
754 762
755 // This macro is always used with a constant argument so it should all fold 763 // This macro is always used with a constant argument so it should all fold
756 // away to almost nothing in the generated code. It might be nicer to do this 764 // away to almost nothing in the generated code. It might be nicer to do this
757 // with the ternary operator but there are type issues with that. 765 // with the ternary operator but there are type issues with that.
758 #define ASSIGN_DEST_SPACE(space_number) \ 766 #define ASSIGN_DEST_SPACE(space_number) \
759 Space* dest_space; \ 767 Space* dest_space; \
760 if (space_number == NEW_SPACE) { \ 768 if (space_number == NEW_SPACE) { \
761 dest_space = isolate->heap()->new_space(); \ 769 dest_space = isolate->heap()->new_space(); \
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
1701 int Serializer::SpaceAreaSize(int space) { 1709 int Serializer::SpaceAreaSize(int space) {
1702 if (space == CODE_SPACE) { 1710 if (space == CODE_SPACE) {
1703 return isolate_->memory_allocator()->CodePageAreaSize(); 1711 return isolate_->memory_allocator()->CodePageAreaSize();
1704 } else { 1712 } else {
1705 return Page::kPageSize - Page::kObjectStartOffset; 1713 return Page::kPageSize - Page::kObjectStartOffset;
1706 } 1714 }
1707 } 1715 }
1708 1716
1709 1717
1710 } } // namespace v8::internal 1718 } } // 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