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

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

Issue 6594115: Optimize loads from root-array in X64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Reordered the root-array slightly. Should have no effect on ia32, but help slightly on x64. Created 9 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/x64/macro-assembler-x64.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 MacroAssembler::MacroAssembler(void* buffer, int size) 43 MacroAssembler::MacroAssembler(void* buffer, int size)
44 : Assembler(buffer, size), 44 : Assembler(buffer, size),
45 generating_stub_(false), 45 generating_stub_(false),
46 allow_stub_calls_(true), 46 allow_stub_calls_(true),
47 code_object_(Heap::undefined_value()) { 47 code_object_(Heap::undefined_value()) {
48 } 48 }
49 49
50 50
51 void MacroAssembler::LoadRoot(Register destination, Heap::RootListIndex index) { 51 void MacroAssembler::LoadRoot(Register destination, Heap::RootListIndex index) {
52 movq(destination, Operand(kRootRegister, index << kPointerSizeLog2)); 52 movq(destination, Operand(kRootRegister,
53 (index << kPointerSizeLog2) - kRootRegisterBias));
54 }
55
56
57 void MacroAssembler::LoadRootIndexed(Register destination,
58 Register variable_offset,
59 int fixed_offset) {
60 movq(destination,
61 Operand(kRootRegister,
62 variable_offset, times_pointer_size,
63 (fixed_offset << kPointerSizeLog2) - kRootRegisterBias));
53 } 64 }
54 65
55 66
56 void MacroAssembler::StoreRoot(Register source, Heap::RootListIndex index) { 67 void MacroAssembler::StoreRoot(Register source, Heap::RootListIndex index) {
57 movq(Operand(kRootRegister, index << kPointerSizeLog2), source); 68 movq(Operand(kRootRegister, (index << kPointerSizeLog2) - kRootRegisterBias),
69 source);
58 } 70 }
59 71
60 72
61 void MacroAssembler::PushRoot(Heap::RootListIndex index) { 73 void MacroAssembler::PushRoot(Heap::RootListIndex index) {
62 push(Operand(kRootRegister, index << kPointerSizeLog2)); 74 push(Operand(kRootRegister, (index << kPointerSizeLog2) - kRootRegisterBias));
63 } 75 }
64 76
65 77
66 void MacroAssembler::CompareRoot(Register with, Heap::RootListIndex index) { 78 void MacroAssembler::CompareRoot(Register with, Heap::RootListIndex index) {
67 cmpq(with, Operand(kRootRegister, index << kPointerSizeLog2)); 79 cmpq(with, Operand(kRootRegister,
80 (index << kPointerSizeLog2) - kRootRegisterBias));
68 } 81 }
69 82
70 83
71 void MacroAssembler::CompareRoot(const Operand& with, 84 void MacroAssembler::CompareRoot(const Operand& with,
72 Heap::RootListIndex index) { 85 Heap::RootListIndex index) {
73 ASSERT(!with.AddressUsesRegister(kScratchRegister)); 86 ASSERT(!with.AddressUsesRegister(kScratchRegister));
74 LoadRoot(kScratchRegister, index); 87 LoadRoot(kScratchRegister, index);
75 cmpq(with, kScratchRegister); 88 cmpq(with, kScratchRegister);
76 } 89 }
77 90
(...skipping 2573 matching lines...) Expand 10 before | Expand all | Expand 10 after
2651 CPU::FlushICache(address_, size_); 2664 CPU::FlushICache(address_, size_);
2652 2665
2653 // Check that the code was patched as expected. 2666 // Check that the code was patched as expected.
2654 ASSERT(masm_.pc_ == address_ + size_); 2667 ASSERT(masm_.pc_ == address_ + size_);
2655 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 2668 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2656 } 2669 }
2657 2670
2658 } } // namespace v8::internal 2671 } } // namespace v8::internal
2659 2672
2660 #endif // V8_TARGET_ARCH_X64 2673 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698