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

Side by Side Diff: src/assembler.cc

Issue 1287383003: Re-reland: Remove register index/code indirection (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Merge with ToT Created 5 years, 3 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
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "src/counters.h" 46 #include "src/counters.h"
47 #include "src/cpu-profiler.h" 47 #include "src/cpu-profiler.h"
48 #include "src/debug/debug.h" 48 #include "src/debug/debug.h"
49 #include "src/deoptimizer.h" 49 #include "src/deoptimizer.h"
50 #include "src/execution.h" 50 #include "src/execution.h"
51 #include "src/ic/ic.h" 51 #include "src/ic/ic.h"
52 #include "src/ic/stub-cache.h" 52 #include "src/ic/stub-cache.h"
53 #include "src/regexp/jsregexp.h" 53 #include "src/regexp/jsregexp.h"
54 #include "src/regexp/regexp-macro-assembler.h" 54 #include "src/regexp/regexp-macro-assembler.h"
55 #include "src/regexp/regexp-stack.h" 55 #include "src/regexp/regexp-stack.h"
56 #include "src/register-configuration.h"
56 #include "src/runtime/runtime.h" 57 #include "src/runtime/runtime.h"
57 #include "src/simulator.h" // For flushing instruction cache. 58 #include "src/simulator.h" // For flushing instruction cache.
58 #include "src/snapshot/serialize.h" 59 #include "src/snapshot/serialize.h"
59 #include "src/token.h" 60 #include "src/token.h"
60 61
61 #if V8_TARGET_ARCH_IA32 62 #if V8_TARGET_ARCH_IA32
62 #include "src/ia32/assembler-ia32-inl.h" // NOLINT 63 #include "src/ia32/assembler-ia32-inl.h" // NOLINT
63 #elif V8_TARGET_ARCH_X64 64 #elif V8_TARGET_ARCH_X64
64 #include "src/x64/assembler-x64-inl.h" // NOLINT 65 #include "src/x64/assembler-x64-inl.h" // NOLINT
65 #elif V8_TARGET_ARCH_ARM64 66 #elif V8_TARGET_ARCH_ARM64
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 #include "src/regexp/x87/regexp-macro-assembler-x87.h" // NOLINT 99 #include "src/regexp/x87/regexp-macro-assembler-x87.h" // NOLINT
99 #else // Unknown architecture. 100 #else // Unknown architecture.
100 #error "Unknown architecture." 101 #error "Unknown architecture."
101 #endif // Target architecture. 102 #endif // Target architecture.
102 #endif // V8_INTERPRETED_REGEXP 103 #endif // V8_INTERPRETED_REGEXP
103 104
104 namespace v8 { 105 namespace v8 {
105 namespace internal { 106 namespace internal {
106 107
107 // ----------------------------------------------------------------------------- 108 // -----------------------------------------------------------------------------
109 // Common register code.
110
111 const char* Register::ToString() {
112 // This is the mapping of allocation indices to registers.
113 DCHECK(reg_code >= 0 && reg_code < kNumRegisters);
114 return RegisterConfiguration::ArchDefault()->GetGeneralRegisterName(reg_code);
115 }
116
117
118 bool Register::IsAllocatable() const {
119 return ((1 << reg_code) &
120 RegisterConfiguration::ArchDefault()
121 ->allocatable_general_codes_mask()) != 0;
122 }
123
124
125 const char* DoubleRegister::ToString() {
126 // This is the mapping of allocation indices to registers.
127 DCHECK(reg_code >= 0 && reg_code < kMaxNumRegisters);
128 return RegisterConfiguration::ArchDefault()->GetDoubleRegisterName(reg_code);
129 }
130
131
132 bool DoubleRegister::IsAllocatable() const {
133 return ((1 << reg_code) &
134 RegisterConfiguration::ArchDefault()
135 ->allocatable_double_codes_mask()) != 0;
136 }
137
138
139 // -----------------------------------------------------------------------------
108 // Common double constants. 140 // Common double constants.
109 141
110 struct DoubleConstant BASE_EMBEDDED { 142 struct DoubleConstant BASE_EMBEDDED {
111 double min_int; 143 double min_int;
112 double one_half; 144 double one_half;
113 double minus_one_half; 145 double minus_one_half;
114 double negative_infinity; 146 double negative_infinity;
115 double the_hole_nan; 147 double the_hole_nan;
116 double uint32_bias; 148 double uint32_bias;
117 }; 149 };
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after
1846 1878
1847 1879
1848 void Assembler::DataAlign(int m) { 1880 void Assembler::DataAlign(int m) {
1849 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); 1881 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m));
1850 while ((pc_offset() & (m - 1)) != 0) { 1882 while ((pc_offset() & (m - 1)) != 0) {
1851 db(0); 1883 db(0);
1852 } 1884 }
1853 } 1885 }
1854 } // namespace internal 1886 } // namespace internal
1855 } // namespace v8 1887 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698