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

Side by Side Diff: src/utils.h

Issue 1321663003: [Interpreter] Add support for loading literals from the constant pool. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_const_pool_1
Patch Set: Review comments 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
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_UTILS_H_ 5 #ifndef V8_UTILS_H_
6 #define V8_UTILS_H_ 6 #define V8_UTILS_H_
7 7
8 #include <limits.h> 8 #include <limits.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 1203
1204 // Write the C code 1204 // Write the C code
1205 // const char* <varname> = "<str>"; 1205 // const char* <varname> = "<str>";
1206 // const int <varname>_len = <len>; 1206 // const int <varname>_len = <len>;
1207 // to the file given by filename. Only the first len chars are written. 1207 // to the file given by filename. Only the first len chars are written.
1208 int WriteAsCFile(const char* filename, const char* varname, 1208 int WriteAsCFile(const char* filename, const char* varname,
1209 const char* str, int size, bool verbose = true); 1209 const char* str, int size, bool verbose = true);
1210 1210
1211 1211
1212 // ---------------------------------------------------------------------------- 1212 // ----------------------------------------------------------------------------
1213 // Data structures
1214
1215 template <typename T>
1216 inline Vector< Handle<Object> > HandleVector(v8::internal::Handle<T>* elms,
1217 int length) {
1218 return Vector< Handle<Object> >(
1219 reinterpret_cast<v8::internal::Handle<Object>*>(elms), length);
1220 }
1221
1222
1223 // ----------------------------------------------------------------------------
1224 // Memory 1213 // Memory
1225 1214
1226 // Copies words from |src| to |dst|. The data spans must not overlap. 1215 // Copies words from |src| to |dst|. The data spans must not overlap.
1227 template <typename T> 1216 template <typename T>
1228 inline void CopyWords(T* dst, const T* src, size_t num_words) { 1217 inline void CopyWords(T* dst, const T* src, size_t num_words) {
1229 STATIC_ASSERT(sizeof(T) == kPointerSize); 1218 STATIC_ASSERT(sizeof(T) == kPointerSize);
1230 // TODO(mvstanton): disabled because mac builds are bogus failing on this 1219 // TODO(mvstanton): disabled because mac builds are bogus failing on this
1231 // assert. They are doing a signed comparison. Investigate in 1220 // assert. They are doing a signed comparison. Investigate in
1232 // the morning. 1221 // the morning.
1233 // DCHECK(Min(dst, const_cast<T*>(src)) + num_words <= 1222 // DCHECK(Min(dst, const_cast<T*>(src)) + num_words <=
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 uint32_t* ptr = reinterpret_cast<uint32_t*>(p); 1737 uint32_t* ptr = reinterpret_cast<uint32_t*>(p);
1749 *ptr = c.u[0]; 1738 *ptr = c.u[0];
1750 *(ptr + 1) = c.u[1]; 1739 *(ptr + 1) = c.u[1];
1751 #endif // V8_TARGET_ARCH_MIPS 1740 #endif // V8_TARGET_ARCH_MIPS
1752 } 1741 }
1753 1742
1754 } // namespace internal 1743 } // namespace internal
1755 } // namespace v8 1744 } // namespace v8
1756 1745
1757 #endif // V8_UTILS_H_ 1746 #endif // V8_UTILS_H_
OLDNEW
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698