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/x64/assembler-x64.cc

Issue 6201006: X64 Crankshaft: Ported lots of boilerplate code. (Closed)
Patch Set: Addressed review comments. Updated to match newest ia32 version. Created 9 years, 11 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/assembler-x64.h ('k') | src/x64/lithium-codegen-x64.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 void RelocInfo::PatchCode(byte* instructions, int instruction_count) { 179 void RelocInfo::PatchCode(byte* instructions, int instruction_count) {
180 // Patch the code at the current address with the supplied instructions. 180 // Patch the code at the current address with the supplied instructions.
181 for (int i = 0; i < instruction_count; i++) { 181 for (int i = 0; i < instruction_count; i++) {
182 *(pc_ + i) = *(instructions + i); 182 *(pc_ + i) = *(instructions + i);
183 } 183 }
184 184
185 // Indicate that code has changed. 185 // Indicate that code has changed.
186 CPU::FlushICache(pc_, instruction_count); 186 CPU::FlushICache(pc_, instruction_count);
187 } 187 }
188 188
189
190 // -----------------------------------------------------------------------------
191 // Register constants.
192
193 const int Register::registerCodeByAllocationIndex[kNumAllocatableRegisters] = {
194 // rax, rbx, rdx, rcx, rdi, r8, r9, r11, r14, r12
195 0, 3, 2, 1, 7, 8, 9, 11, 14, 12
196 };
197
198 const int Register::allocationIndexByRegisterCode[kNumRegisters] = {
199 0, 3, 2, 1, -1, -1, -1, 4, 5, 6, -1, 7, 9, -1, 8, -1
200 };
201
202
189 // ----------------------------------------------------------------------------- 203 // -----------------------------------------------------------------------------
190 // Implementation of Operand 204 // Implementation of Operand
191 205
192 Operand::Operand(Register base, int32_t disp) : rex_(0) { 206 Operand::Operand(Register base, int32_t disp) : rex_(0) {
193 len_ = 1; 207 len_ = 1;
194 if (base.is(rsp) || base.is(r12)) { 208 if (base.is(rsp) || base.is(r12)) {
195 // SIB byte is needed to encode (rsp + offset) or (r12 + offset). 209 // SIB byte is needed to encode (rsp + offset) or (r12 + offset).
196 set_sib(times_1, rsp, base); 210 set_sib(times_1, rsp, base);
197 } 211 }
198 212
(...skipping 2788 matching lines...) Expand 10 before | Expand all | Expand 10 after
2987 // specially coded on x64 means that it is a relative 32 bit address, as used 3001 // specially coded on x64 means that it is a relative 32 bit address, as used
2988 // by branch instructions. 3002 // by branch instructions.
2989 return (1 << rmode_) & kApplyMask; 3003 return (1 << rmode_) & kApplyMask;
2990 } 3004 }
2991 3005
2992 3006
2993 3007
2994 } } // namespace v8::internal 3008 } } // namespace v8::internal
2995 3009
2996 #endif // V8_TARGET_ARCH_X64 3010 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/lithium-codegen-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698