MakeCode(Handle context, CompilationInfo* info) { FunctionLiteral* function = info->function(); ASSERT(function != NULL); // Rewrite the AST by introducing .result assignments where needed. if (!Rewriter::Process(function) || !AnalyzeVariableUsage(function)) { // Signal a stack overflow by returning a null handle. The stack // overflow exception will be thrown by the caller. return Handle::null(); } { // Compute top scope and allocate variables. For lazy compilation // the top scope only contains the single lazily compiled function, // so this doesn't re-allocate variables repeatedly. HistogramTimerScope timer(&Counters::variable_allocation); Scope* top = info->scope(); while (top->outer_scope() != NULL) top = top->outer_scope(); top->AllocateVariables(context); } #ifdef DEBUG if (Bootstrapper::IsActive() ? FLAG_print_builtin_scopes : FLAG_print_scopes) { info->scope()->Print(); } #endif // Optimize the AST. if (!Rewriter::Optimize(function)) { // Signal a stack overflow by returning a null handle. The stack // overflow exception will be thrown by the caller. return Handle::null(); } // Generate code and return it. Code generator selection is governed by // which backends are enabled and whether the function is considered // run-once code or not: // // --full-compiler enables the dedicated backend for code we expect to be // run once // --fast-compiler enables a speculative optimizing backend (for // non-run-once code) // // The normal choice of backend can be overridden with the flags // --always-full-compiler and --always-fast-compiler, which are mutually // incompatible. CHECK(!FLAG_always_full_compiler || !FLAG_always_fast_compiler); Handle shared = info->shared_info(); bool is_run_once = (shared.is_null()) ? info->scope()->is_global_scope() : (shared->is_toplevel() || shared->try_full_codegen()); if (FLAG_always_full_compiler || (FLAG_full_compiler && is_run_once)) { FullCodeGenSyntaxChecker checker; checker.Check(function); if (checker.has_supported_syntax()) { return FullCodeGenerator::MakeCode(info); } } else if (FLAG_always_fast_compiler || (FLAG_fast_compiler && !is_run_once)) { FastCodeGenSyntaxChecker checker; checker.Check(info); if (checker.has_supported_syntax()) { return FastCodeGenerator::MakeCode(info); } } return CodeGenerator::MakeCode(info); } static Handle MakeFunction(bool is_global, bool is_eval, Compiler::ValidationState validate, Handle 登录后可以享受更多权益 您还没有登录,登录后您可以: 收藏Android系统代码 收藏喜欢的文章 多个平台共享账号 去登录 首次使用?从这里 注册
::null(); } { // Compute top scope and allocate variables. For lazy compilation // the top scope only contains the single lazily compiled function, // so this doesn't re-allocate variables repeatedly. HistogramTimerScope timer(&Counters::variable_allocation); Scope* top = info->scope(); while (top->outer_scope() != NULL) top = top->outer_scope(); top->AllocateVariables(context); } #ifdef DEBUG if (Bootstrapper::IsActive() ? FLAG_print_builtin_scopes : FLAG_print_scopes) { info->scope()->Print(); } #endif // Optimize the AST. if (!Rewriter::Optimize(function)) { // Signal a stack overflow by returning a null handle. The stack // overflow exception will be thrown by the caller. return Handle::null(); } // Generate code and return it. Code generator selection is governed by // which backends are enabled and whether the function is considered // run-once code or not: // // --full-compiler enables the dedicated backend for code we expect to be // run once // --fast-compiler enables a speculative optimizing backend (for // non-run-once code) // // The normal choice of backend can be overridden with the flags // --always-full-compiler and --always-fast-compiler, which are mutually // incompatible. CHECK(!FLAG_always_full_compiler || !FLAG_always_fast_compiler); Handle shared = info->shared_info(); bool is_run_once = (shared.is_null()) ? info->scope()->is_global_scope() : (shared->is_toplevel() || shared->try_full_codegen()); if (FLAG_always_full_compiler || (FLAG_full_compiler && is_run_once)) { FullCodeGenSyntaxChecker checker; checker.Check(function); if (checker.has_supported_syntax()) { return FullCodeGenerator::MakeCode(info); } } else if (FLAG_always_fast_compiler || (FLAG_fast_compiler && !is_run_once)) { FastCodeGenSyntaxChecker checker; checker.Check(info); if (checker.has_supported_syntax()) { return FastCodeGenerator::MakeCode(info); } } return CodeGenerator::MakeCode(info); } static Handle MakeFunction(bool is_global, bool is_eval, Compiler::ValidationState validate, Handle 登录后可以享受更多权益 您还没有登录,登录后您可以: 收藏Android系统代码 收藏喜欢的文章 多个平台共享账号 去登录 首次使用?从这里 注册
::null(); } // Generate code and return it. Code generator selection is governed by // which backends are enabled and whether the function is considered // run-once code or not: // // --full-compiler enables the dedicated backend for code we expect to be // run once // --fast-compiler enables a speculative optimizing backend (for // non-run-once code) // // The normal choice of backend can be overridden with the flags // --always-full-compiler and --always-fast-compiler, which are mutually // incompatible. CHECK(!FLAG_always_full_compiler || !FLAG_always_fast_compiler); Handle shared = info->shared_info(); bool is_run_once = (shared.is_null()) ? info->scope()->is_global_scope() : (shared->is_toplevel() || shared->try_full_codegen()); if (FLAG_always_full_compiler || (FLAG_full_compiler && is_run_once)) { FullCodeGenSyntaxChecker checker; checker.Check(function); if (checker.has_supported_syntax()) { return FullCodeGenerator::MakeCode(info); } } else if (FLAG_always_fast_compiler || (FLAG_fast_compiler && !is_run_once)) { FastCodeGenSyntaxChecker checker; checker.Check(info); if (checker.has_supported_syntax()) { return FastCodeGenerator::MakeCode(info); } } return CodeGenerator::MakeCode(info); } static Handle MakeFunction(bool is_global, bool is_eval, Compiler::ValidationState validate, Handle 登录后可以享受更多权益 您还没有登录,登录后您可以: 收藏Android系统代码 收藏喜欢的文章 多个平台共享账号 去登录 首次使用?从这里 注册
您还没有登录,登录后您可以:
首次使用?从这里 注册