OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 } | 425 } |
426 } | 426 } |
427 | 427 |
428 | 428 |
429 void AstTyper::VisitBinaryOperation(BinaryOperation* expr) { | 429 void AstTyper::VisitBinaryOperation(BinaryOperation* expr) { |
430 ASSERT(!HasStackOverflow()); | 430 ASSERT(!HasStackOverflow()); |
431 CHECK_ALIVE(Visit(expr->left())); | 431 CHECK_ALIVE(Visit(expr->left())); |
432 CHECK_ALIVE(Visit(expr->right())); | 432 CHECK_ALIVE(Visit(expr->right())); |
433 | 433 |
434 // Collect type feedback. | 434 // Collect type feedback. |
435 Handle<Type> left_type, right_type, result_type; | 435 Handle<Type> type, left_type, right_type; |
436 Maybe<int> fixed_right_arg; | 436 Maybe<int> fixed_right_arg; |
437 oracle()->BinaryType(expr->BinaryOperationFeedbackId(), | 437 oracle()->BinaryType(expr->BinaryOperationFeedbackId(), |
438 &left_type, &right_type, &result_type, &fixed_right_arg); | 438 &left_type, &right_type, &type, &fixed_right_arg); |
| 439 MergeLowerType(expr, type); |
439 MergeLowerType(expr->left(), left_type); | 440 MergeLowerType(expr->left(), left_type); |
440 MergeLowerType(expr->right(), right_type); | 441 MergeLowerType(expr->right(), right_type); |
441 expr->set_result_type(result_type); | |
442 expr->set_fixed_right_arg(fixed_right_arg); | 442 expr->set_fixed_right_arg(fixed_right_arg); |
443 if (expr->op() == Token::OR || expr->op() == Token::AND) { | 443 if (expr->op() == Token::OR || expr->op() == Token::AND) { |
444 expr->left()->RecordToBooleanTypeFeedback(oracle()); | 444 expr->left()->RecordToBooleanTypeFeedback(oracle()); |
445 } | 445 } |
446 } | 446 } |
447 | 447 |
448 | 448 |
449 void AstTyper::VisitCompareOperation(CompareOperation* expr) { | 449 void AstTyper::VisitCompareOperation(CompareOperation* expr) { |
450 ASSERT(!HasStackOverflow()); | 450 ASSERT(!HasStackOverflow()); |
451 CHECK_ALIVE(Visit(expr->left())); | 451 CHECK_ALIVE(Visit(expr->left())); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 } | 525 } |
526 | 526 |
527 | 527 |
528 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { | 528 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { |
529 ASSERT(!HasStackOverflow()); | 529 ASSERT(!HasStackOverflow()); |
530 CHECK_ALIVE(Visit(stmt->body())); | 530 CHECK_ALIVE(Visit(stmt->body())); |
531 } | 531 } |
532 | 532 |
533 | 533 |
534 } } // namespace v8::internal | 534 } } // namespace v8::internal |
OLD | NEW |