Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(611)

Side by Side Diff: src/asmjs/asm-wasm-builder.cc

Issue 2618553004: [compiler] Collect eager inner functions for compilation during renumbering. (Closed)
Patch Set: Address comments and remove field from ParseInfo Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/asmjs/asm-types.cc ('k') | src/ast/ast-numbering.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 // Required to get M_E etc. in MSVC. 7 // Required to get M_E etc. in MSVC.
8 #if defined(_WIN32) 8 #if defined(_WIN32)
9 #define _USE_MATH_DEFINES 9 #define _USE_MATH_DEFINES
10 #endif 10 #endif
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 void VisitFunctionDeclaration(FunctionDeclaration* decl) { 139 void VisitFunctionDeclaration(FunctionDeclaration* decl) {
140 DCHECK_EQ(kModuleScope, scope_); 140 DCHECK_EQ(kModuleScope, scope_);
141 DCHECK_NULL(current_function_builder_); 141 DCHECK_NULL(current_function_builder_);
142 FunctionLiteral* old_func = decl->fun(); 142 FunctionLiteral* old_func = decl->fun();
143 Zone zone(isolate_->allocator(), ZONE_NAME); 143 Zone zone(isolate_->allocator(), ZONE_NAME);
144 DeclarationScope* new_func_scope = nullptr; 144 DeclarationScope* new_func_scope = nullptr;
145 if (decl->fun()->body() == nullptr) { 145 if (decl->fun()->body() == nullptr) {
146 // TODO(titzer/bradnelson): Reuse SharedFunctionInfos used here when 146 // TODO(titzer/bradnelson): Reuse SharedFunctionInfos used here when
147 // compiling the wasm module. 147 // compiling the wasm module.
148 Handle<SharedFunctionInfo> shared = Compiler::GetSharedFunctionInfo( 148 Handle<SharedFunctionInfo> shared =
149 decl->fun(), script_, info_, LazyCompilationMode::kAlways); 149 Compiler::GetSharedFunctionInfo(decl->fun(), script_, info_);
150 shared->set_is_toplevel(false); 150 shared->set_is_toplevel(false);
151 ParseInfo info(&zone, script_); 151 ParseInfo info(&zone, script_);
152 info.set_shared_info(shared); 152 info.set_shared_info(shared);
153 info.set_toplevel(false); 153 info.set_toplevel(false);
154 info.set_language_mode(decl->fun()->scope()->language_mode()); 154 info.set_language_mode(decl->fun()->scope()->language_mode());
155 info.set_allow_lazy_parsing(false); 155 info.set_allow_lazy_parsing(false);
156 info.set_function_literal_id(shared->function_literal_id()); 156 info.set_function_literal_id(shared->function_literal_id());
157 info.set_ast_value_factory(ast_value_factory_); 157 info.set_ast_value_factory(ast_value_factory_);
158 info.set_ast_value_factory_owned(false); 158 info.set_ast_value_factory_owned(false);
159 // Create fresh function scope to use to parse the function in. 159 // Create fresh function scope to use to parse the function in.
(...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 impl.builder_->WriteAsmJsOffsetTable(*asm_offsets_buffer); 1995 impl.builder_->WriteAsmJsOffsetTable(*asm_offsets_buffer);
1996 return {module_buffer, asm_offsets_buffer, success}; 1996 return {module_buffer, asm_offsets_buffer, success};
1997 } 1997 }
1998 1998
1999 const char* AsmWasmBuilder::foreign_init_name = "__foreign_init__"; 1999 const char* AsmWasmBuilder::foreign_init_name = "__foreign_init__";
2000 const char* AsmWasmBuilder::single_function_name = "__single_function__"; 2000 const char* AsmWasmBuilder::single_function_name = "__single_function__";
2001 2001
2002 } // namespace wasm 2002 } // namespace wasm
2003 } // namespace internal 2003 } // namespace internal
2004 } // namespace v8 2004 } // namespace v8
OLDNEW
« no previous file with comments | « src/asmjs/asm-types.cc ('k') | src/ast/ast-numbering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698