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

Unified Diff: src/compiler/code-generator.h

Issue 2229243003: [turbofan] Split CodeGenerator::GenerateCode into AssembleCode and FinishCodeObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Extend parallel compilation of wasm in a separate CL Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/code-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-generator.h
diff --git a/src/compiler/code-generator.h b/src/compiler/code-generator.h
index ff8e5b9368b65a52ebef8b341f92cd088bbc607d..448b0429276c13eeb6863c2d1f79467bcd86f552 100644
--- a/src/compiler/code-generator.h
+++ b/src/compiler/code-generator.h
@@ -48,17 +48,24 @@ class InstructionOperandIterator {
// Generates native code for a sequence of instructions.
class CodeGenerator final : public GapResolver::Assembler {
public:
- explicit CodeGenerator(Frame* frame, Linkage* linkage,
- InstructionSequence* code, CompilationInfo* info);
+ CodeGenerator(Zone* zone, CompilationInfo* info);
- // Generate native code.
- Handle<Code> GenerateCode();
+ // Initialize before calling AssembleCode or FinishCodeObject.
+ void Initialize(Frame* frame, Linkage* linkage, InstructionSequence* code);
+
+ // Generate native code. This function can be run off the main thread.
+ bool AssembleCode();
+
+ // Finishes the code object generated in AssembleCode. This function returns
+ // an empty handle if AssembleCode() fails or has not been called.
+ Handle<Code> FinishCodeObject();
InstructionSequence* code() const { return code_; }
FrameAccessState* frame_access_state() const { return frame_access_state_; }
const Frame* frame() const { return frame_access_state_->frame(); }
Isolate* isolate() const { return info_->isolate(); }
Linkage* linkage() const { return linkage_; }
+ bool assemble_code_successful() { return assemble_code_successful_; }
Label* GetLabel(RpoNumber rpo) { return &labels_[rpo.ToSize()]; }
@@ -69,9 +76,6 @@ class CodeGenerator final : public GapResolver::Assembler {
Zone* zone() const { return code()->zone(); }
CompilationInfo* info() const { return info_; }
- // Create the FrameAccessState object. The Frame is immutable from here on.
- void CreateFrameAccessState(Frame* frame);
-
// Architecture - specific frame finalization.
void FinishFrame(Frame* frame);
@@ -257,11 +261,11 @@ class CodeGenerator final : public GapResolver::Assembler {
friend class OutOfLineCode;
FrameAccessState* frame_access_state_;
- Linkage* const linkage_;
- InstructionSequence* const code_;
+ Linkage* linkage_;
+ InstructionSequence* code_;
UnwindingInfoWriter unwinding_info_writer_;
CompilationInfo* const info_;
- Label* const labels_;
+ Label* labels_;
Label return_label_;
RpoNumber current_block_;
SourcePosition current_source_position_;
@@ -279,6 +283,7 @@ class CodeGenerator final : public GapResolver::Assembler {
OutOfLineCode* ools_;
int osr_pc_offset_;
SourcePositionTableBuilder source_position_table_builder_;
+ bool assemble_code_successful_;
};
} // namespace compiler
« 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