From f53418b8ba59edebde6948f440662981569029ce Mon Sep 17 00:00:00 2001 From: mstarzinger Date: Mon, 7 Mar 2016 02:17:03 -0800 Subject: [PATCH] [compiler] Move ClearExceptionFlag into Compiler. The enum in question is (and should) no longer be used outside of the compiler API and hence is being moved back into the Compiler class. R=yangguo@chromium.org Review URL: https://codereview.chromium.org/1762323002 Cr-Commit-Position: refs/heads/master@{#34526} --- src/accessors.cc | 2 +- src/compiler.h | 1 + src/debug/debug.cc | 2 +- src/globals.h | 6 ------ src/objects.cc | 2 +- src/runtime/runtime-compiler.cc | 2 +- src/runtime/runtime-function.cc | 2 +- src/runtime/runtime-test.cc | 2 +- 8 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/accessors.cc b/src/accessors.cc index 766509e2a5..8cdbcc37f0 100644 --- a/src/accessors.cc +++ b/src/accessors.cc @@ -817,7 +817,7 @@ void Accessors::FunctionLengthGetter( } else { // If the function isn't compiled yet, the length is not computed // correctly yet. Compile it now and return the right length. - if (Compiler::Compile(function, KEEP_EXCEPTION)) { + if (Compiler::Compile(function, Compiler::KEEP_EXCEPTION)) { length = function->shared()->length(); } if (isolate->has_pending_exception()) { diff --git a/src/compiler.h b/src/compiler.h index a4f77936b6..02c3ddd45a 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -583,6 +583,7 @@ class OptimizedCompileJob: public ZoneObject { // of the source code or deferred for lazy compilation at a later point. class Compiler : public AllStatic { public: + enum ClearExceptionFlag { KEEP_EXCEPTION, CLEAR_EXCEPTION }; enum ConcurrencyMode { NOT_CONCURRENT, CONCURRENT }; // =========================================================================== diff --git a/src/debug/debug.cc b/src/debug/debug.cc index c28e46885b..c77ff06930 100644 --- a/src/debug/debug.cc +++ b/src/debug/debug.cc @@ -1524,7 +1524,7 @@ bool Debug::EnsureDebugInfo(Handle shared, if (function.is_null()) { DCHECK(shared->HasDebugCode()); - } else if (!Compiler::Compile(function, CLEAR_EXCEPTION)) { + } else if (!Compiler::Compile(function, Compiler::CLEAR_EXCEPTION)) { return false; } diff --git a/src/globals.h b/src/globals.h index f6ab4a3519..61cce5cade 100644 --- a/src/globals.h +++ b/src/globals.h @@ -930,12 +930,6 @@ enum MaybeAssignedFlag { kNotAssigned, kMaybeAssigned }; enum ParseErrorType { kSyntaxError = 0, kReferenceError = 1 }; -enum ClearExceptionFlag { - KEEP_EXCEPTION, - CLEAR_EXCEPTION -}; - - enum MinusZeroMode { TREAT_MINUS_ZERO_AS_ZERO, FAIL_ON_MINUS_ZERO diff --git a/src/objects.cc b/src/objects.cc index 075a738d2c..cb81264284 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -12987,7 +12987,7 @@ void JSFunction::EnsureHasInitialMap(Handle function) { // The constructor should be compiled for the optimization hints to be // available. - Compiler::Compile(function, CLEAR_EXCEPTION); + Compiler::Compile(function, Compiler::CLEAR_EXCEPTION); // First create a new map with the size and number of in-object properties // suggested by the function. diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc index 73a9aef93a..f1392d876c 100644 --- a/src/runtime/runtime-compiler.cc +++ b/src/runtime/runtime-compiler.cc @@ -32,7 +32,7 @@ RUNTIME_FUNCTION(Runtime_CompileLazy) { StackLimitCheck check(isolate); if (check.JsHasOverflowed(1 * KB)) return isolate->StackOverflow(); - if (!Compiler::Compile(function, KEEP_EXCEPTION)) { + if (!Compiler::Compile(function, Compiler::KEEP_EXCEPTION)) { return isolate->heap()->exception(); } DCHECK(function->is_compiled()); diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc index 9ba7b8f13c..4570e9e68b 100644 --- a/src/runtime/runtime-function.cc +++ b/src/runtime/runtime-function.cc @@ -153,7 +153,7 @@ RUNTIME_FUNCTION(Runtime_SetCode) { Handle target_shared(target->shared()); Handle source_shared(source->shared()); - if (!Compiler::Compile(source, KEEP_EXCEPTION)) { + if (!Compiler::Compile(source, Compiler::KEEP_EXCEPTION)) { return isolate->heap()->exception(); } diff --git a/src/runtime/runtime-test.cc b/src/runtime/runtime-test.cc index 5f27a609a6..5117e42679 100644 --- a/src/runtime/runtime-test.cc +++ b/src/runtime/runtime-test.cc @@ -398,7 +398,7 @@ RUNTIME_FUNCTION(Runtime_DisassembleFunction) { DCHECK(args.length() == 1); // Get the function and make sure it is compiled. CONVERT_ARG_HANDLE_CHECKED(JSFunction, func, 0); - if (!Compiler::Compile(func, KEEP_EXCEPTION)) { + if (!Compiler::Compile(func, Compiler::KEEP_EXCEPTION)) { return isolate->heap()->exception(); } OFStream os(stdout);