28 #include "../include/v8stdint.h"
41 template <
typename Char>
42 static int vector_hash(Vector<const Char>
string) {
44 for (
int i = 0; i <
string.length(); i++) {
45 int c =
static_cast<int>(
string[i]);
54 static bool vector_compare(
void* a,
void* b) {
55 CompleteParserRecorder::Key* string1 =
56 reinterpret_cast<CompleteParserRecorder::Key*
>(a);
57 CompleteParserRecorder::Key* string2 =
58 reinterpret_cast<CompleteParserRecorder::Key*
>(b);
59 if (string1->is_one_byte != string2->is_one_byte)
return false;
60 int length = string1->literal_bytes.length();
61 if (string2->literal_bytes.length() != length)
return false;
62 return memcmp(string1->literal_bytes.start(),
63 string2->literal_bytes.start(), length) == 0;
72 string_table_(vector_compare),
93 const char* arg_opt) {
94 if (has_error())
return;
96 function_store_.
Reset();
98 function_store_.
Add(start_pos);
100 function_store_.
Add(end_pos);
102 function_store_.
Add((arg_opt ==
NULL) ? 0 : 1);
112 for (
int i = 0; i < str.
length(); i++) {
113 function_store_.
Add(str[i]);
121 int hash = vector_hash(literal);
122 LogSymbol(start, hash,
true, literal);
129 int hash = vector_hash(literal);
134 void CompleteParserRecorder::LogSymbol(
int start,
138 Key key = { is_one_byte, literal_bytes };
139 HashMap::Entry* entry = string_table_.
Lookup(&key, hash,
true);
140 int id =
static_cast<int>(
reinterpret_cast<intptr_t
>(entry->value));
147 entry->value =
reinterpret_cast<void*
>(id);
148 Vector<Key> symbol = symbol_keys_.AddBlock(1, key);
149 entry->key = &symbol[0];
156 int function_size = function_store_.
size();
158 int symbol_size = symbol_store_.
size();
159 int padding =
sizeof(unsigned) - (symbol_size %
sizeof(
unsigned));
161 symbol_size += padding;
163 + (symbol_size /
sizeof(unsigned));
169 if (function_size > 0) {
181 void CompleteParserRecorder::WriteNumber(
int number) {
187 int mask = (1 << 28) - 1;
191 while (number < mask) {
196 symbol_store_.
Add(static_cast<byte>(number >> i) | 0x80u);
201 ASSERT(number < (1 << 7));
202 symbol_store_.
Add(static_cast<byte>(number));
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
static const unsigned kMagicNumber
Vector< T > SubVector(int from, int to)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in only print modified registers Don t break for ASM_UNIMPLEMENTED_BREAK macros print stack trace when an illegal exception is thrown randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot testing_bool_flag testing_int_flag string flag tmp file in which to serialize heap Print the time it takes to lazily compile hydrogen code stubs concurrent_recompilation concurrent_sweeping Print usage message
#define ASSERT(condition)
static const int kSymbolCountOffset
static const int kVersionOffset
virtual void LogOneByteSymbol(int start, Vector< const uint8_t > literal)
Vector< T > AddBlock(int size, T initial_value)
STATIC_ASSERT(sizeof(CPURegister)==sizeof(Register))
static void MemCopy(void *dest, const void *src, size_t size)
static const int kMessageEndPos
static const int kMessageStartPos
static const int kSizeOffset
static const int kMessageTextPos
static const int kMessageArgCountPos
static const int kFunctionsSizeOffset
Entry * Lookup(void *key, uint32_t hash, bool insert, AllocationPolicy allocator=AllocationPolicy())
static Vector< T > New(int length)
virtual void LogTwoByteSymbol(int start, Vector< const uint16_t > literal)
Vector< const char > CStrVector(const char *data)
Vector< unsigned > ExtractData()
static const int kHasErrorOffset
static const unsigned kCurrentVersion
static Vector< T > cast(Vector< S > input)
static const unsigned char kNumberTerminator
virtual void LogMessage(int start, int end, const char *message, const char *argument_opt)
#define ASSERT_EQ(v1, v2)
void WriteTo(Vector< T > destination)
static const int kHeaderSize
static const int kMagicOffset