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/mips64/macro-assembler-mips64.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/mips/macro-assembler-mips.cc ('k') | src/x64/macro-assembler-x64.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_MIPS64 9 #if V8_TARGET_ARCH_MIPS64
10 10
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 Check(eq, 230 Check(eq,
231 kWrongAddressOrValuePassedToRecordWrite, 231 kWrongAddressOrValuePassedToRecordWrite,
232 dst, 232 dst,
233 Operand(isolate()->factory()->meta_map())); 233 Operand(isolate()->factory()->meta_map()));
234 } 234 }
235 235
236 if (!FLAG_incremental_marking) { 236 if (!FLAG_incremental_marking) {
237 return; 237 return;
238 } 238 }
239 239
240 // Count number of write barriers in generated code.
241 isolate()->counters()->write_barriers_static()->Increment();
242 // TODO(mstarzinger): Dynamic counter missing.
243
244 if (emit_debug_code()) { 240 if (emit_debug_code()) {
245 ld(at, FieldMemOperand(object, HeapObject::kMapOffset)); 241 ld(at, FieldMemOperand(object, HeapObject::kMapOffset));
246 Check(eq, 242 Check(eq,
247 kWrongAddressOrValuePassedToRecordWrite, 243 kWrongAddressOrValuePassedToRecordWrite,
248 map, 244 map,
249 Operand(at)); 245 Operand(at));
250 } 246 }
251 247
252 Label done; 248 Label done;
253 249
(...skipping 22 matching lines...) Expand all
276 } 272 }
277 RecordWriteStub stub(isolate(), object, map, dst, OMIT_REMEMBERED_SET, 273 RecordWriteStub stub(isolate(), object, map, dst, OMIT_REMEMBERED_SET,
278 fp_mode); 274 fp_mode);
279 CallStub(&stub); 275 CallStub(&stub);
280 if (ra_status == kRAHasNotBeenSaved) { 276 if (ra_status == kRAHasNotBeenSaved) {
281 pop(ra); 277 pop(ra);
282 } 278 }
283 279
284 bind(&done); 280 bind(&done);
285 281
282 // Count number of write barriers in generated code.
283 isolate()->counters()->write_barriers_static()->Increment();
284 IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1, at, dst);
285
286 // Clobber clobbered registers when running with the debug-code flag 286 // Clobber clobbered registers when running with the debug-code flag
287 // turned on to provoke errors. 287 // turned on to provoke errors.
288 if (emit_debug_code()) { 288 if (emit_debug_code()) {
289 li(dst, Operand(BitCast<int64_t>(kZapValue + 12))); 289 li(dst, Operand(BitCast<int64_t>(kZapValue + 12)));
290 li(map, Operand(BitCast<int64_t>(kZapValue + 16))); 290 li(map, Operand(BitCast<int64_t>(kZapValue + 16)));
291 } 291 }
292 } 292 }
293 293
294 294
295 // Will clobber 4 registers: object, address, scratch, ip. The 295 // Will clobber 4 registers: object, address, scratch, ip. The
(...skipping 15 matching lines...) Expand all
311 ld(at, MemOperand(address)); 311 ld(at, MemOperand(address));
312 Assert( 312 Assert(
313 eq, kWrongAddressOrValuePassedToRecordWrite, at, Operand(value)); 313 eq, kWrongAddressOrValuePassedToRecordWrite, at, Operand(value));
314 } 314 }
315 315
316 if (remembered_set_action == OMIT_REMEMBERED_SET && 316 if (remembered_set_action == OMIT_REMEMBERED_SET &&
317 !FLAG_incremental_marking) { 317 !FLAG_incremental_marking) {
318 return; 318 return;
319 } 319 }
320 320
321 // Count number of write barriers in generated code.
322 isolate()->counters()->write_barriers_static()->Increment();
323 // TODO(mstarzinger): Dynamic counter missing.
324
325 // First, check if a write barrier is even needed. The tests below 321 // First, check if a write barrier is even needed. The tests below
326 // catch stores of smis and stores into the young generation. 322 // catch stores of smis and stores into the young generation.
327 Label done; 323 Label done;
328 324
329 if (smi_check == INLINE_SMI_CHECK) { 325 if (smi_check == INLINE_SMI_CHECK) {
330 ASSERT_EQ(0, kSmiTag); 326 ASSERT_EQ(0, kSmiTag);
331 JumpIfSmi(value, &done); 327 JumpIfSmi(value, &done);
332 } 328 }
333 329
334 if (pointers_to_here_check_for_value != kPointersToHereAreAlwaysInteresting) { 330 if (pointers_to_here_check_for_value != kPointersToHereAreAlwaysInteresting) {
(...skipping 15 matching lines...) Expand all
350 } 346 }
351 RecordWriteStub stub(isolate(), object, value, address, remembered_set_action, 347 RecordWriteStub stub(isolate(), object, value, address, remembered_set_action,
352 fp_mode); 348 fp_mode);
353 CallStub(&stub); 349 CallStub(&stub);
354 if (ra_status == kRAHasNotBeenSaved) { 350 if (ra_status == kRAHasNotBeenSaved) {
355 pop(ra); 351 pop(ra);
356 } 352 }
357 353
358 bind(&done); 354 bind(&done);
359 355
356 // Count number of write barriers in generated code.
357 isolate()->counters()->write_barriers_static()->Increment();
358 IncrementCounter(isolate()->counters()->write_barriers_dynamic(), 1, at,
359 value);
360
360 // Clobber clobbered registers when running with the debug-code flag 361 // Clobber clobbered registers when running with the debug-code flag
361 // turned on to provoke errors. 362 // turned on to provoke errors.
362 if (emit_debug_code()) { 363 if (emit_debug_code()) {
363 li(address, Operand(BitCast<int64_t>(kZapValue + 12))); 364 li(address, Operand(BitCast<int64_t>(kZapValue + 12)));
364 li(value, Operand(BitCast<int64_t>(kZapValue + 16))); 365 li(value, Operand(BitCast<int64_t>(kZapValue + 16)));
365 } 366 }
366 } 367 }
367 368
368 369
369 void MacroAssembler::RememberedSetHelper(Register object, // For debug tests. 370 void MacroAssembler::RememberedSetHelper(Register object, // For debug tests.
(...skipping 5572 matching lines...) Expand 10 before | Expand all | Expand 10 after
5942 } 5943 }
5943 if (ms.shift() > 0) sra(result, result, ms.shift()); 5944 if (ms.shift() > 0) sra(result, result, ms.shift());
5944 srl(at, dividend, 31); 5945 srl(at, dividend, 31);
5945 Addu(result, result, Operand(at)); 5946 Addu(result, result, Operand(at));
5946 } 5947 }
5947 5948
5948 5949
5949 } } // namespace v8::internal 5950 } } // namespace v8::internal
5950 5951
5951 #endif // V8_TARGET_ARCH_MIPS64 5952 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698