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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
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 3082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3101 // StringCharFromCodeGenerator | 3102 // StringCharFromCodeGenerator |
3102 | 3103 |
3103 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { | 3104 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { |
3104 // Fast case of Heap::LookupSingleCharacterStringFromCode. | 3105 // Fast case of Heap::LookupSingleCharacterStringFromCode. |
3105 | 3106 |
3106 DCHECK(!t0.is(result_)); | 3107 DCHECK(!t0.is(result_)); |
3107 DCHECK(!t0.is(code_)); | 3108 DCHECK(!t0.is(code_)); |
3108 | 3109 |
3109 STATIC_ASSERT(kSmiTag == 0); | 3110 STATIC_ASSERT(kSmiTag == 0); |
3110 STATIC_ASSERT(kSmiShiftSize == 0); | 3111 STATIC_ASSERT(kSmiShiftSize == 0); |
3111 DCHECK(IsPowerOf2(String::kMaxOneByteCharCode + 1)); | 3112 DCHECK(base::bits::IsPowerOfTwo32(String::kMaxOneByteCharCode + 1)); |
3112 __ And(t0, | 3113 __ And(t0, |
3113 code_, | 3114 code_, |
3114 Operand(kSmiTagMask | | 3115 Operand(kSmiTagMask | |
3115 ((~String::kMaxOneByteCharCode) << kSmiTagSize))); | 3116 ((~String::kMaxOneByteCharCode) << kSmiTagSize))); |
3116 __ Branch(&slow_case_, ne, t0, Operand(zero_reg)); | 3117 __ Branch(&slow_case_, ne, t0, Operand(zero_reg)); |
3117 | 3118 |
3118 __ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex); | 3119 __ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex); |
3119 // At this point code register contains smi tagged ASCII char code. | 3120 // At this point code register contains smi tagged ASCII char code. |
3120 STATIC_ASSERT(kSmiTag == 0); | 3121 STATIC_ASSERT(kSmiTag == 0); |
3121 __ sll(t0, code_, kPointerSizeLog2 - kSmiTagSize); | 3122 __ sll(t0, code_, kPointerSizeLog2 - kSmiTagSize); |
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4606 __ Subu(a0, ra, Operand(kReturnAddressDistanceFromFunctionStart)); | 4607 __ Subu(a0, ra, Operand(kReturnAddressDistanceFromFunctionStart)); |
4607 | 4608 |
4608 // The caller's return address is above the saved temporaries. | 4609 // The caller's return address is above the saved temporaries. |
4609 // Grab that for the second argument to the hook. | 4610 // Grab that for the second argument to the hook. |
4610 __ Addu(a1, sp, Operand(kNumSavedRegs * kPointerSize)); | 4611 __ Addu(a1, sp, Operand(kNumSavedRegs * kPointerSize)); |
4611 | 4612 |
4612 // Align the stack if necessary. | 4613 // Align the stack if necessary. |
4613 int frame_alignment = masm->ActivationFrameAlignment(); | 4614 int frame_alignment = masm->ActivationFrameAlignment(); |
4614 if (frame_alignment > kPointerSize) { | 4615 if (frame_alignment > kPointerSize) { |
4615 __ mov(s5, sp); | 4616 __ mov(s5, sp); |
4616 DCHECK(IsPowerOf2(frame_alignment)); | 4617 DCHECK(base::bits::IsPowerOfTwo32(frame_alignment)); |
4617 __ And(sp, sp, Operand(-frame_alignment)); | 4618 __ And(sp, sp, Operand(-frame_alignment)); |
4618 } | 4619 } |
4619 __ Subu(sp, sp, kCArgsSlotsSize); | 4620 __ Subu(sp, sp, kCArgsSlotsSize); |
4620 #if defined(V8_HOST_ARCH_MIPS) | 4621 #if defined(V8_HOST_ARCH_MIPS) |
4621 int32_t entry_hook = | 4622 int32_t entry_hook = |
4622 reinterpret_cast<int32_t>(isolate()->function_entry_hook()); | 4623 reinterpret_cast<int32_t>(isolate()->function_entry_hook()); |
4623 __ li(t9, Operand(entry_hook)); | 4624 __ li(t9, Operand(entry_hook)); |
4624 #else | 4625 #else |
4625 // Under the simulator we need to indirect the entry hook through a | 4626 // Under the simulator we need to indirect the entry hook through a |
4626 // trampoline function at a known address. | 4627 // trampoline function at a known address. |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5064 MemOperand(fp, 6 * kPointerSize), | 5065 MemOperand(fp, 6 * kPointerSize), |
5065 NULL); | 5066 NULL); |
5066 } | 5067 } |
5067 | 5068 |
5068 | 5069 |
5069 #undef __ | 5070 #undef __ |
5070 | 5071 |
5071 } } // namespace v8::internal | 5072 } } // namespace v8::internal |
5072 | 5073 |
5073 #endif // V8_TARGET_ARCH_MIPS | 5074 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |