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

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

Issue 2240523003: Revert of [turbofan] Split CodeGenerator::GenerateCode into AssembleCode and FinishCodeObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 448b0429276c13eeb6863c2d1f79467bcd86f552..ff8e5b9368b65a52ebef8b341f92cd088bbc607d 100644
--- a/src/compiler/code-generator.h
+++ b/src/compiler/code-generator.h
@@ -48,24 +48,17 @@
// Generates native code for a sequence of instructions.
class CodeGenerator final : public GapResolver::Assembler {
public:
- CodeGenerator(Zone* zone, CompilationInfo* info);
-
- // 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();
+ explicit CodeGenerator(Frame* frame, Linkage* linkage,
+ InstructionSequence* code, CompilationInfo* info);
+
+ // Generate native code.
+ Handle<Code> GenerateCode();
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()]; }
@@ -75,6 +68,9 @@
SafepointTableBuilder* safepoints() { return &safepoints_; }
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);
@@ -261,11 +257,11 @@
friend class OutOfLineCode;
FrameAccessState* frame_access_state_;
- Linkage* linkage_;
- InstructionSequence* code_;
+ Linkage* const linkage_;
+ InstructionSequence* const code_;
UnwindingInfoWriter unwinding_info_writer_;
CompilationInfo* const info_;
- Label* labels_;
+ Label* const labels_;
Label return_label_;
RpoNumber current_block_;
SourcePosition current_source_position_;
@@ -283,7 +279,6 @@
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