| 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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 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 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3019 } | 3019 } |
| 3020 | 3020 |
| 3021 | 3021 |
| 3022 // ------------------------------------------------------------------------- | 3022 // ------------------------------------------------------------------------- |
| 3023 // StringCharFromCodeGenerator | 3023 // StringCharFromCodeGenerator |
| 3024 | 3024 |
| 3025 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { | 3025 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { |
| 3026 // Fast case of Heap::LookupSingleCharacterStringFromCode. | 3026 // Fast case of Heap::LookupSingleCharacterStringFromCode. |
| 3027 STATIC_ASSERT(kSmiTag == 0); | 3027 STATIC_ASSERT(kSmiTag == 0); |
| 3028 STATIC_ASSERT(kSmiShiftSize == 0); | 3028 STATIC_ASSERT(kSmiShiftSize == 0); |
| 3029 DCHECK(base::bits::IsPowerOfTwo32(String::kMaxOneByteCharCode + 1)); | 3029 DCHECK(base::bits::IsPowerOfTwo32(String::kMaxOneByteCharCodeU + 1)); |
| 3030 __ test(code_, | 3030 __ test(code_, Immediate(kSmiTagMask | |
| 3031 Immediate(kSmiTagMask | | 3031 ((~String::kMaxOneByteCharCodeU) << kSmiTagSize))); |
| 3032 ((~String::kMaxOneByteCharCode) << kSmiTagSize))); | |
| 3033 __ j(not_zero, &slow_case_); | 3032 __ j(not_zero, &slow_case_); |
| 3034 | 3033 |
| 3035 Factory* factory = masm->isolate()->factory(); | 3034 Factory* factory = masm->isolate()->factory(); |
| 3036 __ Move(result_, Immediate(factory->single_character_string_cache())); | 3035 __ Move(result_, Immediate(factory->single_character_string_cache())); |
| 3037 STATIC_ASSERT(kSmiTag == 0); | 3036 STATIC_ASSERT(kSmiTag == 0); |
| 3038 STATIC_ASSERT(kSmiTagSize == 1); | 3037 STATIC_ASSERT(kSmiTagSize == 1); |
| 3039 STATIC_ASSERT(kSmiShiftSize == 0); | 3038 STATIC_ASSERT(kSmiShiftSize == 0); |
| 3040 // At this point code register contains smi tagged one byte char code. | 3039 // At this point code register contains smi tagged one byte char code. |
| 3041 __ mov(result_, FieldOperand(result_, | 3040 __ mov(result_, FieldOperand(result_, |
| 3042 code_, times_half_pointer_size, | 3041 code_, times_half_pointer_size, |
| (...skipping 2432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5475 Operand(ebp, 7 * kPointerSize), NULL); | 5474 Operand(ebp, 7 * kPointerSize), NULL); |
| 5476 } | 5475 } |
| 5477 | 5476 |
| 5478 | 5477 |
| 5479 #undef __ | 5478 #undef __ |
| 5480 | 5479 |
| 5481 } // namespace internal | 5480 } // namespace internal |
| 5482 } // namespace v8 | 5481 } // namespace v8 |
| 5483 | 5482 |
| 5484 #endif // V8_TARGET_ARCH_IA32 | 5483 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |