OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1691 Label if_issmi(assembler), if_isnotsmi(assembler); | 1691 Label if_issmi(assembler), if_isnotsmi(assembler); |
1692 assembler->Branch(assembler->WordIsSmi(value), &if_issmi, &if_isnotsmi); | 1692 assembler->Branch(assembler->WordIsSmi(value), &if_issmi, &if_isnotsmi); |
1693 | 1693 |
1694 assembler->Bind(&if_issmi); | 1694 assembler->Bind(&if_issmi); |
1695 { | 1695 { |
1696 // Try fast Smi addition first. | 1696 // Try fast Smi addition first. |
1697 Node* one = assembler->SmiConstant(Smi::FromInt(1)); | 1697 Node* one = assembler->SmiConstant(Smi::FromInt(1)); |
1698 Node* pair = assembler->SmiAddWithOverflow(value, one); | 1698 Node* pair = assembler->SmiAddWithOverflow(value, one); |
1699 Node* overflow = assembler->Projection(1, pair); | 1699 Node* overflow = assembler->Projection(1, pair); |
1700 | 1700 |
1701 // Check if the Smi additon overflowed. | 1701 // Check if the Smi addition overflowed. |
1702 Label if_overflow(assembler), if_notoverflow(assembler); | 1702 Label if_overflow(assembler), if_notoverflow(assembler); |
1703 assembler->Branch(overflow, &if_overflow, &if_notoverflow); | 1703 assembler->Branch(overflow, &if_overflow, &if_notoverflow); |
1704 | 1704 |
1705 assembler->Bind(&if_notoverflow); | 1705 assembler->Bind(&if_notoverflow); |
1706 result_var.Bind(assembler->Projection(0, pair)); | 1706 result_var.Bind(assembler->Projection(0, pair)); |
1707 assembler->Goto(&end); | 1707 assembler->Goto(&end); |
1708 | 1708 |
1709 assembler->Bind(&if_overflow); | 1709 assembler->Bind(&if_overflow); |
1710 { | 1710 { |
1711 var_finc_value.Bind(assembler->SmiToFloat64(value)); | 1711 var_finc_value.Bind(assembler->SmiToFloat64(value)); |
(...skipping 3148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4860 if (type->Is(Type::UntaggedPointer())) { | 4860 if (type->Is(Type::UntaggedPointer())) { |
4861 return Representation::External(); | 4861 return Representation::External(); |
4862 } | 4862 } |
4863 | 4863 |
4864 DCHECK(!type->Is(Type::Untagged())); | 4864 DCHECK(!type->Is(Type::Untagged())); |
4865 return Representation::Tagged(); | 4865 return Representation::Tagged(); |
4866 } | 4866 } |
4867 | 4867 |
4868 } // namespace internal | 4868 } // namespace internal |
4869 } // namespace v8 | 4869 } // namespace v8 |
OLD | NEW |