From b143cb09d04d3f408893e8272fe78c64b1b8f2bb Mon Sep 17 00:00:00 2001 From: mstarzinger Date: Fri, 26 Aug 2016 00:37:21 -0700 Subject: [PATCH] [compiler] Remove inclusion of inline header file. R=marja@chromium.org Review-Url: https://codereview.chromium.org/2281543002 Cr-Commit-Position: refs/heads/master@{#38926} --- src/compiler.cc | 27 ++++++++++++++++++ src/compiler.h | 35 +++++++----------------- src/compiler/basic-block-instrumentor.cc | 1 + src/compiler/bytecode-graph-builder.cc | 1 + src/profiler/profile-generator.h | 1 + 5 files changed, 40 insertions(+), 25 deletions(-) diff --git a/src/compiler.cc b/src/compiler.cc index 00c391e7f7..9e7592ee76 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -177,6 +177,9 @@ bool CompilationInfo::ShouldSelfOptimize() { !shared_info()->optimization_disabled(); } +void CompilationInfo::ReopenHandlesInNewHandleScope() { + closure_ = Handle(*closure_); +} bool CompilationInfo::has_simple_parameters() { return scope()->has_simple_parameters(); @@ -238,6 +241,30 @@ bool CompilationInfo::ExpectsJSReceiverAsReceiver() { return is_sloppy(parse_info()->language_mode()) && !parse_info()->is_native(); } +bool CompilationInfo::has_native_context() const { + return !closure().is_null() && (closure()->native_context() != nullptr); +} + +Context* CompilationInfo::native_context() const { + return has_native_context() ? closure()->native_context() : nullptr; +} + +bool CompilationInfo::has_global_object() const { return has_native_context(); } + +JSGlobalObject* CompilationInfo::global_object() const { + return has_global_object() ? native_context()->global_object() : nullptr; +} + +void CompilationInfo::AddInlinedFunction( + Handle inlined_function) { + inlined_functions_.push_back(InlinedFunctionHolder( + inlined_function, handle(inlined_function->code()))); +} + +Code::Kind CompilationInfo::output_code_kind() const { + return Code::ExtractKindFromFlags(code_flags_); +} + // ---------------------------------------------------------------------------- // Implementation of CompilationJob diff --git a/src/compiler.h b/src/compiler.h index ca7c24e857..80c84a6436 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -13,7 +13,6 @@ #include "src/contexts.h" #include "src/frames.h" #include "src/isolate.h" -#include "src/objects-inl.h" #include "src/source-position-table.h" #include "src/source-position.h" #include "src/zone.h" @@ -337,19 +336,11 @@ class CompilationInfo final { (FLAG_trap_on_stub_deopt && IsStub()); } - bool has_native_context() const { - return !closure().is_null() && (closure()->native_context() != nullptr); - } + bool has_native_context() const; + Context* native_context() const; - Context* native_context() const { - return has_native_context() ? closure()->native_context() : nullptr; - } - - bool has_global_object() const { return has_native_context(); } - - JSGlobalObject* global_object() const { - return has_global_object() ? native_context()->global_object() : nullptr; - } + bool has_global_object() const; + JSGlobalObject* global_object() const; // Accessors for the different compilation modes. bool IsOptimizing() const { return mode_ == OPTIMIZE; } @@ -387,9 +378,7 @@ class CompilationInfo final { deferred_handles_ = deferred_handles; } - void ReopenHandlesInNewHandleScope() { - closure_ = Handle(*closure_); - } + void ReopenHandlesInNewHandleScope(); void AbortOptimization(BailoutReason reason) { DCHECK(reason != kNoReason); @@ -435,10 +424,10 @@ class CompilationInfo final { // Do not remove. Handle inlined_code_object_root; - explicit InlinedFunctionHolder( - Handle inlined_shared_info) + InlinedFunctionHolder(Handle inlined_shared_info, + Handle inlined_code_object_root) : shared_info(inlined_shared_info), - inlined_code_object_root(inlined_shared_info->code()) {} + inlined_code_object_root(inlined_code_object_root) {} }; typedef std::vector InlinedFunctionList; @@ -446,15 +435,11 @@ class CompilationInfo final { return inlined_functions_; } - void AddInlinedFunction(Handle inlined_function) { - inlined_functions_.push_back(InlinedFunctionHolder(inlined_function)); - } + void AddInlinedFunction(Handle inlined_function); std::unique_ptr GetDebugName() const; - Code::Kind output_code_kind() const { - return Code::ExtractKindFromFlags(code_flags_); - } + Code::Kind output_code_kind() const; StackFrame::Type GetOutputStackFrameType() const; diff --git a/src/compiler/basic-block-instrumentor.cc b/src/compiler/basic-block-instrumentor.cc index a966a5b262..a3721e5561 100644 --- a/src/compiler/basic-block-instrumentor.cc +++ b/src/compiler/basic-block-instrumentor.cc @@ -13,6 +13,7 @@ #include "src/compiler/node.h" #include "src/compiler/operator-properties.h" #include "src/compiler/schedule.h" +#include "src/objects-inl.h" namespace v8 { namespace internal { diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc index a17947a246..94c7dc4d5c 100644 --- a/src/compiler/bytecode-graph-builder.cc +++ b/src/compiler/bytecode-graph-builder.cc @@ -8,6 +8,7 @@ #include "src/compiler/linkage.h" #include "src/compiler/operator-properties.h" #include "src/interpreter/bytecodes.h" +#include "src/objects-inl.h" namespace v8 { namespace internal { diff --git a/src/profiler/profile-generator.h b/src/profiler/profile-generator.h index b785eaaf5f..7aa9697ad9 100644 --- a/src/profiler/profile-generator.h +++ b/src/profiler/profile-generator.h @@ -9,6 +9,7 @@ #include "src/allocation.h" #include "src/base/hashmap.h" #include "src/compiler.h" +#include "src/log.h" #include "src/profiler/strings-storage.h" namespace v8 {