Skip to content

Commit

Permalink
Reland "[Compiler] Remove CompileDebugCode and EnsureBytecode and rep…
Browse files Browse the repository at this point in the history
…lace with Compile"

This is a reland of 21da12a
Original change's description:
> [Compiler] Remove CompileDebugCode and EnsureBytecode and replace with Compile
> 
> Removes the Compiler::CompileDebugCode and Compiler::EnsureBytecode functions
> and replaces them with a Compiler::Compile(Handle<SharedFunctionInfo> shared)
> function. The code in compiler.cc is refactored to use this function to compile
> the SharedFunctionInfo when compiling a JSFunction.
> 
> Also does some other cleanup:
>  - Removes CompileUnoptimizedFunction and inlines into new Compiler function
>  - Moves code to create top level SharedFunctionInfo into CompilerTopLevel and
>    out of FinalizeUnoptimizedCompile.
> 
> BUG=v8:6409
> 
> Change-Id: Ic54afcd8eb005c17f3ae6b2355060846e3091ca3
> Reviewed-on: https://chromium-review.googlesource.com/613760
> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Reviewed-by: Leszek Swirski <leszeks@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47394}

TBR=yangguo@chromium.org
TBR=jarin@chromium.org

Bug: v8:6409
Change-Id: If2eae66a85f129e746a5ca5c04935540f3f86b04
Reviewed-on: https://chromium-review.googlesource.com/618886
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47399}
  • Loading branch information
rmcilroy authored and Commit Bot committed Aug 17, 2017
1 parent d74ec7e commit 73ec559
Show file tree
Hide file tree
Showing 17 changed files with 204 additions and 320 deletions.
1 change: 0 additions & 1 deletion src/compilation-info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ CompilationInfo::CompilationInfo(Zone* zone, Isolate* isolate,
literal_ = literal;
source_range_map_ = parse_info->source_range_map();

if (parse_info->is_debug()) MarkAsDebug();
if (parse_info->is_eval()) MarkAsEval();
if (parse_info->is_native()) MarkAsNative();
if (parse_info->will_serialize()) MarkAsSerializing();
Expand Down
30 changes: 12 additions & 18 deletions src/compilation-info.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,17 @@ class V8_EXPORT_PRIVATE CompilationInfo final {
// Various configuration flags for a compilation, as well as some properties
// of the compiled code produced by a compilation.
enum Flag {
kIsDebug = 1 << 0,
kIsEval = 1 << 1,
kIsNative = 1 << 2,
kSerializing = 1 << 3,
kAccessorInliningEnabled = 1 << 4,
kFunctionContextSpecializing = 1 << 5,
kInliningEnabled = 1 << 6,
kDisableFutureOptimization = 1 << 7,
kSplittingEnabled = 1 << 8,
kSourcePositionsEnabled = 1 << 9,
kBailoutOnUninitialized = 1 << 10,
kLoopPeelingEnabled = 1 << 11,
kIsEval = 1 << 0,
kIsNative = 1 << 1,
kSerializing = 1 << 2,
kAccessorInliningEnabled = 1 << 3,
kFunctionContextSpecializing = 1 << 4,
kInliningEnabled = 1 << 5,
kDisableFutureOptimization = 1 << 6,
kSplittingEnabled = 1 << 7,
kSourcePositionsEnabled = 1 << 8,
kBailoutOnUninitialized = 1 << 9,
kLoopPeelingEnabled = 1 << 10,
};

// Construct a compilation info for unoptimized compilation.
Expand Down Expand Up @@ -108,11 +107,6 @@ class V8_EXPORT_PRIVATE CompilationInfo final {

// Flags used by unoptimized compilation.

// Compiles marked as debug produce unoptimized code with debug break slots.
// Inner functions that cannot be compiled w/o context are compiled eagerly.
void MarkAsDebug() { SetFlag(kIsDebug); }
bool is_debug() const { return GetFlag(kIsDebug); }

void MarkAsSerializing() { SetFlag(kSerializing); }
bool will_serialize() const { return GetFlag(kSerializing); }

Expand Down Expand Up @@ -161,7 +155,7 @@ class V8_EXPORT_PRIVATE CompilationInfo final {
// Generate a pre-aged prologue if we are optimizing for size, which
// will make code old more aggressive. Only apply to Code::FUNCTION,
// since only functions are aged in the compilation cache.
return FLAG_optimize_for_size && FLAG_age_code && !is_debug() &&
return FLAG_optimize_for_size && FLAG_age_code &&
output_code_kind() == Code::FUNCTION;
}

Expand Down
Loading

0 comments on commit 73ec559

Please sign in to comment.