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

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

Issue 2091733002: Reland [heap] Avoid the use of cells to point from code to new-space objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments. Created 4 years, 6 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/assembler-ia32-inl.h ('k') | src/mips/assembler-mips.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 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/division-by-constant.h" 8 #include "src/base/division-by-constant.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2577 matching lines...) Expand 10 before | Expand all | Expand 10 after
2588 // The registers are pushed starting with the lowest encoding, 2588 // The registers are pushed starting with the lowest encoding,
2589 // which means that lowest encodings are furthest away from 2589 // which means that lowest encodings are furthest away from
2590 // the stack pointer. 2590 // the stack pointer.
2591 DCHECK(reg_code >= 0 && reg_code < kNumSafepointRegisters); 2591 DCHECK(reg_code >= 0 && reg_code < kNumSafepointRegisters);
2592 return kNumSafepointRegisters - reg_code - 1; 2592 return kNumSafepointRegisters - reg_code - 1;
2593 } 2593 }
2594 2594
2595 2595
2596 void MacroAssembler::LoadHeapObject(Register result, 2596 void MacroAssembler::LoadHeapObject(Register result,
2597 Handle<HeapObject> object) { 2597 Handle<HeapObject> object) {
2598 AllowDeferredHandleDereference embedding_raw_address; 2598 mov(result, object);
2599 if (isolate()->heap()->InNewSpace(*object)) {
2600 Handle<Cell> cell = isolate()->factory()->NewCell(object);
2601 mov(result, Operand::ForCell(cell));
2602 } else {
2603 mov(result, object);
2604 }
2605 } 2599 }
2606 2600
2607 2601
2608 void MacroAssembler::CmpHeapObject(Register reg, Handle<HeapObject> object) { 2602 void MacroAssembler::CmpHeapObject(Register reg, Handle<HeapObject> object) {
2609 AllowDeferredHandleDereference using_raw_address; 2603 cmp(reg, object);
2610 if (isolate()->heap()->InNewSpace(*object)) {
2611 Handle<Cell> cell = isolate()->factory()->NewCell(object);
2612 cmp(reg, Operand::ForCell(cell));
2613 } else {
2614 cmp(reg, object);
2615 }
2616 } 2604 }
2617 2605
2618 2606 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) { Push(object); }
2619 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) {
2620 AllowDeferredHandleDereference using_raw_address;
2621 if (isolate()->heap()->InNewSpace(*object)) {
2622 Handle<Cell> cell = isolate()->factory()->NewCell(object);
2623 push(Operand::ForCell(cell));
2624 } else {
2625 Push(object);
2626 }
2627 }
2628
2629 2607
2630 void MacroAssembler::CmpWeakValue(Register value, Handle<WeakCell> cell, 2608 void MacroAssembler::CmpWeakValue(Register value, Handle<WeakCell> cell,
2631 Register scratch) { 2609 Register scratch) {
2632 mov(scratch, cell); 2610 mov(scratch, cell);
2633 cmp(value, FieldOperand(scratch, WeakCell::kValueOffset)); 2611 cmp(value, FieldOperand(scratch, WeakCell::kValueOffset));
2634 } 2612 }
2635 2613
2636 2614
2637 void MacroAssembler::GetWeakValue(Register value, Handle<WeakCell> cell) { 2615 void MacroAssembler::GetWeakValue(Register value, Handle<WeakCell> cell) {
2638 mov(value, cell); 2616 mov(value, cell);
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
3456 mov(eax, dividend); 3434 mov(eax, dividend);
3457 shr(eax, 31); 3435 shr(eax, 31);
3458 add(edx, eax); 3436 add(edx, eax);
3459 } 3437 }
3460 3438
3461 3439
3462 } // namespace internal 3440 } // namespace internal
3463 } // namespace v8 3441 } // namespace v8
3464 3442
3465 #endif // V8_TARGET_ARCH_IA32 3443 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32-inl.h ('k') | src/mips/assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698