| 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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
| 8 | 8 |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 3122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3133 // ------------------------------------------------------------------------- | 3133 // ------------------------------------------------------------------------- |
| 3134 // StringCharFromCodeGenerator | 3134 // StringCharFromCodeGenerator |
| 3135 | 3135 |
| 3136 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { | 3136 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { |
| 3137 // Fast case of Heap::LookupSingleCharacterStringFromCode. | 3137 // Fast case of Heap::LookupSingleCharacterStringFromCode. |
| 3138 | 3138 |
| 3139 DCHECK(!a4.is(result_)); | 3139 DCHECK(!a4.is(result_)); |
| 3140 DCHECK(!a4.is(code_)); | 3140 DCHECK(!a4.is(code_)); |
| 3141 | 3141 |
| 3142 STATIC_ASSERT(kSmiTag == 0); | 3142 STATIC_ASSERT(kSmiTag == 0); |
| 3143 DCHECK(IsPowerOf2(String::kMaxOneByteCharCode + 1)); | 3143 DCHECK(base::bits::IsPowerOfTwo32(String::kMaxOneByteCharCode + 1)); |
| 3144 __ And(a4, | 3144 __ And(a4, |
| 3145 code_, | 3145 code_, |
| 3146 Operand(kSmiTagMask | | 3146 Operand(kSmiTagMask | |
| 3147 ((~String::kMaxOneByteCharCode) << kSmiTagSize))); | 3147 ((~String::kMaxOneByteCharCode) << kSmiTagSize))); |
| 3148 __ Branch(&slow_case_, ne, a4, Operand(zero_reg)); | 3148 __ Branch(&slow_case_, ne, a4, Operand(zero_reg)); |
| 3149 | 3149 |
| 3150 | 3150 |
| 3151 __ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex); | 3151 __ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex); |
| 3152 // At this point code register contains smi tagged ASCII char code. | 3152 // At this point code register contains smi tagged ASCII char code. |
| 3153 STATIC_ASSERT(kSmiTag == 0); | 3153 STATIC_ASSERT(kSmiTag == 0); |
| (...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4643 __ Dsubu(a0, ra, Operand(kReturnAddressDistanceFromFunctionStart)); | 4643 __ Dsubu(a0, ra, Operand(kReturnAddressDistanceFromFunctionStart)); |
| 4644 | 4644 |
| 4645 // The caller's return address is above the saved temporaries. | 4645 // The caller's return address is above the saved temporaries. |
| 4646 // Grab that for the second argument to the hook. | 4646 // Grab that for the second argument to the hook. |
| 4647 __ Daddu(a1, sp, Operand(kNumSavedRegs * kPointerSize)); | 4647 __ Daddu(a1, sp, Operand(kNumSavedRegs * kPointerSize)); |
| 4648 | 4648 |
| 4649 // Align the stack if necessary. | 4649 // Align the stack if necessary. |
| 4650 int frame_alignment = masm->ActivationFrameAlignment(); | 4650 int frame_alignment = masm->ActivationFrameAlignment(); |
| 4651 if (frame_alignment > kPointerSize) { | 4651 if (frame_alignment > kPointerSize) { |
| 4652 __ mov(s5, sp); | 4652 __ mov(s5, sp); |
| 4653 DCHECK(IsPowerOf2(frame_alignment)); | 4653 DCHECK(base::bits::IsPowerOfTwo32(frame_alignment)); |
| 4654 __ And(sp, sp, Operand(-frame_alignment)); | 4654 __ And(sp, sp, Operand(-frame_alignment)); |
| 4655 } | 4655 } |
| 4656 | 4656 |
| 4657 __ Dsubu(sp, sp, kCArgsSlotsSize); | 4657 __ Dsubu(sp, sp, kCArgsSlotsSize); |
| 4658 #if defined(V8_HOST_ARCH_MIPS) || defined(V8_HOST_ARCH_MIPS64) | 4658 #if defined(V8_HOST_ARCH_MIPS) || defined(V8_HOST_ARCH_MIPS64) |
| 4659 int64_t entry_hook = | 4659 int64_t entry_hook = |
| 4660 reinterpret_cast<int64_t>(isolate()->function_entry_hook()); | 4660 reinterpret_cast<int64_t>(isolate()->function_entry_hook()); |
| 4661 __ li(t9, Operand(entry_hook)); | 4661 __ li(t9, Operand(entry_hook)); |
| 4662 #else | 4662 #else |
| 4663 // Under the simulator we need to indirect the entry hook through a | 4663 // Under the simulator we need to indirect the entry hook through a |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5101 MemOperand(fp, 6 * kPointerSize), | 5101 MemOperand(fp, 6 * kPointerSize), |
| 5102 NULL); | 5102 NULL); |
| 5103 } | 5103 } |
| 5104 | 5104 |
| 5105 | 5105 |
| 5106 #undef __ | 5106 #undef __ |
| 5107 | 5107 |
| 5108 } } // namespace v8::internal | 5108 } } // namespace v8::internal |
| 5109 | 5109 |
| 5110 #endif // V8_TARGET_ARCH_MIPS64 | 5110 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |