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

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

Issue 1843143002: [turbofan] CodeGenerator: Frame setup refactoring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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
Index: src/compiler/code-generator.cc
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
index 0773ae081011d8df4644e29583bba7902fb43367..098e2257bbc5aa0921f5db746b620a3dae87c175 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -33,7 +33,7 @@ class CodeGenerator::JumpTable final : public ZoneObject {
CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage,
InstructionSequence* code, CompilationInfo* info)
- : frame_access_state_(new (code->zone()) FrameAccessState(frame)),
+ : frame_access_state_(nullptr),
linkage_(linkage),
code_(code),
info_(info),
@@ -56,6 +56,12 @@ CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage,
for (int i = 0; i < code->InstructionBlockCount(); ++i) {
new (&labels_[i]) Label;
}
+ CreateFrameAccessState(frame);
+}
+
+void CodeGenerator::CreateFrameAccessState(Frame* frame) {
+ FinishFrame(frame);
+ frame_access_state_ = new (code()->zone()) FrameAccessState(frame);
}
Handle<Code> CodeGenerator::GenerateCode() {
@@ -96,9 +102,6 @@ Handle<Code> CodeGenerator::GenerateCode() {
}
}
- // Finish the Frame
- frame()->AlignFrame(kFrameAlignmentInBytes);
- AssembleSetupStackPointer();
// Assemble all non-deferred blocks, followed by deferred ones.
for (int deferred = 0; deferred < 2; ++deferred) {
for (const InstructionBlock* block : code()->instruction_blocks()) {
@@ -143,7 +146,7 @@ Handle<Code> CodeGenerator::GenerateCode() {
masm()->bind(GetLabel(current_block_));
if (block->must_construct_frame()) {
- AssemblePrologue();
+ AssembleConstructFrame();
// We need to setup the root register after we assemble the prologue, to
// avoid clobbering callee saved registers in case of C linkage and
// using the roots.

Powered by Google App Engine
This is Rietveld 408576698