| OLD | NEW |
| 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 #include "src/full-codegen/full-codegen.h" | 5 #include "src/full-codegen/full-codegen.h" |
| 6 | 6 |
| 7 #include "src/ast/ast-numbering.h" | 7 #include "src/ast/ast-numbering.h" |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
| 10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
| 11 #include "src/code-factory.h" | 11 #include "src/code-factory.h" |
| 12 #include "src/codegen.h" | 12 #include "src/codegen.h" |
| 13 #include "src/compiler.h" | 13 #include "src/compiler.h" |
| 14 #include "src/debug/debug.h" | 14 #include "src/debug/debug.h" |
| 15 #include "src/debug/liveedit.h" | 15 #include "src/debug/liveedit.h" |
| 16 #include "src/frames-inl.h" | 16 #include "src/frames-inl.h" |
| 17 #include "src/globals.h" | 17 #include "src/globals.h" |
| 18 #include "src/isolate-inl.h" | 18 #include "src/isolate-inl.h" |
| 19 #include "src/macro-assembler.h" | 19 #include "src/macro-assembler.h" |
| 20 #include "src/snapshot/snapshot.h" | 20 #include "src/snapshot/snapshot.h" |
| 21 #include "src/tracing/trace-event.h" | 21 #include "src/tracing/trace-event.h" |
| 22 | 22 |
| 23 namespace v8 { | 23 namespace v8 { |
| 24 namespace internal { | 24 namespace internal { |
| 25 | 25 |
| 26 #define __ ACCESS_MASM(masm()) | 26 #define __ ACCESS_MASM(masm()) |
| 27 | 27 |
| 28 class FullCodegenCompilationJob final : public CompilationJob { |
| 29 public: |
| 30 explicit FullCodegenCompilationJob(CompilationInfo* info) |
| 31 : CompilationJob(info, "Full-Codegen") {} |
| 32 |
| 33 CompilationJob::Status PrepareJobImpl() final { return SUCCEEDED; } |
| 34 |
| 35 CompilationJob::Status ExecuteJobImpl() final { return SUCCEEDED; } |
| 36 |
| 37 CompilationJob::Status FinalizeJobImpl() final { |
| 38 return FullCodeGenerator::MakeCode(info()) ? SUCCEEDED : FAILED; |
| 39 } |
| 40 }; |
| 41 |
| 42 // static |
| 43 CompilationJob* FullCodeGenerator::NewCompilationJob(CompilationInfo* info) { |
| 44 return new FullCodegenCompilationJob(info); |
| 45 } |
| 46 |
| 47 // static |
| 28 bool FullCodeGenerator::MakeCode(CompilationInfo* info) { | 48 bool FullCodeGenerator::MakeCode(CompilationInfo* info) { |
| 29 Isolate* isolate = info->isolate(); | 49 Isolate* isolate = info->isolate(); |
| 30 | 50 |
| 31 DCHECK(!FLAG_minimal); | 51 DCHECK(!FLAG_minimal); |
| 32 RuntimeCallTimerScope runtimeTimer(isolate, | 52 RuntimeCallTimerScope runtimeTimer(isolate, |
| 33 &RuntimeCallStats::CompileFullCode); | 53 &RuntimeCallStats::CompileFullCode); |
| 34 TimerEventScope<TimerEventCompileFullCode> timer(info->isolate()); | 54 TimerEventScope<TimerEventCompileFullCode> timer(info->isolate()); |
| 35 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( | 55 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( |
| 36 isolate, &tracing::TraceEventStatsTable::CompileFullCode); | 56 isolate, &tracing::TraceEventStatsTable::CompileFullCode); |
| 37 | 57 |
| (...skipping 1900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1938 return var->scope()->is_nonlinear() || | 1958 return var->scope()->is_nonlinear() || |
| 1939 var->initializer_position() >= proxy->position(); | 1959 var->initializer_position() >= proxy->position(); |
| 1940 } | 1960 } |
| 1941 | 1961 |
| 1942 | 1962 |
| 1943 #undef __ | 1963 #undef __ |
| 1944 | 1964 |
| 1945 | 1965 |
| 1946 } // namespace internal | 1966 } // namespace internal |
| 1947 } // namespace v8 | 1967 } // namespace v8 |
| OLD | NEW |