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

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

Issue 2112193002: X87: 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: Created 4 years, 5 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/x87/assembler-x87-inl.h ('k') | no next file » | 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_X87 5 #if V8_TARGET_ARCH_X87
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 2516 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 // The registers are pushed starting with the lowest encoding, 2527 // The registers are pushed starting with the lowest encoding,
2528 // which means that lowest encodings are furthest away from 2528 // which means that lowest encodings are furthest away from
2529 // the stack pointer. 2529 // the stack pointer.
2530 DCHECK(reg_code >= 0 && reg_code < kNumSafepointRegisters); 2530 DCHECK(reg_code >= 0 && reg_code < kNumSafepointRegisters);
2531 return kNumSafepointRegisters - reg_code - 1; 2531 return kNumSafepointRegisters - reg_code - 1;
2532 } 2532 }
2533 2533
2534 2534
2535 void MacroAssembler::LoadHeapObject(Register result, 2535 void MacroAssembler::LoadHeapObject(Register result,
2536 Handle<HeapObject> object) { 2536 Handle<HeapObject> object) {
2537 AllowDeferredHandleDereference embedding_raw_address; 2537 mov(result, object);
2538 if (isolate()->heap()->InNewSpace(*object)) {
2539 Handle<Cell> cell = isolate()->factory()->NewCell(object);
2540 mov(result, Operand::ForCell(cell));
2541 } else {
2542 mov(result, object);
2543 }
2544 } 2538 }
2545 2539
2546 2540
2547 void MacroAssembler::CmpHeapObject(Register reg, Handle<HeapObject> object) { 2541 void MacroAssembler::CmpHeapObject(Register reg, Handle<HeapObject> object) {
2548 AllowDeferredHandleDereference using_raw_address; 2542 cmp(reg, object);
2549 if (isolate()->heap()->InNewSpace(*object)) {
2550 Handle<Cell> cell = isolate()->factory()->NewCell(object);
2551 cmp(reg, Operand::ForCell(cell));
2552 } else {
2553 cmp(reg, object);
2554 }
2555 } 2543 }
2556 2544
2557 2545 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) { Push(object); }
2558 void MacroAssembler::PushHeapObject(Handle<HeapObject> object) {
2559 AllowDeferredHandleDereference using_raw_address;
2560 if (isolate()->heap()->InNewSpace(*object)) {
2561 Handle<Cell> cell = isolate()->factory()->NewCell(object);
2562 push(Operand::ForCell(cell));
2563 } else {
2564 Push(object);
2565 }
2566 }
2567
2568 2546
2569 void MacroAssembler::CmpWeakValue(Register value, Handle<WeakCell> cell, 2547 void MacroAssembler::CmpWeakValue(Register value, Handle<WeakCell> cell,
2570 Register scratch) { 2548 Register scratch) {
2571 mov(scratch, cell); 2549 mov(scratch, cell);
2572 cmp(value, FieldOperand(scratch, WeakCell::kValueOffset)); 2550 cmp(value, FieldOperand(scratch, WeakCell::kValueOffset));
2573 } 2551 }
2574 2552
2575 2553
2576 void MacroAssembler::GetWeakValue(Register value, Handle<WeakCell> cell) { 2554 void MacroAssembler::GetWeakValue(Register value, Handle<WeakCell> cell) {
2577 mov(value, cell); 2555 mov(value, cell);
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
3303 mov(eax, dividend); 3281 mov(eax, dividend);
3304 shr(eax, 31); 3282 shr(eax, 31);
3305 add(edx, eax); 3283 add(edx, eax);
3306 } 3284 }
3307 3285
3308 3286
3309 } // namespace internal 3287 } // namespace internal
3310 } // namespace v8 3288 } // namespace v8
3311 3289
3312 #endif // V8_TARGET_ARCH_X87 3290 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x87/assembler-x87-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698