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

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: Fix merge 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
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ic/ia32/handler-compiler-ia32.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 "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. TODO(erikcorry): This should not
2430 // emit reloc info unless the serializer is enabled: the map is not going to
2431 // move or die.
2432 Handle<Map> weak_cell_map(isolate()->heap()->used_weak_cell_map());
2433 mov(scratch, weak_cell_map);
2434 mov(FieldOperand(value, HeapObject::kMapOffset), scratch);
2435
2436 mov(value,
2437 FieldOperand(value, WeakCell::kValueOffsetDontForgetTheReadBarrier));
2409 } 2438 }
2410 2439
2411 2440
2412 void MacroAssembler::LoadWeakValue(Register value, Handle<WeakCell> cell, 2441 void MacroAssembler::LoadWeakValue(Register value, Handle<WeakCell> cell,
2413 Label* miss) { 2442 Register scratch, Label* miss) {
2414 GetWeakValue(value, cell); 2443 GetWeakValue(value, scratch, cell);
2415 JumpIfSmi(value, miss); 2444 JumpIfSmi(value, miss);
2416 } 2445 }
2417 2446
2418 2447
2419 void MacroAssembler::Ret() { 2448 void MacroAssembler::Ret() {
2420 ret(0); 2449 ret(0);
2421 } 2450 }
2422 2451
2423 2452
2424 void MacroAssembler::Ret(int bytes_dropped, Register scratch) { 2453 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); 3312 if (mag.shift > 0) sar(edx, mag.shift);
3284 mov(eax, dividend); 3313 mov(eax, dividend);
3285 shr(eax, 31); 3314 shr(eax, 31);
3286 add(edx, eax); 3315 add(edx, eax);
3287 } 3316 }
3288 3317
3289 3318
3290 } } // namespace v8::internal 3319 } } // namespace v8::internal
3291 3320
3292 #endif // V8_TARGET_ARCH_IA32 3321 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ic/ia32/handler-compiler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698