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

Side by Side Diff: runtime/vm/assembler_x64.cc

Issue 12090034: Initial revision of ARM assembler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_mips.cc ('k') | runtime/vm/constants_arm.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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/memory_region.h" 10 #include "vm/memory_region.h"
11 #include "vm/runtime_entry.h" 11 #include "vm/runtime_entry.h"
12 #include "vm/stub_code.h" 12 #include "vm/stub_code.h"
13 13
14 namespace dart { 14 namespace dart {
15 15
16 DEFINE_FLAG(bool, print_stop_message, true, "Print stop message."); 16 DEFINE_FLAG(bool, print_stop_message, true, "Print stop message.");
17 DEFINE_FLAG(bool, code_comments, false,
18 "Include comments into code and disassembly");
19 DEFINE_FLAG(bool, use_sse41, true, "Use SSE 4.1 if available"); 17 DEFINE_FLAG(bool, use_sse41, true, "Use SSE 4.1 if available");
20 18
21 19
22 bool CPUFeatures::sse4_1_supported_ = false; 20 bool CPUFeatures::sse4_1_supported_ = false;
23 #ifdef DEBUG 21 #ifdef DEBUG
24 bool CPUFeatures::initialized_ = false; 22 bool CPUFeatures::initialized_ = false;
25 #endif 23 #endif
26 24
27 bool CPUFeatures::sse4_1_supported() { 25 bool CPUFeatures::sse4_1_supported() {
28 DEBUG_ASSERT(initialized_); 26 DEBUG_ASSERT(initialized_);
(...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after
2132 LoadClassById(result, TMP); 2130 LoadClassById(result, TMP);
2133 } 2131 }
2134 2132
2135 2133
2136 void Assembler::CompareClassId(Register object, intptr_t class_id) { 2134 void Assembler::CompareClassId(Register object, intptr_t class_id) {
2137 LoadClassId(TMP, object); 2135 LoadClassId(TMP, object);
2138 cmpl(TMP, Immediate(class_id)); 2136 cmpl(TMP, Immediate(class_id));
2139 } 2137 }
2140 2138
2141 2139
2142 void Assembler::Comment(const char* format, ...) {
2143 if (FLAG_code_comments) {
2144 char buffer[1024];
2145
2146 va_list args;
2147 va_start(args, format);
2148 OS::VSNPrint(buffer, sizeof(buffer), format, args);
2149 va_end(args);
2150
2151 comments_.Add(new CodeComment(buffer_.GetPosition(),
2152 String::Handle(String::New(buffer))));
2153 }
2154 }
2155
2156
2157 const Code::Comments& Assembler::GetCodeComments() const {
2158 Code::Comments& comments = Code::Comments::New(comments_.length());
2159
2160 for (intptr_t i = 0; i < comments_.length(); i++) {
2161 comments.SetPCOffsetAt(i, comments_[i]->pc_offset());
2162 comments.SetCommentAt(i, comments_[i]->comment());
2163 }
2164
2165 return comments;
2166 }
2167
2168
2169 static const char* cpu_reg_names[kNumberOfCpuRegisters] = { 2140 static const char* cpu_reg_names[kNumberOfCpuRegisters] = {
2170 "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", 2141 "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
2171 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" 2142 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
2172 }; 2143 };
2173 2144
2174 2145
2175 const char* Assembler::RegisterName(Register reg) { 2146 const char* Assembler::RegisterName(Register reg) {
2176 ASSERT((0 <= reg) && (reg < kNumberOfCpuRegisters)); 2147 ASSERT((0 <= reg) && (reg < kNumberOfCpuRegisters));
2177 return cpu_reg_names[reg]; 2148 return cpu_reg_names[reg];
2178 } 2149 }
2179 2150
2180 2151
2181 static const char* xmm_reg_names[kNumberOfXmmRegisters] = { 2152 static const char* xmm_reg_names[kNumberOfXmmRegisters] = {
2182 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", 2153 "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
2183 "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15" 2154 "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"
2184 }; 2155 };
2185 2156
2186 2157
2187 const char* Assembler::FpuRegisterName(FpuRegister reg) { 2158 const char* Assembler::FpuRegisterName(FpuRegister reg) {
2188 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 2159 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
2189 return xmm_reg_names[reg]; 2160 return xmm_reg_names[reg];
2190 } 2161 }
2191 2162
2192 2163
2193 } // namespace dart 2164 } // namespace dart
2194 2165
2195 #endif // defined TARGET_ARCH_X64 2166 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_mips.cc ('k') | runtime/vm/constants_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698