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

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

Issue 2097023002: 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: rebase. 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/x64/macro-assembler-x64.h ('k') | src/x87/assembler-x87-inl.h » ('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_X64 5 #if V8_TARGET_ARCH_X64
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 2948 matching lines...) Expand 10 before | Expand all | Expand 10 after
2959 Push(Smi::cast(*source)); 2959 Push(Smi::cast(*source));
2960 } else { 2960 } else {
2961 MoveHeapObject(kScratchRegister, source); 2961 MoveHeapObject(kScratchRegister, source);
2962 Push(kScratchRegister); 2962 Push(kScratchRegister);
2963 } 2963 }
2964 } 2964 }
2965 2965
2966 2966
2967 void MacroAssembler::MoveHeapObject(Register result, 2967 void MacroAssembler::MoveHeapObject(Register result,
2968 Handle<Object> object) { 2968 Handle<Object> object) {
2969 AllowDeferredHandleDereference using_raw_address;
2970 DCHECK(object->IsHeapObject()); 2969 DCHECK(object->IsHeapObject());
2971 if (isolate()->heap()->InNewSpace(*object)) { 2970 Move(result, object, RelocInfo::EMBEDDED_OBJECT);
2972 Handle<Cell> cell = isolate()->factory()->NewCell(object);
2973 Move(result, cell, RelocInfo::CELL);
2974 movp(result, Operand(result, 0));
2975 } else {
2976 Move(result, object, RelocInfo::EMBEDDED_OBJECT);
2977 }
2978 } 2971 }
2979 2972
2980 2973
2981 void MacroAssembler::LoadGlobalCell(Register dst, Handle<Cell> cell) { 2974 void MacroAssembler::LoadGlobalCell(Register dst, Handle<Cell> cell) {
2982 if (dst.is(rax)) { 2975 if (dst.is(rax)) {
2983 AllowDeferredHandleDereference embedding_raw_address; 2976 AllowDeferredHandleDereference embedding_raw_address;
2984 load_rax(cell.location(), RelocInfo::CELL); 2977 load_rax(cell.location(), RelocInfo::CELL);
2985 } else { 2978 } else {
2986 Move(dst, cell, RelocInfo::CELL); 2979 Move(dst, cell, RelocInfo::CELL);
2987 movp(dst, Operand(dst, 0)); 2980 movp(dst, Operand(dst, 0));
(...skipping 2732 matching lines...) Expand 10 before | Expand all | Expand 10 after
5720 movl(rax, dividend); 5713 movl(rax, dividend);
5721 shrl(rax, Immediate(31)); 5714 shrl(rax, Immediate(31));
5722 addl(rdx, rax); 5715 addl(rdx, rax);
5723 } 5716 }
5724 5717
5725 5718
5726 } // namespace internal 5719 } // namespace internal
5727 } // namespace v8 5720 } // namespace v8
5728 5721
5729 #endif // V8_TARGET_ARCH_X64 5722 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x87/assembler-x87-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698