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

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

Issue 893073006: Add map-based read barrier to WeakCell Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/division-by-constant.h" 10 #include "src/base/division-by-constant.h"
(...skipping 2381 matching lines...) Expand 10 before | Expand all | Expand 10 after
2392 push(Operand::ForCell(cell)); 2392 push(Operand::ForCell(cell));
2393 } else { 2393 } else {
2394 Push(object); 2394 Push(object);
2395 } 2395 }
2396 } 2396 }
2397 2397
2398 2398
2399 void MacroAssembler::CmpWeakValue(Register value, Handle<WeakCell> cell, 2399 void MacroAssembler::CmpWeakValue(Register value, Handle<WeakCell> cell,
2400 Register scratch) { 2400 Register scratch) {
2401 mov(scratch, cell); 2401 mov(scratch, cell);
2402 cmp(value, FieldOperand(scratch, WeakCell::kValueOffset)); 2402 cmp(value,
2403 FieldOperand(scratch, WeakCell::kValueOffsetDontForgetTheReadBarrier));
2403 } 2404 }
2404 2405
2405 2406
2406 void MacroAssembler::GetWeakValue(Register value, Handle<WeakCell> cell) { 2407 void MacroAssembler::GetWeakValueNoReadBarrier(Register value,
2408 Handle<WeakCell> cell) {
2407 mov(value, cell); 2409 mov(value, cell);
2408 mov(value, FieldOperand(value, WeakCell::kValueOffset)); 2410 mov(value,
2411 FieldOperand(value, WeakCell::kValueOffsetDontForgetTheReadBarrier));
2412 }
2413
2414
2415 void MacroAssembler::LoadWeakValueNoReadBarrier(Register value,
2416 Handle<WeakCell> cell,
2417 Label* miss) {
2418 GetWeakValueNoReadBarrier(value, cell);
2419 JumpIfSmi(value, miss);
2420 }
2421
2422
2423 void MacroAssembler::GetWeakValue(Register value, Register scratch,
2424 Handle<WeakCell> cell) {
2425 DCHECK(!value.is(scratch));
2426 mov(value, cell);
2427
2428 // The read barrier means we have to overwrite the cell map with the one that
2429 // indicates the cell has been read from.
Hannes Payer (out of office) 2015/02/04 12:45:59 This seems to be more expensive than just clearing
2430 Handle<Map> weak_cell_map(isolate()->heap()->used_weak_cell_map());
2431 mov(scratch, weak_cell_map);
2432 mov(scratch, FieldOperand(value, HeapObject::kMapOffset));
ulan 2015/02/04 09:35:04 mov(FieldOperand(value, HeapObject::kMapOffset), s
2433
2434 mov(value,
2435 FieldOperand(value, WeakCell::kValueOffsetDontForgetTheReadBarrier));
2409 } 2436 }
2410 2437
2411 2438
2412 void MacroAssembler::LoadWeakValue(Register value, Handle<WeakCell> cell, 2439 void MacroAssembler::LoadWeakValue(Register value, Handle<WeakCell> cell,
2413 Label* miss) { 2440 Register scratch, Label* miss) {
2414 GetWeakValue(value, cell); 2441 GetWeakValue(value, scratch, cell);
2415 JumpIfSmi(value, miss); 2442 JumpIfSmi(value, miss);
2416 } 2443 }
2417 2444
2418 2445
2419 void MacroAssembler::Ret() { 2446 void MacroAssembler::Ret() {
2420 ret(0); 2447 ret(0);
2421 } 2448 }
2422 2449
2423 2450
2424 void MacroAssembler::Ret(int bytes_dropped, Register scratch) { 2451 void MacroAssembler::Ret(int bytes_dropped, Register scratch) {
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
3283 if (mag.shift > 0) sar(edx, mag.shift); 3310 if (mag.shift > 0) sar(edx, mag.shift);
3284 mov(eax, dividend); 3311 mov(eax, dividend);
3285 shr(eax, 31); 3312 shr(eax, 31);
3286 add(edx, eax); 3313 add(edx, eax);
3287 } 3314 }
3288 3315
3289 3316
3290 } } // namespace v8::internal 3317 } } // namespace v8::internal
3291 3318
3292 #endif // V8_TARGET_ARCH_IA32 3319 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698