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/typing-asm.h" | 5 #include "src/typing-asm.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
333 } | 333 } |
334 | 334 |
335 | 335 |
336 void AsmTyper::VisitEmptyParentheses(EmptyParentheses* expr) { UNREACHABLE(); } | 336 void AsmTyper::VisitEmptyParentheses(EmptyParentheses* expr) { UNREACHABLE(); } |
337 | 337 |
338 | 338 |
339 void AsmTyper::VisitIfStatement(IfStatement* stmt) { | 339 void AsmTyper::VisitIfStatement(IfStatement* stmt) { |
340 if (!in_function_) { | 340 if (!in_function_) { |
341 FAIL(stmt, "if statement inside module body"); | 341 FAIL(stmt, "if statement inside module body"); |
342 } | 342 } |
343 RECURSE(VisitWithExpectation(stmt->condition(), cache_.kAsmSigned, | 343 RECURSE(VisitWithExpectation(stmt->condition(), cache_.kAsmIntQ, |
bradnelson
2016/06/28 15:07:57
These should be AsmInt not AsmInt.
Also maybe add
aseemgarg
2016/06/29 00:05:01
Done.
| |
344 "if condition expected to be integer")); | 344 "if condition expected to be integer")); |
345 RECURSE(Visit(stmt->then_statement())); | 345 RECURSE(Visit(stmt->then_statement())); |
346 RECURSE(Visit(stmt->else_statement())); | 346 RECURSE(Visit(stmt->else_statement())); |
347 } | 347 } |
348 | 348 |
349 | 349 |
350 void AsmTyper::VisitContinueStatement(ContinueStatement* stmt) { | 350 void AsmTyper::VisitContinueStatement(ContinueStatement* stmt) { |
351 if (!in_function_) { | 351 if (!in_function_) { |
352 FAIL(stmt, "continue statement inside module body"); | 352 FAIL(stmt, "continue statement inside module body"); |
353 } | 353 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
427 | 427 |
428 | 428 |
429 void AsmTyper::VisitCaseClause(CaseClause* clause) { UNREACHABLE(); } | 429 void AsmTyper::VisitCaseClause(CaseClause* clause) { UNREACHABLE(); } |
430 | 430 |
431 | 431 |
432 void AsmTyper::VisitDoWhileStatement(DoWhileStatement* stmt) { | 432 void AsmTyper::VisitDoWhileStatement(DoWhileStatement* stmt) { |
433 if (!in_function_) { | 433 if (!in_function_) { |
434 FAIL(stmt, "do statement inside module body"); | 434 FAIL(stmt, "do statement inside module body"); |
435 } | 435 } |
436 RECURSE(Visit(stmt->body())); | 436 RECURSE(Visit(stmt->body())); |
437 RECURSE(VisitWithExpectation(stmt->cond(), cache_.kAsmSigned, | 437 RECURSE(VisitWithExpectation(stmt->cond(), cache_.kAsmIntQ, |
438 "do condition expected to be integer")); | 438 "do condition expected to be integer")); |
439 } | 439 } |
440 | 440 |
441 | 441 |
442 void AsmTyper::VisitWhileStatement(WhileStatement* stmt) { | 442 void AsmTyper::VisitWhileStatement(WhileStatement* stmt) { |
443 if (!in_function_) { | 443 if (!in_function_) { |
444 FAIL(stmt, "while statement inside module body"); | 444 FAIL(stmt, "while statement inside module body"); |
445 } | 445 } |
446 RECURSE(VisitWithExpectation(stmt->cond(), cache_.kAsmSigned, | 446 RECURSE(VisitWithExpectation(stmt->cond(), cache_.kAsmIntQ, |
447 "while condition expected to be integer")); | 447 "while condition expected to be integer")); |
448 RECURSE(Visit(stmt->body())); | 448 RECURSE(Visit(stmt->body())); |
449 } | 449 } |
450 | 450 |
451 | 451 |
452 void AsmTyper::VisitForStatement(ForStatement* stmt) { | 452 void AsmTyper::VisitForStatement(ForStatement* stmt) { |
453 if (!in_function_) { | 453 if (!in_function_) { |
454 FAIL(stmt, "for statement inside module body"); | 454 FAIL(stmt, "for statement inside module body"); |
455 } | 455 } |
456 if (stmt->init() != nullptr) { | 456 if (stmt->init() != nullptr) { |
457 RECURSE(Visit(stmt->init())); | 457 RECURSE(Visit(stmt->init())); |
458 } | 458 } |
459 if (stmt->cond() != nullptr) { | 459 if (stmt->cond() != nullptr) { |
460 RECURSE(VisitWithExpectation(stmt->cond(), cache_.kAsmSigned, | 460 RECURSE(VisitWithExpectation(stmt->cond(), cache_.kAsmIntQ, |
461 "for condition expected to be integer")); | 461 "for condition expected to be integer")); |
462 } | 462 } |
463 if (stmt->next() != nullptr) { | 463 if (stmt->next() != nullptr) { |
464 RECURSE(Visit(stmt->next())); | 464 RECURSE(Visit(stmt->next())); |
465 } | 465 } |
466 RECURSE(Visit(stmt->body())); | 466 RECURSE(Visit(stmt->body())); |
467 } | 467 } |
468 | 468 |
469 | 469 |
470 void AsmTyper::VisitForInStatement(ForInStatement* stmt) { | 470 void AsmTyper::VisitForInStatement(ForInStatement* stmt) { |
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1637 } | 1637 } |
1638 | 1638 |
1639 | 1639 |
1640 void AsmTyper::VisitRewritableExpression(RewritableExpression* expr) { | 1640 void AsmTyper::VisitRewritableExpression(RewritableExpression* expr) { |
1641 RECURSE(Visit(expr->expression())); | 1641 RECURSE(Visit(expr->expression())); |
1642 } | 1642 } |
1643 | 1643 |
1644 | 1644 |
1645 } // namespace internal | 1645 } // namespace internal |
1646 } // namespace v8 | 1646 } // namespace v8 |
OLD | NEW |