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

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

Issue 892843002: Add mistagging-readbarrier to weak cell 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
« 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 2380 matching lines...) Expand 10 before | Expand all | Expand 10 after
2391 Handle<Cell> cell = isolate()->factory()->NewCell(object); 2391 Handle<Cell> cell = isolate()->factory()->NewCell(object);
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 // TODO(erikcorry): Perhaps we can use a special weak cell that does not have
2402 // a read barrier, since we are not using it here. But then we have to be
2403 // sure we don't use the weak cell for normal loads that need a read barrier.
2401 mov(scratch, cell); 2404 mov(scratch, cell);
2402 cmp(value, FieldOperand(scratch, WeakCell::kValueOffset)); 2405 mov(scratch,
2406 FieldOperand(scratch, WeakCell::kValueOffsetDontForgetTheReadBarrier));
2407 and_(scratch, Immediate(~kReadBarrierTag));
2408 cmp(value, scratch);
2403 } 2409 }
2404 2410
2405 2411
2406 void MacroAssembler::LoadWeakValue(Register value, Handle<WeakCell> cell, 2412 void MacroAssembler::LoadWeakValue(Register value, Register scratch,
2407 Label* miss) { 2413 Handle<WeakCell> cell, Label* miss) {
2408 mov(value, cell); 2414 DCHECK(!value.is(scratch));
2409 mov(value, FieldOperand(value, WeakCell::kValueOffset)); 2415 mov(scratch, cell);
2416 mov(value,
2417 FieldOperand(scratch, WeakCell::kValueOffsetDontForgetTheReadBarrier));
2410 JumpIfSmi(value, miss); 2418 JumpIfSmi(value, miss);
2419 Label done;
2420 test(value, Immediate(kReadBarrierTag));
2421 j(not_zero, &done);
Hannes Payer (out of office) 2015/02/04 13:03:44 Do we need the test? Maybe the cpu is more happy w
2422 and_(value, Immediate(~kReadBarrierTag));
2423 mov(FieldOperand(scratch, WeakCell::kValueOffsetDontForgetTheReadBarrier),
2424 value);
2425 bind(&done);
2411 } 2426 }
2412 2427
2413 2428
2414 void MacroAssembler::Ret() { 2429 void MacroAssembler::Ret() {
2415 ret(0); 2430 ret(0);
2416 } 2431 }
2417 2432
2418 2433
2419 void MacroAssembler::Ret(int bytes_dropped, Register scratch) { 2434 void MacroAssembler::Ret(int bytes_dropped, Register scratch) {
2420 if (is_uint16(bytes_dropped)) { 2435 if (is_uint16(bytes_dropped)) {
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
3266 if (mag.shift > 0) sar(edx, mag.shift); 3281 if (mag.shift > 0) sar(edx, mag.shift);
3267 mov(eax, dividend); 3282 mov(eax, dividend);
3268 shr(eax, 31); 3283 shr(eax, 31);
3269 add(edx, eax); 3284 add(edx, eax);
3270 } 3285 }
3271 3286
3272 3287
3273 } } // namespace v8::internal 3288 } } // namespace v8::internal
3274 3289
3275 #endif // V8_TARGET_ARCH_IA32 3290 #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