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

Side by Side Diff: src/arm/deoptimizer-arm.cc

Issue 7834018: Support compaction for code space pages. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: port changes from ia32 to arm & x64 Created 9 years, 3 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 160
161 // Replace the stack check address in the constant pool 161 // Replace the stack check address in the constant pool
162 // with the entry address of the replacement code. 162 // with the entry address of the replacement code.
163 uint32_t stack_check_address_offset = Memory::uint16_at(pc_after - 163 uint32_t stack_check_address_offset = Memory::uint16_at(pc_after -
164 2 * kInstrSize) & 0xfff; 164 2 * kInstrSize) & 0xfff;
165 Address stack_check_address_pointer = pc_after + stack_check_address_offset; 165 Address stack_check_address_pointer = pc_after + stack_check_address_offset;
166 ASSERT(Memory::uint32_at(stack_check_address_pointer) == 166 ASSERT(Memory::uint32_at(stack_check_address_pointer) ==
167 reinterpret_cast<uint32_t>(check_code->entry())); 167 reinterpret_cast<uint32_t>(check_code->entry()));
168 Memory::uint32_at(stack_check_address_pointer) = 168 Memory::uint32_at(stack_check_address_pointer) =
169 reinterpret_cast<uint32_t>(replacement_code->entry()); 169 reinterpret_cast<uint32_t>(replacement_code->entry());
170
171 RelocInfo rinfo(pc_after - 2 * kInstrSize,
172 RelocInfo::CODE_TARGET,
173 NULL,
174 unoptimized_code);
175 unoptimized_code->GetHeap()->incremental_marking()->RecordWriteIntoCode(
176 unoptimized_code, &rinfo, replacement_code);
170 } 177 }
171 178
172 179
173 void Deoptimizer::RevertStackCheckCodeAt(Address pc_after, 180 void Deoptimizer::RevertStackCheckCodeAt(Address pc_after,
174 Code* check_code, 181 Code* check_code,
175 Code* replacement_code) { 182 Code* replacement_code) {
176 const int kInstrSize = Assembler::kInstrSize; 183 const int kInstrSize = Assembler::kInstrSize;
177 ASSERT(Memory::uint32_at(pc_after - kInstrSize) == 0xe12fff3c); 184 ASSERT(Memory::uint32_at(pc_after - kInstrSize) == 0xe12fff3c);
178 ASSERT(Memory::uint8_at(pc_after - kInstrSize - 1) == 0xe5); 185 ASSERT(Memory::uint8_at(pc_after - kInstrSize - 1) == 0xe5);
179 ASSERT(Memory::uint8_at(pc_after - kInstrSize - 2) == 0x9f); 186 ASSERT(Memory::uint8_at(pc_after - kInstrSize - 2) == 0x9f);
180 187
181 // Replace NOP with conditional jump. 188 // Replace NOP with conditional jump.
182 CodePatcher patcher(pc_after - 3 * kInstrSize, 1); 189 CodePatcher patcher(pc_after - 3 * kInstrSize, 1);
183 patcher.masm()->b(+4, cs); 190 patcher.masm()->b(+4, cs);
184 191
185 // Replace the stack check address in the constant pool 192 // Replace the stack check address in the constant pool
186 // with the entry address of the replacement code. 193 // with the entry address of the replacement code.
187 uint32_t stack_check_address_offset = Memory::uint16_at(pc_after - 194 uint32_t stack_check_address_offset = Memory::uint16_at(pc_after -
188 2 * kInstrSize) & 0xfff; 195 2 * kInstrSize) & 0xfff;
189 Address stack_check_address_pointer = pc_after + stack_check_address_offset; 196 Address stack_check_address_pointer = pc_after + stack_check_address_offset;
190 ASSERT(Memory::uint32_at(stack_check_address_pointer) == 197 ASSERT(Memory::uint32_at(stack_check_address_pointer) ==
191 reinterpret_cast<uint32_t>(replacement_code->entry())); 198 reinterpret_cast<uint32_t>(replacement_code->entry()));
192 Memory::uint32_at(stack_check_address_pointer) = 199 Memory::uint32_at(stack_check_address_pointer) =
193 reinterpret_cast<uint32_t>(check_code->entry()); 200 reinterpret_cast<uint32_t>(check_code->entry());
201
202 check_code->GetHeap()->incremental_marking()->
203 RecordCodeTargetPatch(pc_after - 2 * kInstrSize, check_code);
194 } 204 }
195 205
196 206
197 static int LookupBailoutId(DeoptimizationInputData* data, unsigned ast_id) { 207 static int LookupBailoutId(DeoptimizationInputData* data, unsigned ast_id) {
198 ByteArray* translations = data->TranslationByteArray(); 208 ByteArray* translations = data->TranslationByteArray();
199 int length = data->DeoptCount(); 209 int length = data->DeoptCount();
200 for (int i = 0; i < length; i++) { 210 for (int i = 0; i < length; i++) {
201 if (static_cast<unsigned>(data->AstId(i)->value()) == ast_id) { 211 if (static_cast<unsigned>(data->AstId(i)->value()) == ast_id) {
202 TranslationIterator it(translations, data->TranslationIndex(i)->value()); 212 TranslationIterator it(translations, data->TranslationIndex(i)->value());
203 int value = it.Next(); 213 int value = it.Next();
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 __ push(ip); 771 __ push(ip);
762 __ b(&done); 772 __ b(&done);
763 ASSERT(masm()->pc_offset() - start == table_entry_size_); 773 ASSERT(masm()->pc_offset() - start == table_entry_size_);
764 } 774 }
765 __ bind(&done); 775 __ bind(&done);
766 } 776 }
767 777
768 #undef __ 778 #undef __
769 779
770 } } // namespace v8::internal 780 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/assembler-arm-inl.h ('k') | src/assembler.h » ('j') | src/assembler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698