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

Unified Diff: src/x64/assembler-x64.h

Issue 6577036: [Isolates] Merge from bleeding_edge to isolates, revisions 6100-6300. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/version.cc ('k') | src/x64/assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/assembler-x64.h
===================================================================
--- src/x64/assembler-x64.h (revision 6941)
+++ src/x64/assembler-x64.h (working copy)
@@ -98,6 +98,16 @@
static const int kNumRegisters = 16;
static const int kNumAllocatableRegisters = 10;
+ static int ToAllocationIndex(Register reg) {
+ return allocationIndexByRegisterCode[reg.code()];
+ }
+
+ static Register FromAllocationIndex(int index) {
+ ASSERT(index >= 0 && index < kNumAllocatableRegisters);
+ Register result = { registerCodeByAllocationIndex[index] };
+ return result;
+ }
+
static const char* AllocationIndexToString(int index) {
ASSERT(index >= 0 && index < kNumAllocatableRegisters);
const char* const names[] = {
@@ -143,6 +153,9 @@
// Unfortunately we can't make this private in a struct when initializing
// by assignment.
int code_;
+ private:
+ static const int registerCodeByAllocationIndex[kNumAllocatableRegisters];
+ static const int allocationIndexByRegisterCode[kNumRegisters];
};
const Register rax = { 0 };
@@ -173,6 +186,12 @@
return reg.code() - 1;
}
+ static XMMRegister FromAllocationIndex(int index) {
+ ASSERT(0 <= index && index < kNumAllocatableRegisters);
+ XMMRegister result = { index + 1 };
+ return result;
+ }
+
static const char* AllocationIndexToString(int index) {
ASSERT(index >= 0 && index < kNumAllocatableRegisters);
const char* const names[] = {
@@ -554,6 +573,8 @@
// The debug break slot must be able to contain a call instruction.
static const int kDebugBreakSlotLength = kCallInstructionLength;
+ // One byte opcode for test eax,0xXXXXXXXX.
+ static const byte kTestEaxByte = 0xA9;
// ---------------------------------------------------------------------------
// Code generation
« no previous file with comments | « src/version.cc ('k') | src/x64/assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698