| 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 5620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5631 | 5631 |
| 5632 if (count == 0) { | 5632 if (count == 0) { |
| 5633 join = graph()->CreateBasicBlock(); | 5633 join = graph()->CreateBasicBlock(); |
| 5634 if (handle_smi) { | 5634 if (handle_smi) { |
| 5635 HBasicBlock* empty_smi_block = graph()->CreateBasicBlock(); | 5635 HBasicBlock* empty_smi_block = graph()->CreateBasicBlock(); |
| 5636 HBasicBlock* not_smi_block = graph()->CreateBasicBlock(); | 5636 HBasicBlock* not_smi_block = graph()->CreateBasicBlock(); |
| 5637 number_block = graph()->CreateBasicBlock(); | 5637 number_block = graph()->CreateBasicBlock(); |
| 5638 smi_check = New<HIsSmiAndBranch>( | 5638 smi_check = New<HIsSmiAndBranch>( |
| 5639 object, empty_smi_block, not_smi_block); | 5639 object, empty_smi_block, not_smi_block); |
| 5640 FinishCurrentBlock(smi_check); | 5640 FinishCurrentBlock(smi_check); |
| 5641 Goto(empty_smi_block, number_block); | 5641 GotoNoSimulate(empty_smi_block, number_block); |
| 5642 set_current_block(not_smi_block); | 5642 set_current_block(not_smi_block); |
| 5643 } else { | 5643 } else { |
| 5644 BuildCheckHeapObject(object); | 5644 BuildCheckHeapObject(object); |
| 5645 } | 5645 } |
| 5646 } | 5646 } |
| 5647 ++count; | 5647 ++count; |
| 5648 HBasicBlock* if_true = graph()->CreateBasicBlock(); | 5648 HBasicBlock* if_true = graph()->CreateBasicBlock(); |
| 5649 HBasicBlock* if_false = graph()->CreateBasicBlock(); | 5649 HBasicBlock* if_false = graph()->CreateBasicBlock(); |
| 5650 HUnaryControlInstruction* compare; | 5650 HUnaryControlInstruction* compare; |
| 5651 | 5651 |
| 5652 HValue* dependency; | 5652 HValue* dependency; |
| 5653 if (info.type()->Is(Type::Number())) { | 5653 if (info.type()->Is(Type::Number())) { |
| 5654 Handle<Map> heap_number_map = isolate()->factory()->heap_number_map(); | 5654 Handle<Map> heap_number_map = isolate()->factory()->heap_number_map(); |
| 5655 compare = New<HCompareMap>(object, heap_number_map, top_info(), | 5655 compare = New<HCompareMap>(object, heap_number_map, top_info(), |
| 5656 if_true, if_false); | 5656 if_true, if_false); |
| 5657 dependency = smi_check; | 5657 dependency = smi_check; |
| 5658 } else if (info.type()->Is(Type::String())) { | 5658 } else if (info.type()->Is(Type::String())) { |
| 5659 compare = New<HIsStringAndBranch>(object, if_true, if_false); | 5659 compare = New<HIsStringAndBranch>(object, if_true, if_false); |
| 5660 dependency = compare; | 5660 dependency = compare; |
| 5661 } else { | 5661 } else { |
| 5662 compare = New<HCompareMap>(object, info.map(), top_info(), | 5662 compare = New<HCompareMap>(object, info.map(), top_info(), |
| 5663 if_true, if_false); | 5663 if_true, if_false); |
| 5664 dependency = compare; | 5664 dependency = compare; |
| 5665 } | 5665 } |
| 5666 FinishCurrentBlock(compare); | 5666 FinishCurrentBlock(compare); |
| 5667 | 5667 |
| 5668 if (info.type()->Is(Type::Number())) { | 5668 if (info.type()->Is(Type::Number())) { |
| 5669 Goto(if_true, number_block); | 5669 GotoNoSimulate(if_true, number_block); |
| 5670 if_true = number_block; | 5670 if_true = number_block; |
| 5671 number_block->SetJoinId(ast_id); | |
| 5672 } | 5671 } |
| 5673 | 5672 |
| 5674 set_current_block(if_true); | 5673 set_current_block(if_true); |
| 5675 | 5674 |
| 5676 HInstruction* access = BuildMonomorphicAccess( | 5675 HInstruction* access = BuildMonomorphicAccess( |
| 5677 &info, object, dependency, value, ast_id, | 5676 &info, object, dependency, value, ast_id, |
| 5678 return_id, FLAG_polymorphic_inlining); | 5677 return_id, FLAG_polymorphic_inlining); |
| 5679 | 5678 |
| 5680 HValue* result = NULL; | 5679 HValue* result = NULL; |
| 5681 switch (access_type) { | 5680 switch (access_type) { |
| (...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6837 expr->set_target(target); | 6836 expr->set_target(target); |
| 6838 if (count == 0) { | 6837 if (count == 0) { |
| 6839 // Only needed once. | 6838 // Only needed once. |
| 6840 join = graph()->CreateBasicBlock(); | 6839 join = graph()->CreateBasicBlock(); |
| 6841 if (handle_smi) { | 6840 if (handle_smi) { |
| 6842 HBasicBlock* empty_smi_block = graph()->CreateBasicBlock(); | 6841 HBasicBlock* empty_smi_block = graph()->CreateBasicBlock(); |
| 6843 HBasicBlock* not_smi_block = graph()->CreateBasicBlock(); | 6842 HBasicBlock* not_smi_block = graph()->CreateBasicBlock(); |
| 6844 number_block = graph()->CreateBasicBlock(); | 6843 number_block = graph()->CreateBasicBlock(); |
| 6845 FinishCurrentBlock(New<HIsSmiAndBranch>( | 6844 FinishCurrentBlock(New<HIsSmiAndBranch>( |
| 6846 receiver, empty_smi_block, not_smi_block)); | 6845 receiver, empty_smi_block, not_smi_block)); |
| 6847 Goto(empty_smi_block, number_block); | 6846 GotoNoSimulate(empty_smi_block, number_block); |
| 6848 set_current_block(not_smi_block); | 6847 set_current_block(not_smi_block); |
| 6849 } else { | 6848 } else { |
| 6850 BuildCheckHeapObject(receiver); | 6849 BuildCheckHeapObject(receiver); |
| 6851 } | 6850 } |
| 6852 } | 6851 } |
| 6853 ++count; | 6852 ++count; |
| 6854 HBasicBlock* if_true = graph()->CreateBasicBlock(); | 6853 HBasicBlock* if_true = graph()->CreateBasicBlock(); |
| 6855 HBasicBlock* if_false = graph()->CreateBasicBlock(); | 6854 HBasicBlock* if_false = graph()->CreateBasicBlock(); |
| 6856 HUnaryControlInstruction* compare; | 6855 HUnaryControlInstruction* compare; |
| 6857 | 6856 |
| 6858 Handle<Map> map = info.map(); | 6857 Handle<Map> map = info.map(); |
| 6859 if (info.type()->Is(Type::Number())) { | 6858 if (info.type()->Is(Type::Number())) { |
| 6860 Handle<Map> heap_number_map = isolate()->factory()->heap_number_map(); | 6859 Handle<Map> heap_number_map = isolate()->factory()->heap_number_map(); |
| 6861 compare = New<HCompareMap>(receiver, heap_number_map, top_info(), | 6860 compare = New<HCompareMap>(receiver, heap_number_map, top_info(), |
| 6862 if_true, if_false); | 6861 if_true, if_false); |
| 6863 } else if (info.type()->Is(Type::String())) { | 6862 } else if (info.type()->Is(Type::String())) { |
| 6864 compare = New<HIsStringAndBranch>(receiver, if_true, if_false); | 6863 compare = New<HIsStringAndBranch>(receiver, if_true, if_false); |
| 6865 } else { | 6864 } else { |
| 6866 compare = New<HCompareMap>(receiver, map, top_info(), | 6865 compare = New<HCompareMap>(receiver, map, top_info(), |
| 6867 if_true, if_false); | 6866 if_true, if_false); |
| 6868 } | 6867 } |
| 6869 FinishCurrentBlock(compare); | 6868 FinishCurrentBlock(compare); |
| 6870 | 6869 |
| 6871 if (info.type()->Is(Type::Number())) { | 6870 if (info.type()->Is(Type::Number())) { |
| 6872 Goto(if_true, number_block); | 6871 GotoNoSimulate(if_true, number_block); |
| 6873 if_true = number_block; | 6872 if_true = number_block; |
| 6874 number_block->SetJoinId(expr->id()); | |
| 6875 } | 6873 } |
| 6876 | 6874 |
| 6877 set_current_block(if_true); | 6875 set_current_block(if_true); |
| 6878 | 6876 |
| 6879 AddCheckPrototypeMaps(info.holder(), map); | 6877 AddCheckPrototypeMaps(info.holder(), map); |
| 6880 | 6878 |
| 6881 HValue* function = Add<HConstant>(expr->target()); | 6879 HValue* function = Add<HConstant>(expr->target()); |
| 6882 environment()->SetExpressionStackAt(0, function); | 6880 environment()->SetExpressionStackAt(0, function); |
| 6883 Push(receiver); | 6881 Push(receiver); |
| 6884 CHECK_ALIVE(VisitExpressions(expr->arguments())); | 6882 CHECK_ALIVE(VisitExpressions(expr->arguments())); |
| (...skipping 4302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11187 if (ShouldProduceTraceOutput()) { | 11185 if (ShouldProduceTraceOutput()) { |
| 11188 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11186 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 11189 } | 11187 } |
| 11190 | 11188 |
| 11191 #ifdef DEBUG | 11189 #ifdef DEBUG |
| 11192 graph_->Verify(false); // No full verify. | 11190 graph_->Verify(false); // No full verify. |
| 11193 #endif | 11191 #endif |
| 11194 } | 11192 } |
| 11195 | 11193 |
| 11196 } } // namespace v8::internal | 11194 } } // namespace v8::internal |
| OLD | NEW |