43 #define __ ACCESS_MASM(masm_)
48 : masm_(masm), msg_(msg) {
49 __ RecordComment(msg);
54 if (msg_[0] ==
'[')
__ RecordComment(
"]");
63 bool print_source =
false;
64 bool print_ast =
false;
68 print_source = FLAG_print_builtin_source;
69 print_ast = FLAG_print_builtin_ast;
72 print_source = FLAG_print_source;
73 print_ast = FLAG_print_ast;
74 ftype =
"user-defined";
77 if (FLAG_trace_codegen || print_source || print_ast) {
78 PrintF(
"[generating %s code for %s function: ", kind, ftype);
81 CodeStub::MajorName(info->
code_stub()->MajorKey(),
true);
82 PrintF(
"%s", name ==
NULL ?
"<unknown>" : name);
90 if (!info->
IsStub() && print_source) {
91 PrintF(
"--- Source from AST ---\n%s\n",
92 PrettyPrinter(info->
zone()).PrintProgram(info->
function()));
95 if (!info->
IsStub() && print_ast) {
96 PrintF(
"--- AST ---\n%s\n",
97 AstPrinter(info->
zone()).PrintProgram(info->
function()));
110 bool is_crankshafted =
111 Code::ExtractKindFromFlags(flags) == Code::OPTIMIZED_FUNCTION ||
116 false, is_crankshafted,
118 isolate->
counters()->total_compiled_code_size()->Increment(
119 code->instruction_size());
121 code->instruction_size());
127 #ifdef ENABLE_DISASSEMBLER
130 ? FLAG_print_builtin_code
131 : (FLAG_print_code ||
132 (info->
IsStub() && FLAG_print_code_stubs) ||
136 FunctionLiteral*
function = info->
function();
137 bool print_source = code->kind() == Code::OPTIMIZED_FUNCTION ||
138 code->kind() == Code::FUNCTION;
143 if (!script->IsUndefined() && !script->source()->IsUndefined()) {
144 PrintF(tracing_scope.file(),
"--- Raw source ---\n");
148 function->start_position());
152 function->end_position() -
function->start_position() + 1;
153 for (
int i = 0; i < source_len; i++) {
154 if (stream.HasMore()) {
155 PrintF(tracing_scope.file(),
"%c", stream.GetNext());
158 PrintF(tracing_scope.file(),
"\n\n");
162 if (FLAG_print_unopt_code) {
163 PrintF(tracing_scope.file(),
"--- Unoptimized code ---\n");
164 info->
closure()->shared()->code()->Disassemble(
165 function->debug_name()->ToCString().get(), tracing_scope.file());
167 PrintF(tracing_scope.file(),
"--- Optimized code ---\n");
168 PrintF(tracing_scope.file(),
171 PrintF(tracing_scope.file(),
"--- Code ---\n");
174 PrintF(tracing_scope.file(),
175 "source_position = %d\n",
function->start_position());
178 CodeStub::Major major_key = info->
code_stub()->MajorKey();
179 code->Disassemble(CodeStub::MajorName(major_key,
false),
180 tracing_scope.file());
182 code->Disassemble(function->debug_name()->ToCString().get(),
183 tracing_scope.file());
185 PrintF(tracing_scope.file(),
"--- End code ---\n");
187 #endif // ENABLE_DISASSEMBLER
198 if (FLAG_log_regexp) {
209 if (pos != RelocInfo::kNoPosition) {
223 GenerateReadElement(masm);
225 case NEW_SLOPPY_FAST:
226 GenerateNewSloppyFast(masm);
228 case NEW_SLOPPY_SLOW:
229 GenerateNewSloppySlow(masm);
232 GenerateNewStrict(masm);
238 int CEntryStub::MinorKey() {
239 int result = (save_doubles_ ==
kSaveFPRegs) ? 1 : 0;
240 ASSERT(result_size_ == 1 || result_size_ == 2);
242 return result | ((result_size_ == 1) ? 0 : 2);
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
void PrintF(const char *format,...)
CodeTracer * GetCodeTracer()
Handle< Script > script() const
Bootstrapper * bootstrapper()
Isolate * isolate() const
#define ASSERT(condition)
bool IsOptimizing() const
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 name
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 including flags
Handle< Object > CodeObject()
void GetCode(CodeDesc *desc)
FunctionLiteral * function() const
#define STATIC_ASCII_VECTOR(x)
Handle< JSFunction > closure() const
HydrogenCodeStub * code_stub() const
void IncrementCodeGeneratedBytes(bool is_crankshafted, int size)
CpuProfiler * cpu_profiler() const
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 code(assertions) for debugging") DEFINE_bool(code_comments
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 info
Handle< Code > NewCode(const CodeDesc &desc, Code::Flags flags, Handle< Object > self_reference, bool immovable=false, bool crankshafted=false, int prologue_offset=Code::kPrologueOffsetNotSet)
PositionsRecorder * positions_recorder()
int optimization_id() const
int prologue_offset() const