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/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 2482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2501 } | 2502 } |
2502 | 2503 |
2503 | 2504 |
2504 // ------------------------------------------------------------------------- | 2505 // ------------------------------------------------------------------------- |
2505 // StringCharFromCodeGenerator | 2506 // StringCharFromCodeGenerator |
2506 | 2507 |
2507 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { | 2508 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { |
2508 // Fast case of Heap::LookupSingleCharacterStringFromCode. | 2509 // Fast case of Heap::LookupSingleCharacterStringFromCode. |
2509 STATIC_ASSERT(kSmiTag == 0); | 2510 STATIC_ASSERT(kSmiTag == 0); |
2510 STATIC_ASSERT(kSmiShiftSize == 0); | 2511 STATIC_ASSERT(kSmiShiftSize == 0); |
2511 DCHECK(IsPowerOf2(String::kMaxOneByteCharCode + 1)); | 2512 DCHECK(base::bits::IsPowerOfTwo32(String::kMaxOneByteCharCode + 1)); |
2512 __ test(code_, | 2513 __ test(code_, |
2513 Immediate(kSmiTagMask | | 2514 Immediate(kSmiTagMask | |
2514 ((~String::kMaxOneByteCharCode) << kSmiTagSize))); | 2515 ((~String::kMaxOneByteCharCode) << kSmiTagSize))); |
2515 __ j(not_zero, &slow_case_); | 2516 __ j(not_zero, &slow_case_); |
2516 | 2517 |
2517 Factory* factory = masm->isolate()->factory(); | 2518 Factory* factory = masm->isolate()->factory(); |
2518 __ Move(result_, Immediate(factory->single_character_string_cache())); | 2519 __ Move(result_, Immediate(factory->single_character_string_cache())); |
2519 STATIC_ASSERT(kSmiTag == 0); | 2520 STATIC_ASSERT(kSmiTag == 0); |
2520 STATIC_ASSERT(kSmiTagSize == 1); | 2521 STATIC_ASSERT(kSmiTagSize == 1); |
2521 STATIC_ASSERT(kSmiShiftSize == 0); | 2522 STATIC_ASSERT(kSmiShiftSize == 0); |
(...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4421 Operand(ebp, 7 * kPointerSize), | 4422 Operand(ebp, 7 * kPointerSize), |
4422 NULL); | 4423 NULL); |
4423 } | 4424 } |
4424 | 4425 |
4425 | 4426 |
4426 #undef __ | 4427 #undef __ |
4427 | 4428 |
4428 } } // namespace v8::internal | 4429 } } // namespace v8::internal |
4429 | 4430 |
4430 #endif // V8_TARGET_ARCH_X87 | 4431 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |