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

Side by Side Diff: src/compiler.h

Issue 1415133002: Introduce a reference to the code object of inlined functions in CompilationInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweak Created 5 years, 2 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 | « no previous file | src/compiler/code-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_COMPILER_H_ 5 #ifndef V8_COMPILER_H_
6 #define V8_COMPILER_H_ 6 #define V8_COMPILER_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/ast.h" 9 #include "src/ast.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 397 }
398 JavaScriptFrame* osr_frame() const { return osr_frame_; } 398 JavaScriptFrame* osr_frame() const { return osr_frame_; }
399 void set_osr_frame(JavaScriptFrame* osr_frame) { osr_frame_ = osr_frame; } 399 void set_osr_frame(JavaScriptFrame* osr_frame) { osr_frame_ = osr_frame; }
400 400
401 #if DEBUG 401 #if DEBUG
402 void PrintAstForTesting(); 402 void PrintAstForTesting();
403 #endif 403 #endif
404 404
405 bool has_simple_parameters(); 405 bool has_simple_parameters();
406 406
407 typedef std::vector<Handle<SharedFunctionInfo>> InlinedFunctionList; 407 struct InlinedFunctionHolder {
408 Handle<SharedFunctionInfo> shared_info;
409
410 // Root that holds the unoptimized code of the inlined function alive
411 // (and out of reach of code flushing) until we finish compilation.
412 // Do not remove.
413 Handle<Code> inlined_code_object_root;
414
415 explicit InlinedFunctionHolder(
416 Handle<SharedFunctionInfo> inlined_shared_info)
417 : shared_info(inlined_shared_info),
418 inlined_code_object_root(inlined_shared_info->code()) {}
419 };
420
421 typedef std::vector<InlinedFunctionHolder> InlinedFunctionList;
408 InlinedFunctionList const& inlined_functions() const { 422 InlinedFunctionList const& inlined_functions() const {
409 return inlined_functions_; 423 return inlined_functions_;
410 } 424 }
425
411 void AddInlinedFunction(Handle<SharedFunctionInfo> inlined_function) { 426 void AddInlinedFunction(Handle<SharedFunctionInfo> inlined_function) {
412 inlined_functions_.push_back(inlined_function); 427 inlined_functions_.push_back(InlinedFunctionHolder(inlined_function));
413 } 428 }
414 429
415 base::SmartArrayPointer<char> GetDebugName() const; 430 base::SmartArrayPointer<char> GetDebugName() const;
416 431
417 Code::Kind output_code_kind() const { return output_code_kind_; } 432 Code::Kind output_code_kind() const { return output_code_kind_; }
418 433
419 void set_output_code_kind(Code::Kind kind) { output_code_kind_ = kind; } 434 void set_output_code_kind(Code::Kind kind) { output_code_kind_ = kind; }
420 435
421 protected: 436 protected:
422 ParseInfo* parse_info_; 437 ParseInfo* parse_info_;
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 size_t info_zone_start_allocation_size_; 729 size_t info_zone_start_allocation_size_;
715 base::ElapsedTimer timer_; 730 base::ElapsedTimer timer_;
716 731
717 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); 732 DISALLOW_COPY_AND_ASSIGN(CompilationPhase);
718 }; 733 };
719 734
720 } // namespace internal 735 } // namespace internal
721 } // namespace v8 736 } // namespace v8
722 737
723 #endif // V8_COMPILER_H_ 738 #endif // V8_COMPILER_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/code-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698