| 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 DCHECK(in_function_); | 311 DCHECK(in_function_); |
| 312 if (stmt->init() != nullptr) { | 312 if (stmt->init() != nullptr) { |
| 313 block_size_++; | 313 block_size_++; |
| 314 RECURSE(Visit(stmt->init())); | 314 RECURSE(Visit(stmt->init())); |
| 315 } | 315 } |
| 316 BlockVisitor visitor(this, stmt->AsBreakableStatement(), kExprLoop, true, | 316 BlockVisitor visitor(this, stmt->AsBreakableStatement(), kExprLoop, true, |
| 317 0); | 317 0); |
| 318 if (stmt->cond() != nullptr) { | 318 if (stmt->cond() != nullptr) { |
| 319 block_size_++; | 319 block_size_++; |
| 320 current_function_builder_->Emit(kExprIf); | 320 current_function_builder_->Emit(kExprIf); |
| 321 current_function_builder_->Emit(kExprBoolNot); | 321 current_function_builder_->Emit(kExprI32Eqz); |
| 322 RECURSE(Visit(stmt->cond())); | 322 RECURSE(Visit(stmt->cond())); |
| 323 current_function_builder_->EmitWithU8(kExprBr, 1); | 323 current_function_builder_->EmitWithU8(kExprBr, 1); |
| 324 current_function_builder_->Emit(kExprNop); | 324 current_function_builder_->Emit(kExprNop); |
| 325 } | 325 } |
| 326 if (stmt->body() != nullptr) { | 326 if (stmt->body() != nullptr) { |
| 327 block_size_++; | 327 block_size_++; |
| 328 RECURSE(Visit(stmt->body())); | 328 RECURSE(Visit(stmt->body())); |
| 329 } | 329 } |
| 330 if (stmt->next() != nullptr) { | 330 if (stmt->next() != nullptr) { |
| 331 block_size_++; | 331 block_size_++; |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 } | 1038 } |
| 1039 | 1039 |
| 1040 void VisitCallNew(CallNew* expr) { UNREACHABLE(); } | 1040 void VisitCallNew(CallNew* expr) { UNREACHABLE(); } |
| 1041 | 1041 |
| 1042 void VisitCallRuntime(CallRuntime* expr) { UNREACHABLE(); } | 1042 void VisitCallRuntime(CallRuntime* expr) { UNREACHABLE(); } |
| 1043 | 1043 |
| 1044 void VisitUnaryOperation(UnaryOperation* expr) { | 1044 void VisitUnaryOperation(UnaryOperation* expr) { |
| 1045 switch (expr->op()) { | 1045 switch (expr->op()) { |
| 1046 case Token::NOT: { | 1046 case Token::NOT: { |
| 1047 DCHECK_EQ(kAstI32, TypeOf(expr->expression())); | 1047 DCHECK_EQ(kAstI32, TypeOf(expr->expression())); |
| 1048 current_function_builder_->Emit(kExprBoolNot); | 1048 current_function_builder_->Emit(kExprI32Eqz); |
| 1049 break; | 1049 break; |
| 1050 } | 1050 } |
| 1051 default: | 1051 default: |
| 1052 UNREACHABLE(); | 1052 UNREACHABLE(); |
| 1053 } | 1053 } |
| 1054 RECURSE(Visit(expr->expression())); | 1054 RECURSE(Visit(expr->expression())); |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 void VisitCountOperation(CountOperation* expr) { UNREACHABLE(); } | 1057 void VisitCountOperation(CountOperation* expr) { UNREACHABLE(); } |
| 1058 | 1058 |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1507 // that zone in constructor may be thrown away once wasm module is written. | 1507 // that zone in constructor may be thrown away once wasm module is written. |
| 1508 WasmModuleIndex* AsmWasmBuilder::Run() { | 1508 WasmModuleIndex* AsmWasmBuilder::Run() { |
| 1509 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, foreign_, typer_); | 1509 AsmWasmBuilderImpl impl(isolate_, zone_, literal_, foreign_, typer_); |
| 1510 impl.Compile(); | 1510 impl.Compile(); |
| 1511 WasmModuleWriter* writer = impl.builder_->Build(zone_); | 1511 WasmModuleWriter* writer = impl.builder_->Build(zone_); |
| 1512 return writer->WriteTo(zone_); | 1512 return writer->WriteTo(zone_); |
| 1513 } | 1513 } |
| 1514 } // namespace wasm | 1514 } // namespace wasm |
| 1515 } // namespace internal | 1515 } // namespace internal |
| 1516 } // namespace v8 | 1516 } // namespace v8 |
| OLD | NEW |