| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 2698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2709 } | 2709 } |
| 2710 | 2710 |
| 2711 | 2711 |
| 2712 // ------------------------------------------------------------------------- | 2712 // ------------------------------------------------------------------------- |
| 2713 // StringCharFromCodeGenerator | 2713 // StringCharFromCodeGenerator |
| 2714 | 2714 |
| 2715 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { | 2715 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { |
| 2716 // Fast case of Heap::LookupSingleCharacterStringFromCode. | 2716 // Fast case of Heap::LookupSingleCharacterStringFromCode. |
| 2717 STATIC_ASSERT(kSmiTag == 0); | 2717 STATIC_ASSERT(kSmiTag == 0); |
| 2718 STATIC_ASSERT(kSmiShiftSize == 0); | 2718 STATIC_ASSERT(kSmiShiftSize == 0); |
| 2719 DCHECK(base::bits::IsPowerOfTwo32(String::kMaxOneByteCharCode + 1)); | 2719 DCHECK(base::bits::IsPowerOfTwo32(String::kMaxOneByteCharCodeU + 1)); |
| 2720 __ test(code_, | 2720 __ test(code_, Immediate(kSmiTagMask | |
| 2721 Immediate(kSmiTagMask | | 2721 ((~String::kMaxOneByteCharCodeU) << kSmiTagSize))); |
| 2722 ((~String::kMaxOneByteCharCode) << kSmiTagSize))); | |
| 2723 __ j(not_zero, &slow_case_); | 2722 __ j(not_zero, &slow_case_); |
| 2724 | 2723 |
| 2725 Factory* factory = masm->isolate()->factory(); | 2724 Factory* factory = masm->isolate()->factory(); |
| 2726 __ Move(result_, Immediate(factory->single_character_string_cache())); | 2725 __ Move(result_, Immediate(factory->single_character_string_cache())); |
| 2727 STATIC_ASSERT(kSmiTag == 0); | 2726 STATIC_ASSERT(kSmiTag == 0); |
| 2728 STATIC_ASSERT(kSmiTagSize == 1); | 2727 STATIC_ASSERT(kSmiTagSize == 1); |
| 2729 STATIC_ASSERT(kSmiShiftSize == 0); | 2728 STATIC_ASSERT(kSmiShiftSize == 0); |
| 2730 // At this point code register contains smi tagged one byte char code. | 2729 // At this point code register contains smi tagged one byte char code. |
| 2731 __ mov(result_, FieldOperand(result_, | 2730 __ mov(result_, FieldOperand(result_, |
| 2732 code_, times_half_pointer_size, | 2731 code_, times_half_pointer_size, |
| (...skipping 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5135 Operand(ebp, 7 * kPointerSize), NULL); | 5134 Operand(ebp, 7 * kPointerSize), NULL); |
| 5136 } | 5135 } |
| 5137 | 5136 |
| 5138 | 5137 |
| 5139 #undef __ | 5138 #undef __ |
| 5140 | 5139 |
| 5141 } // namespace internal | 5140 } // namespace internal |
| 5142 } // namespace v8 | 5141 } // namespace v8 |
| 5143 | 5142 |
| 5144 #endif // V8_TARGET_ARCH_X87 | 5143 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |