OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 912 matching lines...) Loading... |
923 } else { | 923 } else { |
924 result = BuildBinaryOperation( | 924 result = BuildBinaryOperation( |
925 state.op(), left, right, | 925 state.op(), left, right, |
926 left_type, right_type, result_type, | 926 left_type, right_type, result_type, |
927 state.fixed_right_arg(), allocation_mode); | 927 state.fixed_right_arg(), allocation_mode); |
928 } | 928 } |
929 | 929 |
930 // If we encounter a generic argument, the number conversion is | 930 // If we encounter a generic argument, the number conversion is |
931 // observable, thus we cannot afford to bail out after the fact. | 931 // observable, thus we cannot afford to bail out after the fact. |
932 if (!state.HasSideEffects()) { | 932 if (!state.HasSideEffects()) { |
933 if (result_type->Is(Type::Smi())) { | 933 if (result_type->Is(Type::SignedSmall())) { |
934 if (state.op() == Token::SHR) { | 934 if (state.op() == Token::SHR) { |
935 // TODO(olivf) Replace this by a SmiTagU Instruction. | 935 // TODO(olivf) Replace this by a SmiTagU Instruction. |
936 // 0x40000000: this number would convert to negative when interpreting | 936 // 0x40000000: this number would convert to negative when interpreting |
937 // the register as signed value; | 937 // the register as signed value; |
938 IfBuilder if_of(this); | 938 IfBuilder if_of(this); |
939 if_of.IfNot<HCompareNumericAndBranch>(result, | 939 if_of.IfNot<HCompareNumericAndBranch>(result, |
940 Add<HConstant>(static_cast<int>(SmiValuesAre32Bits() | 940 Add<HConstant>(static_cast<int>(SmiValuesAre32Bits() |
941 ? 0x80000000 : 0x40000000)), Token::EQ_STRICT); | 941 ? 0x80000000 : 0x40000000)), Token::EQ_STRICT); |
942 if_of.Then(); | 942 if_of.Then(); |
943 if_of.ElseDeopt("UInt->Smi oveflow"); | 943 if_of.ElseDeopt("UInt->Smi oveflow"); |
(...skipping 471 matching lines...) Loading... |
1415 return BuildRegExpConstructResult(length, index, input); | 1415 return BuildRegExpConstructResult(length, index, input); |
1416 } | 1416 } |
1417 | 1417 |
1418 | 1418 |
1419 Handle<Code> RegExpConstructResultStub::GenerateCode(Isolate* isolate) { | 1419 Handle<Code> RegExpConstructResultStub::GenerateCode(Isolate* isolate) { |
1420 return DoGenerateCode(isolate, this); | 1420 return DoGenerateCode(isolate, this); |
1421 } | 1421 } |
1422 | 1422 |
1423 | 1423 |
1424 } } // namespace v8::internal | 1424 } } // namespace v8::internal |
OLD | NEW |