| Index: src/compiler.h
|
| ===================================================================
|
| --- src/compiler.h (revision 6955)
|
| +++ src/compiler.h (working copy)
|
| @@ -118,7 +118,7 @@
|
| SetMode(OPTIMIZE);
|
| osr_ast_id_ = osr_ast_id;
|
| }
|
| - void DisableOptimization() { SetMode(NONOPT); }
|
| + void DisableOptimization();
|
|
|
| // Deoptimization support.
|
| bool HasDeoptimizationSupport() const { return supports_deoptimization_; }
|
| @@ -129,9 +129,7 @@
|
|
|
| // Determine whether or not we can adaptively optimize.
|
| bool AllowOptimize() {
|
| - return V8::UseCrankshaft() &&
|
| - !closure_.is_null() &&
|
| - function_->AllowOptimize();
|
| + return V8::UseCrankshaft() && !closure_.is_null();
|
| }
|
|
|
| private:
|
| @@ -217,10 +215,14 @@
|
|
|
| class Compiler : public AllStatic {
|
| public:
|
| - // All routines return a JSFunction.
|
| - // If an error occurs an exception is raised and
|
| - // the return handle contains NULL.
|
| + // Default maximum number of function optimization attempts before we
|
| + // give up.
|
| + static const int kDefaultMaxOptCount = 10;
|
|
|
| + // All routines return a SharedFunctionInfo.
|
| + // If an error occurs an exception is raised and the return handle
|
| + // contains NULL.
|
| +
|
| // Compile a String source within a context.
|
| static Handle<SharedFunctionInfo> Compile(Handle<String> source,
|
| Handle<Object> script_name,
|
|
|