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

Side by Side Diff: src/compilation-info.h

Issue 2575703003: Move TraceInlinedFunction from Hydrogen graph builder to CompilationInfo. (Closed)
Patch Set: Created 4 years 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 | « no previous file | src/compilation-info.cc » ('j') | src/compilation-info.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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_COMPILATION_INFO_H_ 5 #ifndef V8_COMPILATION_INFO_H_
6 #define V8_COMPILATION_INFO_H_ 6 #define V8_COMPILATION_INFO_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "src/compilation-dependencies.h" 10 #include "src/compilation-dependencies.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 struct InlinedFunctionHolder { 276 struct InlinedFunctionHolder {
277 Handle<SharedFunctionInfo> shared_info; 277 Handle<SharedFunctionInfo> shared_info;
278 278
279 // Root that holds the unoptimized code of the inlined function alive 279 // Root that holds the unoptimized code of the inlined function alive
280 // (and out of reach of code flushing) until we finish compilation. 280 // (and out of reach of code flushing) until we finish compilation.
281 // Do not remove. 281 // Do not remove.
282 Handle<Code> inlined_code_object_root; 282 Handle<Code> inlined_code_object_root;
283 283
284 InliningPosition position; 284 InliningPosition position;
285 285
286 static const int kSourceNotDumped = -1;
287 int source_id;
Tobias Tebbi 2016/12/15 16:22:01 These are too many ids. Now we have inlining_id, i
288
286 InlinedFunctionHolder(Handle<SharedFunctionInfo> inlined_shared_info, 289 InlinedFunctionHolder(Handle<SharedFunctionInfo> inlined_shared_info,
287 Handle<Code> inlined_code_object_root, 290 Handle<Code> inlined_code_object_root,
288 SourcePosition pos) 291 SourcePosition pos)
289 : shared_info(inlined_shared_info), 292 : shared_info(inlined_shared_info),
290 inlined_code_object_root(inlined_code_object_root) { 293 inlined_code_object_root(inlined_code_object_root),
294 source_id(kSourceNotDumped) {
291 position.position = pos; 295 position.position = pos;
292 // initialized when generating the deoptimization literals 296 // initialized when generating the deoptimization literals
293 position.inlined_function_id = DeoptimizationInputData::kNotInlinedIndex; 297 position.inlined_function_id = DeoptimizationInputData::kNotInlinedIndex;
294 } 298 }
295 299
296 void RegisterInlinedFunctionId(size_t inlined_function_id) { 300 void RegisterInlinedFunctionId(size_t inlined_function_id) {
297 position.inlined_function_id = static_cast<int>(inlined_function_id); 301 position.inlined_function_id = static_cast<int>(inlined_function_id);
298 } 302 }
299 }; 303 };
300 304
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 void SetFlag(Flag flag) { flags_ |= flag; } 337 void SetFlag(Flag flag) { flags_ |= flag; }
334 338
335 void SetFlag(Flag flag, bool value) { 339 void SetFlag(Flag flag, bool value) {
336 flags_ = value ? flags_ | flag : flags_ & ~flag; 340 flags_ = value ? flags_ | flag : flags_ & ~flag;
337 } 341 }
338 342
339 bool GetFlag(Flag flag) const { return (flags_ & flag) != 0; } 343 bool GetFlag(Flag flag) const { return (flags_ & flag) != 0; }
340 344
341 void set_is_debug(); 345 void set_is_debug();
342 346
347 // If we are tracking source positions then this function prints a unique
Tobias Tebbi 2016/12/15 16:22:01 "tracking source positions" is not an accurate des
348 // identifier assigned to each inlining and dumps function source if it
349 // was inlined for the first time during the current optimization.
350 void TraceInlinedFunction(Handle<SharedFunctionInfo> shared,
351 SourcePosition position, int inlining_id);
352
353 // Assign source id to the given inlining: source ids are used to
354 // avoid dumping the same function multiple times to minimize trace
355 // size.
356 bool AssignSourceIdToInlining(int inlining_id, int* source_id);
357
343 unsigned flags_; 358 unsigned flags_;
344 359
345 Code::Flags code_flags_; 360 Code::Flags code_flags_;
346 361
347 Handle<JSFunction> closure_; 362 Handle<JSFunction> closure_;
348 363
349 // The compiled code. 364 // The compiled code.
350 Handle<Code> code_; 365 Handle<Code> code_;
351 366
352 // Compilation mode flag and whether deoptimization is allowed. 367 // Compilation mode flag and whether deoptimization is allowed.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 400
386 Vector<const char> debug_name_; 401 Vector<const char> debug_name_;
387 402
388 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); 403 DISALLOW_COPY_AND_ASSIGN(CompilationInfo);
389 }; 404 };
390 405
391 } // namespace internal 406 } // namespace internal
392 } // namespace v8 407 } // namespace v8
393 408
394 #endif // V8_COMPILATION_INFO_H_ 409 #endif // V8_COMPILATION_INFO_H_
OLDNEW
« no previous file with comments | « no previous file | src/compilation-info.cc » ('j') | src/compilation-info.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698