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

Side by Side Diff: src/mips/macro-assembler-mips.cc

Issue 421923003: Support for dynamic write-barrier counters everywhere. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | « src/ia32/macro-assembler-ia32.cc ('k') | src/mips64/macro-assembler-mips64.cc » ('j') | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #if V8_TARGET_ARCH_MIPS 9 #if V8_TARGET_ARCH_MIPS
10 10
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 Check(eq, 226 Check(eq,
227 kWrongAddressOrValuePassedToRecordWrite, 227 kWrongAddressOrValuePassedToRecordWrite,
228 dst, 228 dst,
229 Operand(isolate()->factory()->meta_map())); 229 Operand(isolate()->factory()->meta_map()));
230 } 230 }
231 231
232 if (!FLAG_incremental_marking) { 232 if (!FLAG_incremental_marking) {
233 return; 233 return;
234 } 234 }
235 235
236 // Count number of write barriers in generated code.
237 isolate()->counters()->write_barriers_static()->Increment();
238 // TODO(mstarzinger): Dynamic counter missing.
239
240 if (emit_debug_code()) { 236 if (emit_debug_code()) {
241 lw(at, FieldMemOperand(object, HeapObject::kMapOffset)); 237 lw(at, FieldMemOperand(object, HeapObject::kMapOffset));
242 Check(eq, 238 Check(eq,
243 kWrongAddressOrValuePassedToRecordWrite, 239 kWrongAddressOrValuePassedToRecordWrite,
244 map, 240 map,
245 Operand(at)); 241 Operand(at));
246 } 242 }
247 243
248 Label done; 244 Label done;
249 245
(...skipping 22 matching lines...) Expand all
272 } 268 }
273 RecordWriteStub stub(isolate(), object, map, dst, OMIT_REMEMBERED_SET, 269 RecordWriteStub stub(isolate(), object, map, dst, OMIT_REMEMBERED_SET,
274 fp_mode); 270 fp_mode);
275 CallStub(&stub); 271 CallStub(&stub);
276 if (ra_status == kRAHasNotBeenSaved) { 272 if (ra_status == kRAHasNotBeenSaved) {
277 pop(ra); 273 pop(ra);
278 } 274 }
279 275
280 bind(&done); 276 bind(&done);
281 277
278 // Count number of write barriers in generated code.
279 isolate()->counters()->write_barriers_static()->Increment();
280 IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1, at, dst);
281
282 // Clobber clobbered registers when running with the debug-code flag 282 // Clobber clobbered registers when running with the debug-code flag
283 // turned on to provoke errors. 283 // turned on to provoke errors.
284 if (emit_debug_code()) { 284 if (emit_debug_code()) {
285 li(dst, Operand(BitCast<int32_t>(kZapValue + 12))); 285 li(dst, Operand(BitCast<int32_t>(kZapValue + 12)));
286 li(map, Operand(BitCast<int32_t>(kZapValue + 16))); 286 li(map, Operand(BitCast<int32_t>(kZapValue + 16)));
287 } 287 }
288 } 288 }
289 289
290 290
291 // Will clobber 4 registers: object, address, scratch, ip. The 291 // Will clobber 4 registers: object, address, scratch, ip. The
(...skipping 15 matching lines...) Expand all
307 lw(at, MemOperand(address)); 307 lw(at, MemOperand(address));
308 Assert( 308 Assert(
309 eq, kWrongAddressOrValuePassedToRecordWrite, at, Operand(value)); 309 eq, kWrongAddressOrValuePassedToRecordWrite, at, Operand(value));
310 } 310 }
311 311
312 if (remembered_set_action == OMIT_REMEMBERED_SET && 312 if (remembered_set_action == OMIT_REMEMBERED_SET &&
313 !FLAG_incremental_marking) { 313 !FLAG_incremental_marking) {
314 return; 314 return;
315 } 315 }
316 316
317 // Count number of write barriers in generated code.
318 isolate()->counters()->write_barriers_static()->Increment();
319 // TODO(mstarzinger): Dynamic counter missing.
320
321 // First, check if a write barrier is even needed. The tests below 317 // First, check if a write barrier is even needed. The tests below
322 // catch stores of smis and stores into the young generation. 318 // catch stores of smis and stores into the young generation.
323 Label done; 319 Label done;
324 320
325 if (smi_check == INLINE_SMI_CHECK) { 321 if (smi_check == INLINE_SMI_CHECK) {
326 ASSERT_EQ(0, kSmiTag); 322 ASSERT_EQ(0, kSmiTag);
327 JumpIfSmi(value, &done); 323 JumpIfSmi(value, &done);
328 } 324 }
329 325
330 if (pointers_to_here_check_for_value != kPointersToHereAreAlwaysInteresting) { 326 if (pointers_to_here_check_for_value != kPointersToHereAreAlwaysInteresting) {
(...skipping 15 matching lines...) Expand all
346 } 342 }
347 RecordWriteStub stub(isolate(), object, value, address, remembered_set_action, 343 RecordWriteStub stub(isolate(), object, value, address, remembered_set_action,
348 fp_mode); 344 fp_mode);
349 CallStub(&stub); 345 CallStub(&stub);
350 if (ra_status == kRAHasNotBeenSaved) { 346 if (ra_status == kRAHasNotBeenSaved) {
351 pop(ra); 347 pop(ra);
352 } 348 }
353 349
354 bind(&done); 350 bind(&done);
355 351
352 // Count number of write barriers in generated code.
353 isolate()->counters()->write_barriers_static()->Increment();
354 IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1, at,
355 value);
356
356 // Clobber clobbered registers when running with the debug-code flag 357 // Clobber clobbered registers when running with the debug-code flag
357 // turned on to provoke errors. 358 // turned on to provoke errors.
358 if (emit_debug_code()) { 359 if (emit_debug_code()) {
359 li(address, Operand(BitCast<int32_t>(kZapValue + 12))); 360 li(address, Operand(BitCast<int32_t>(kZapValue + 12)));
360 li(value, Operand(BitCast<int32_t>(kZapValue + 16))); 361 li(value, Operand(BitCast<int32_t>(kZapValue + 16)));
361 } 362 }
362 } 363 }
363 364
364 365
365 void MacroAssembler::RememberedSetHelper(Register object, // For debug tests. 366 void MacroAssembler::RememberedSetHelper(Register object, // For debug tests.
(...skipping 5388 matching lines...) Expand 10 before | Expand all | Expand 10 after
5754 } 5755 }
5755 if (ms.shift() > 0) sra(result, result, ms.shift()); 5756 if (ms.shift() > 0) sra(result, result, ms.shift());
5756 srl(at, dividend, 31); 5757 srl(at, dividend, 31);
5757 Addu(result, result, Operand(at)); 5758 Addu(result, result, Operand(at));
5758 } 5759 }
5759 5760
5760 5761
5761 } } // namespace v8::internal 5762 } } // namespace v8::internal
5762 5763
5763 #endif // V8_TARGET_ARCH_MIPS 5764 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/mips64/macro-assembler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698