| 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/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| 10 #include "src/code-stubs.h" | 11 #include "src/code-stubs.h" |
| 11 #include "src/codegen.h" | 12 #include "src/codegen.h" |
| 12 #include "src/ic/handler-compiler.h" | 13 #include "src/ic/handler-compiler.h" |
| 13 #include "src/isolate.h" | 14 #include "src/isolate.h" |
| 14 #include "src/jsregexp.h" | 15 #include "src/jsregexp.h" |
| 15 #include "src/regexp-macro-assembler.h" | 16 #include "src/regexp-macro-assembler.h" |
| 16 #include "src/runtime.h" | 17 #include "src/runtime.h" |
| 17 | 18 |
| 18 namespace v8 { | 19 namespace v8 { |
| (...skipping 2807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2826 } | 2827 } |
| 2827 | 2828 |
| 2828 | 2829 |
| 2829 // ------------------------------------------------------------------------- | 2830 // ------------------------------------------------------------------------- |
| 2830 // StringCharFromCodeGenerator | 2831 // StringCharFromCodeGenerator |
| 2831 | 2832 |
| 2832 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { | 2833 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { |
| 2833 // Fast case of Heap::LookupSingleCharacterStringFromCode. | 2834 // Fast case of Heap::LookupSingleCharacterStringFromCode. |
| 2834 STATIC_ASSERT(kSmiTag == 0); | 2835 STATIC_ASSERT(kSmiTag == 0); |
| 2835 STATIC_ASSERT(kSmiShiftSize == 0); | 2836 STATIC_ASSERT(kSmiShiftSize == 0); |
| 2836 DCHECK(IsPowerOf2(String::kMaxOneByteCharCode + 1)); | 2837 DCHECK(base::bits::IsPowerOfTwo32(String::kMaxOneByteCharCode + 1)); |
| 2837 __ test(code_, | 2838 __ test(code_, |
| 2838 Immediate(kSmiTagMask | | 2839 Immediate(kSmiTagMask | |
| 2839 ((~String::kMaxOneByteCharCode) << kSmiTagSize))); | 2840 ((~String::kMaxOneByteCharCode) << kSmiTagSize))); |
| 2840 __ j(not_zero, &slow_case_); | 2841 __ j(not_zero, &slow_case_); |
| 2841 | 2842 |
| 2842 Factory* factory = masm->isolate()->factory(); | 2843 Factory* factory = masm->isolate()->factory(); |
| 2843 __ Move(result_, Immediate(factory->single_character_string_cache())); | 2844 __ Move(result_, Immediate(factory->single_character_string_cache())); |
| 2844 STATIC_ASSERT(kSmiTag == 0); | 2845 STATIC_ASSERT(kSmiTag == 0); |
| 2845 STATIC_ASSERT(kSmiTagSize == 1); | 2846 STATIC_ASSERT(kSmiTagSize == 1); |
| 2846 STATIC_ASSERT(kSmiShiftSize == 0); | 2847 STATIC_ASSERT(kSmiShiftSize == 0); |
| (...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4781 Operand(ebp, 7 * kPointerSize), | 4782 Operand(ebp, 7 * kPointerSize), |
| 4782 NULL); | 4783 NULL); |
| 4783 } | 4784 } |
| 4784 | 4785 |
| 4785 | 4786 |
| 4786 #undef __ | 4787 #undef __ |
| 4787 | 4788 |
| 4788 } } // namespace v8::internal | 4789 } } // namespace v8::internal |
| 4789 | 4790 |
| 4790 #endif // V8_TARGET_ARCH_IA32 | 4791 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |