OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 int shift_value = int_value & 0x1f; // only least significant 5 bits | 1120 int shift_value = int_value & 0x1f; // only least significant 5 bits |
1121 DeferredCode* deferred = | 1121 DeferredCode* deferred = |
1122 new DeferredInlinedSmiOperation(this, Token::SHL, shift_value, | 1122 new DeferredInlinedSmiOperation(this, Token::SHL, shift_value, |
1123 overwrite_mode); | 1123 overwrite_mode); |
1124 frame_->Pop(eax); | 1124 frame_->Pop(eax); |
1125 __ test(eax, Immediate(kSmiTagMask)); | 1125 __ test(eax, Immediate(kSmiTagMask)); |
1126 __ mov(ebx, Operand(eax)); | 1126 __ mov(ebx, Operand(eax)); |
1127 __ j(not_zero, deferred->enter(), not_taken); | 1127 __ j(not_zero, deferred->enter(), not_taken); |
1128 __ sar(ebx, kSmiTagSize); | 1128 __ sar(ebx, kSmiTagSize); |
1129 __ shl(ebx, shift_value); | 1129 __ shl(ebx, shift_value); |
1130 // Convert the int to a Smi, and check that it is in | 1130 // This is the Smi check for the shifted result. |
1131 // the range of valid Smis. | 1131 // After signed subtraction of 0xc0000000, the valid |
1132 ASSERT(kSmiTagSize == times_2); // Adjust code if not true. | 1132 // Smis are positive. |
1133 ASSERT(kSmiTag == 0); // Adjust code if not true. | 1133 __ cmp(ebx, 0xc0000000); |
1134 __ add(ebx, Operand(ebx)); | 1134 __ j(sign, deferred->enter(), not_taken); |
1135 __ j(overflow, deferred->enter(), not_taken); | 1135 // tag result and store it in TOS (eax) |
1136 __ mov(eax, Operand(ebx)); | 1136 ASSERT(kSmiTagSize == times_2); // adjust code if not the case |
1137 | 1137 __ lea(eax, Operand(ebx, ebx, times_1, kSmiTag)); |
1138 __ bind(deferred->exit()); | 1138 __ bind(deferred->exit()); |
1139 frame_->Push(eax); | 1139 frame_->Push(eax); |
1140 } | 1140 } |
1141 break; | 1141 break; |
1142 } | 1142 } |
1143 | 1143 |
1144 case Token::BIT_OR: | 1144 case Token::BIT_OR: |
1145 case Token::BIT_XOR: | 1145 case Token::BIT_XOR: |
1146 case Token::BIT_AND: { | 1146 case Token::BIT_AND: { |
1147 DeferredCode* deferred = NULL; | 1147 DeferredCode* deferred = NULL; |
(...skipping 4162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5310 | 5310 |
5311 // Slow-case: Go through the JavaScript implementation. | 5311 // Slow-case: Go through the JavaScript implementation. |
5312 __ bind(&slow); | 5312 __ bind(&slow); |
5313 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 5313 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
5314 } | 5314 } |
5315 | 5315 |
5316 | 5316 |
5317 #undef __ | 5317 #undef __ |
5318 | 5318 |
5319 } } // namespace v8::internal | 5319 } } // namespace v8::internal |
OLD | NEW |