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

Unified Diff: src/interpreter/interpreter.cc

Issue 2249153002: Revert of [Interpreter] Introduce InterpreterCompilationJob (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@offheap_peekhole
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 | « src/interpreter/bytecode-generator.cc ('k') | test/cctest/wasm/wasm-run-utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 6e1a7af79a7e43eb590aae0a19edc1c0e7046ad4..7bbb6d684effd732bd541531598c6ef66433959a 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -29,23 +29,6 @@
typedef InterpreterAssembler::Arg Arg;
#define __ assembler->
-
-class InterpreterCompilationJob final : public CompilationJob {
- public:
- explicit InterpreterCompilationJob(CompilationInfo* info);
-
- protected:
- Status PrepareJobImpl() final;
- Status ExecuteJobImpl() final;
- Status FinalizeJobImpl() final;
-
- private:
- BytecodeGenerator* generator() { return &generator_; }
-
- BytecodeGenerator generator_;
-
- DISALLOW_COPY_AND_ASSIGN(InterpreterCompilationJob);
-};
Interpreter::Interpreter(Isolate* isolate) : isolate_(isolate) {
memset(dispatch_table_, 0, sizeof(dispatch_table_));
@@ -149,39 +132,6 @@
return FLAG_interrupt_budget * kCodeSizeMultiplier;
}
-InterpreterCompilationJob::InterpreterCompilationJob(CompilationInfo* info)
- : CompilationJob(info, "Ignition"), generator_(info) {}
-
-InterpreterCompilationJob::Status InterpreterCompilationJob::PrepareJobImpl() {
- return SUCCEEDED;
-}
-
-InterpreterCompilationJob::Status InterpreterCompilationJob::ExecuteJobImpl() {
- generator()->GenerateBytecode();
-
- if (generator()->HasStackOverflow()) {
- return FAILED;
- }
- return SUCCEEDED;
-}
-
-InterpreterCompilationJob::Status InterpreterCompilationJob::FinalizeJobImpl() {
- Handle<BytecodeArray> bytecodes = generator()->FinalizeBytecode();
- if (generator()->HasStackOverflow()) {
- return FAILED;
- }
-
- if (FLAG_print_bytecode) {
- OFStream os(stdout);
- bytecodes->Print(os);
- os << std::flush;
- }
-
- info()->SetBytecodeArray(bytecodes);
- info()->SetCode(info()->isolate()->builtins()->InterpreterEntryTrampoline());
- return SUCCEEDED;
-}
-
bool Interpreter::MakeBytecode(CompilationInfo* info) {
RuntimeCallTimerScope runtimeTimer(info->isolate(),
&RuntimeCallStats::CompileIgnition);
@@ -206,10 +156,20 @@
}
#endif // DEBUG
- InterpreterCompilationJob job(info);
- if (job.PrepareJob() != CompilationJob::SUCCEEDED) return false;
- if (job.ExecuteJob() != CompilationJob::SUCCEEDED) return false;
- return job.FinalizeJob() == CompilationJob::SUCCEEDED;
+ BytecodeGenerator generator(info);
+ Handle<BytecodeArray> bytecodes = generator.MakeBytecode();
+
+ if (generator.HasStackOverflow()) return false;
+
+ if (FLAG_print_bytecode) {
+ OFStream os(stdout);
+ bytecodes->Print(os);
+ os << std::flush;
+ }
+
+ info->SetBytecodeArray(bytecodes);
+ info->SetCode(info->isolate()->builtins()->InterpreterEntryTrampoline());
+ return true;
}
bool Interpreter::IsDispatchTableInitialized() {
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | test/cctest/wasm/wasm-run-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698