OLD | NEW |
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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 RECURSE(Visit(stmt->then_statement())); | 303 RECURSE(Visit(stmt->then_statement())); |
304 } | 304 } |
305 if (stmt->HasElseStatement()) { | 305 if (stmt->HasElseStatement()) { |
306 current_function_builder_->Emit(kExprElse); | 306 current_function_builder_->Emit(kExprElse); |
307 RECURSE(Visit(stmt->else_statement())); | 307 RECURSE(Visit(stmt->else_statement())); |
308 } | 308 } |
309 current_function_builder_->Emit(kExprEnd); | 309 current_function_builder_->Emit(kExprEnd); |
310 breakable_blocks_.pop_back(); | 310 breakable_blocks_.pop_back(); |
311 } | 311 } |
312 | 312 |
| 313 void VisitInternalVariable(InternalVariable* expr) { UNREACHABLE(); } |
| 314 |
313 void DoBreakOrContinue(BreakableStatement* target, bool is_continue) { | 315 void DoBreakOrContinue(BreakableStatement* target, bool is_continue) { |
314 DCHECK_EQ(kFuncScope, scope_); | 316 DCHECK_EQ(kFuncScope, scope_); |
315 for (int i = static_cast<int>(breakable_blocks_.size()) - 1; i >= 0; --i) { | 317 for (int i = static_cast<int>(breakable_blocks_.size()) - 1; i >= 0; --i) { |
316 auto elem = breakable_blocks_.at(i); | 318 auto elem = breakable_blocks_.at(i); |
317 if (elem.first == target && elem.second == is_continue) { | 319 if (elem.first == target && elem.second == is_continue) { |
318 int block_distance = static_cast<int>(breakable_blocks_.size() - i - 1); | 320 int block_distance = static_cast<int>(breakable_blocks_.size() - i - 1); |
319 current_function_builder_->Emit(kExprBr); | 321 current_function_builder_->Emit(kExprBr); |
320 current_function_builder_->EmitVarInt(block_distance); | 322 current_function_builder_->EmitVarInt(block_distance); |
321 return; | 323 return; |
322 } | 324 } |
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2006 impl.builder_->WriteAsmJsOffsetTable(*asm_offsets_buffer); | 2008 impl.builder_->WriteAsmJsOffsetTable(*asm_offsets_buffer); |
2007 return {module_buffer, asm_offsets_buffer, success}; | 2009 return {module_buffer, asm_offsets_buffer, success}; |
2008 } | 2010 } |
2009 | 2011 |
2010 const char* AsmWasmBuilder::foreign_init_name = "__foreign_init__"; | 2012 const char* AsmWasmBuilder::foreign_init_name = "__foreign_init__"; |
2011 const char* AsmWasmBuilder::single_function_name = "__single_function__"; | 2013 const char* AsmWasmBuilder::single_function_name = "__single_function__"; |
2012 | 2014 |
2013 } // namespace wasm | 2015 } // namespace wasm |
2014 } // namespace internal | 2016 } // namespace internal |
2015 } // namespace v8 | 2017 } // namespace v8 |
OLD | NEW |