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

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

Issue 2609363004: [asm.js] [wasm] Store function start position for stack check (Closed)
Patch Set: It's 2017 already :) 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 | « no previous file | src/compiler/wasm-compiler.cc » ('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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 if (new_func_scope != nullptr) { 169 if (new_func_scope != nullptr) {
170 DCHECK_EQ(new_func_scope, decl->scope()->inner_scope()); 170 DCHECK_EQ(new_func_scope, decl->scope()->inner_scope());
171 if (!decl->scope()->RemoveInnerScope(new_func_scope)) { 171 if (!decl->scope()->RemoveInnerScope(new_func_scope)) {
172 UNREACHABLE(); 172 UNREACHABLE();
173 } 173 }
174 } 174 }
175 return; 175 return;
176 } 176 }
177 current_function_builder_ = LookupOrInsertFunction(decl->proxy()->var()); 177 current_function_builder_ = LookupOrInsertFunction(decl->proxy()->var());
178 scope_ = kFuncScope; 178 scope_ = kFuncScope;
179
180 // Record start of the function, used as position for the stack check.
181 current_function_builder_->SetAsmFunctionStartPosition(
182 decl->fun()->start_position());
183
179 RECURSE(Visit(decl->fun())); 184 RECURSE(Visit(decl->fun()));
180 decl->set_fun(old_func); 185 decl->set_fun(old_func);
181 if (new_func_scope != nullptr) { 186 if (new_func_scope != nullptr) {
182 DCHECK_EQ(new_func_scope, decl->scope()->inner_scope()); 187 DCHECK_EQ(new_func_scope, decl->scope()->inner_scope());
183 if (!decl->scope()->RemoveInnerScope(new_func_scope)) { 188 if (!decl->scope()->RemoveInnerScope(new_func_scope)) {
184 UNREACHABLE(); 189 UNREACHABLE();
185 } 190 }
186 } 191 }
187 scope_ = kModuleScope; 192 scope_ = kModuleScope;
188 current_function_builder_ = nullptr; 193 current_function_builder_ = nullptr;
(...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 impl.builder_->WriteAsmJsOffsetTable(*asm_offsets_buffer); 1984 impl.builder_->WriteAsmJsOffsetTable(*asm_offsets_buffer);
1980 return {module_buffer, asm_offsets_buffer, success}; 1985 return {module_buffer, asm_offsets_buffer, success};
1981 } 1986 }
1982 1987
1983 const char* AsmWasmBuilder::foreign_init_name = "__foreign_init__"; 1988 const char* AsmWasmBuilder::foreign_init_name = "__foreign_init__";
1984 const char* AsmWasmBuilder::single_function_name = "__single_function__"; 1989 const char* AsmWasmBuilder::single_function_name = "__single_function__";
1985 1990
1986 } // namespace wasm 1991 } // namespace wasm
1987 } // namespace internal 1992 } // namespace internal
1988 } // namespace v8 1993 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698