OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 5614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5625 } | 5625 } |
5626 | 5626 |
5627 | 5627 |
5628 // ------------------------------------------------------------------------- | 5628 // ------------------------------------------------------------------------- |
5629 // StringCharFromCodeGenerator | 5629 // StringCharFromCodeGenerator |
5630 | 5630 |
5631 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { | 5631 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { |
5632 // Fast case of Heap::LookupSingleCharacterStringFromCode. | 5632 // Fast case of Heap::LookupSingleCharacterStringFromCode. |
5633 STATIC_ASSERT(kSmiTag == 0); | 5633 STATIC_ASSERT(kSmiTag == 0); |
5634 STATIC_ASSERT(kSmiShiftSize == 0); | 5634 STATIC_ASSERT(kSmiShiftSize == 0); |
5635 ASSERT(IsPowerOf2(String::kMaxAsciiCharCode + 1)); | 5635 ASSERT(IsPowerOf2(String::kMaxOneByteCharCode + 1)); |
5636 __ tst(code_, | 5636 __ tst(code_, |
5637 Operand(kSmiTagMask | | 5637 Operand(kSmiTagMask | |
5638 ((~String::kMaxAsciiCharCode) << kSmiTagSize))); | 5638 ((~String::kMaxOneByteCharCode) << kSmiTagSize))); |
5639 __ b(ne, &slow_case_); | 5639 __ b(ne, &slow_case_); |
5640 | 5640 |
5641 __ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex); | 5641 __ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex); |
5642 // At this point code register contains smi tagged ASCII char code. | 5642 // At this point code register contains smi tagged ASCII char code. |
5643 STATIC_ASSERT(kSmiTag == 0); | 5643 STATIC_ASSERT(kSmiTag == 0); |
5644 __ add(result_, result_, Operand(code_, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5644 __ add(result_, result_, Operand(code_, LSL, kPointerSizeLog2 - kSmiTagSize)); |
5645 __ ldr(result_, FieldMemOperand(result_, FixedArray::kHeaderSize)); | 5645 __ ldr(result_, FieldMemOperand(result_, FixedArray::kHeaderSize)); |
5646 __ CompareRoot(result_, Heap::kUndefinedValueRootIndex); | 5646 __ CompareRoot(result_, Heap::kUndefinedValueRootIndex); |
5647 __ b(eq, &slow_case_); | 5647 __ b(eq, &slow_case_); |
5648 __ bind(&exit_); | 5648 __ bind(&exit_); |
(...skipping 2061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7710 | 7710 |
7711 __ Pop(lr, r5, r1); | 7711 __ Pop(lr, r5, r1); |
7712 __ Ret(); | 7712 __ Ret(); |
7713 } | 7713 } |
7714 | 7714 |
7715 #undef __ | 7715 #undef __ |
7716 | 7716 |
7717 } } // namespace v8::internal | 7717 } } // namespace v8::internal |
7718 | 7718 |
7719 #endif // V8_TARGET_ARCH_ARM | 7719 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |