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

Side by Side Diff: src/ia32/ic-ia32.cc

Issue 5798002: Provide baseline for new GC infrastructure. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years 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
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after
1740 // last 4 bytes of a six byte register-to-memory move instruction. 1740 // last 4 bytes of a six byte register-to-memory move instruction.
1741 Address offset_address = 1741 Address offset_address =
1742 map_check_address + StoreIC::kOffsetToStoreInstruction + 2; 1742 map_check_address + StoreIC::kOffsetToStoreInstruction + 2;
1743 // The offset should have initial value (kMaxInt - 1), cleared value 1743 // The offset should have initial value (kMaxInt - 1), cleared value
1744 // (-1) or we should be clearing the inlined version. 1744 // (-1) or we should be clearing the inlined version.
1745 ASSERT(*reinterpret_cast<int*>(offset_address) == kMaxInt - 1 || 1745 ASSERT(*reinterpret_cast<int*>(offset_address) == kMaxInt - 1 ||
1746 *reinterpret_cast<int*>(offset_address) == -1 || 1746 *reinterpret_cast<int*>(offset_address) == -1 ||
1747 (offset == 0 && map == Heap::null_value())); 1747 (offset == 0 && map == Heap::null_value()));
1748 *reinterpret_cast<int*>(offset_address) = offset - kHeapObjectTag; 1748 *reinterpret_cast<int*>(offset_address) = offset - kHeapObjectTag;
1749 1749
1750 // Patch the offset in the write-barrier code. The offset is the 1750 if (!FLAG_new_gc) {
1751 // last 4 bytes of a six byte lea instruction. 1751 // Patch the offset in the write-barrier code. The offset is the
1752 offset_address = map_check_address + delta_to_record_write + 2; 1752 // last 4 bytes of a six byte lea instruction.
1753 // The offset should have initial value (kMaxInt), cleared value 1753 offset_address = map_check_address + delta_to_record_write + 2;
1754 // (-1) or we should be clearing the inlined version. 1754 // The offset should have initial value (kMaxInt), cleared value
1755 ASSERT(*reinterpret_cast<int*>(offset_address) == kMaxInt || 1755 // (-1) or we should be clearing the inlined version.
1756 *reinterpret_cast<int*>(offset_address) == -1 || 1756 ASSERT(*reinterpret_cast<int*>(offset_address) == kMaxInt ||
1757 (offset == 0 && map == Heap::null_value())); 1757 *reinterpret_cast<int*>(offset_address) == -1 ||
1758 *reinterpret_cast<int*>(offset_address) = offset - kHeapObjectTag; 1758 (offset == 0 && map == Heap::null_value()));
1759 *reinterpret_cast<int*>(offset_address) = offset - kHeapObjectTag;
1760 }
1759 1761
1760 return true; 1762 return true;
1761 } 1763 }
1762 1764
1763 1765
1764 static bool PatchInlinedMapCheck(Address address, Object* map) { 1766 static bool PatchInlinedMapCheck(Address address, Object* map) {
1765 if (V8::UseCrankshaft()) return false; 1767 if (V8::UseCrankshaft()) return false;
1766 1768
1767 Address test_instruction_address = 1769 Address test_instruction_address =
1768 address + Assembler::kCallTargetAddressOffset; 1770 address + Assembler::kCallTargetAddressOffset;
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
2116 // short jump at this position. 2118 // short jump at this position.
2117 Address jmp_address = test_instruction_address - delta; 2119 Address jmp_address = test_instruction_address - delta;
2118 ASSERT(*jmp_address == Assembler::kJmpShortOpcode); 2120 ASSERT(*jmp_address == Assembler::kJmpShortOpcode);
2119 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | not_zero); 2121 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | not_zero);
2120 } 2122 }
2121 2123
2122 2124
2123 } } // namespace v8::internal 2125 } } // namespace v8::internal
2124 2126
2125 #endif // V8_TARGET_ARCH_IA32 2127 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698