OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 7 #if V8_TARGET_ARCH_PPC |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 3172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3183 | 3183 |
3184 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); | 3184 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); |
3185 } | 3185 } |
3186 | 3186 |
3187 | 3187 |
3188 // ------------------------------------------------------------------------- | 3188 // ------------------------------------------------------------------------- |
3189 // StringCharFromCodeGenerator | 3189 // StringCharFromCodeGenerator |
3190 | 3190 |
3191 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { | 3191 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { |
3192 // Fast case of Heap::LookupSingleCharacterStringFromCode. | 3192 // Fast case of Heap::LookupSingleCharacterStringFromCode. |
3193 DCHECK(base::bits::IsPowerOfTwo32(String::kMaxOneByteCharCode + 1)); | 3193 DCHECK(base::bits::IsPowerOfTwo32(String::kMaxOneByteCharCodeU + 1)); |
3194 __ LoadSmiLiteral(r0, Smi::FromInt(~String::kMaxOneByteCharCode)); | 3194 __ LoadSmiLiteral(r0, Smi::FromInt(~String::kMaxOneByteCharCodeU)); |
3195 __ ori(r0, r0, Operand(kSmiTagMask)); | 3195 __ ori(r0, r0, Operand(kSmiTagMask)); |
3196 __ and_(r0, code_, r0); | 3196 __ and_(r0, code_, r0, SetRC); |
3197 __ cmpi(r0, Operand::Zero()); | 3197 __ bne(&slow_case_, cr0); |
3198 __ bne(&slow_case_); | |
3199 | 3198 |
3200 __ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex); | 3199 __ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex); |
3201 // At this point code register contains smi tagged one-byte char code. | 3200 // At this point code register contains smi tagged one-byte char code. |
3202 __ mr(r0, code_); | 3201 __ mr(r0, code_); |
3203 __ SmiToPtrArrayOffset(code_, code_); | 3202 __ SmiToPtrArrayOffset(code_, code_); |
3204 __ add(result_, result_, code_); | 3203 __ add(result_, result_, code_); |
3205 __ mr(code_, r0); | 3204 __ mr(code_, r0); |
3206 __ LoadP(result_, FieldMemOperand(result_, FixedArray::kHeaderSize)); | 3205 __ LoadP(result_, FieldMemOperand(result_, FixedArray::kHeaderSize)); |
3207 __ CompareRoot(result_, Heap::kUndefinedValueRootIndex); | 3206 __ CompareRoot(result_, Heap::kUndefinedValueRootIndex); |
3208 __ beq(&slow_case_); | 3207 __ beq(&slow_case_); |
(...skipping 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5669 kStackUnwindSpace, NULL, | 5668 kStackUnwindSpace, NULL, |
5670 MemOperand(fp, 6 * kPointerSize), NULL); | 5669 MemOperand(fp, 6 * kPointerSize), NULL); |
5671 } | 5670 } |
5672 | 5671 |
5673 | 5672 |
5674 #undef __ | 5673 #undef __ |
5675 } // namespace internal | 5674 } // namespace internal |
5676 } // namespace v8 | 5675 } // namespace v8 |
5677 | 5676 |
5678 #endif // V8_TARGET_ARCH_PPC | 5677 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |