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_ARM | 7 #if V8_TARGET_ARCH_ARM |
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 2927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2946 } | 2947 } |
2947 | 2948 |
2948 | 2949 |
2949 // ------------------------------------------------------------------------- | 2950 // ------------------------------------------------------------------------- |
2950 // StringCharFromCodeGenerator | 2951 // StringCharFromCodeGenerator |
2951 | 2952 |
2952 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { | 2953 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { |
2953 // Fast case of Heap::LookupSingleCharacterStringFromCode. | 2954 // Fast case of Heap::LookupSingleCharacterStringFromCode. |
2954 STATIC_ASSERT(kSmiTag == 0); | 2955 STATIC_ASSERT(kSmiTag == 0); |
2955 STATIC_ASSERT(kSmiShiftSize == 0); | 2956 STATIC_ASSERT(kSmiShiftSize == 0); |
2956 DCHECK(IsPowerOf2(String::kMaxOneByteCharCode + 1)); | 2957 DCHECK(base::bits::IsPowerOfTwo32(String::kMaxOneByteCharCode + 1)); |
2957 __ tst(code_, | 2958 __ tst(code_, |
2958 Operand(kSmiTagMask | | 2959 Operand(kSmiTagMask | |
2959 ((~String::kMaxOneByteCharCode) << kSmiTagSize))); | 2960 ((~String::kMaxOneByteCharCode) << kSmiTagSize))); |
2960 __ b(ne, &slow_case_); | 2961 __ b(ne, &slow_case_); |
2961 | 2962 |
2962 __ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex); | 2963 __ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex); |
2963 // At this point code register contains smi tagged ASCII char code. | 2964 // At this point code register contains smi tagged ASCII char code. |
2964 __ add(result_, result_, Operand::PointerOffsetFromSmiKey(code_)); | 2965 __ add(result_, result_, Operand::PointerOffsetFromSmiKey(code_)); |
2965 __ ldr(result_, FieldMemOperand(result_, FixedArray::kHeaderSize)); | 2966 __ ldr(result_, FieldMemOperand(result_, FixedArray::kHeaderSize)); |
2966 __ CompareRoot(result_, Heap::kUndefinedValueRootIndex); | 2967 __ CompareRoot(result_, Heap::kUndefinedValueRootIndex); |
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4386 __ sub(r0, lr, Operand(kReturnAddressDistanceFromFunctionStart)); | 4387 __ sub(r0, lr, Operand(kReturnAddressDistanceFromFunctionStart)); |
4387 | 4388 |
4388 // The caller's return address is above the saved temporaries. | 4389 // The caller's return address is above the saved temporaries. |
4389 // Grab that for the second argument to the hook. | 4390 // Grab that for the second argument to the hook. |
4390 __ add(r1, sp, Operand(kNumSavedRegs * kPointerSize)); | 4391 __ add(r1, sp, Operand(kNumSavedRegs * kPointerSize)); |
4391 | 4392 |
4392 // Align the stack if necessary. | 4393 // Align the stack if necessary. |
4393 int frame_alignment = masm->ActivationFrameAlignment(); | 4394 int frame_alignment = masm->ActivationFrameAlignment(); |
4394 if (frame_alignment > kPointerSize) { | 4395 if (frame_alignment > kPointerSize) { |
4395 __ mov(r5, sp); | 4396 __ mov(r5, sp); |
4396 DCHECK(IsPowerOf2(frame_alignment)); | 4397 DCHECK(base::bits::IsPowerOfTwo32(frame_alignment)); |
4397 __ and_(sp, sp, Operand(-frame_alignment)); | 4398 __ and_(sp, sp, Operand(-frame_alignment)); |
4398 } | 4399 } |
4399 | 4400 |
4400 #if V8_HOST_ARCH_ARM | 4401 #if V8_HOST_ARCH_ARM |
4401 int32_t entry_hook = | 4402 int32_t entry_hook = |
4402 reinterpret_cast<int32_t>(isolate()->function_entry_hook()); | 4403 reinterpret_cast<int32_t>(isolate()->function_entry_hook()); |
4403 __ mov(ip, Operand(entry_hook)); | 4404 __ mov(ip, Operand(entry_hook)); |
4404 #else | 4405 #else |
4405 // Under the simulator we need to indirect the entry hook through a | 4406 // Under the simulator we need to indirect the entry hook through a |
4406 // trampoline function at a known address. | 4407 // trampoline function at a known address. |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4853 MemOperand(fp, 6 * kPointerSize), | 4854 MemOperand(fp, 6 * kPointerSize), |
4854 NULL); | 4855 NULL); |
4855 } | 4856 } |
4856 | 4857 |
4857 | 4858 |
4858 #undef __ | 4859 #undef __ |
4859 | 4860 |
4860 } } // namespace v8::internal | 4861 } } // namespace v8::internal |
4861 | 4862 |
4862 #endif // V8_TARGET_ARCH_ARM | 4863 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |