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 4516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4527 __ Abort("Unexpected fallthrough from CharCodeAt slow case"); | 4527 __ Abort("Unexpected fallthrough from CharCodeAt slow case"); |
4528 } | 4528 } |
4529 | 4529 |
4530 | 4530 |
4531 // ------------------------------------------------------------------------- | 4531 // ------------------------------------------------------------------------- |
4532 // StringCharFromCodeGenerator | 4532 // StringCharFromCodeGenerator |
4533 | 4533 |
4534 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { | 4534 void StringCharFromCodeGenerator::GenerateFast(MacroAssembler* masm) { |
4535 // Fast case of Heap::LookupSingleCharacterStringFromCode. | 4535 // Fast case of Heap::LookupSingleCharacterStringFromCode. |
4536 __ JumpIfNotSmi(code_, &slow_case_); | 4536 __ JumpIfNotSmi(code_, &slow_case_); |
4537 __ SmiCompare(code_, Smi::FromInt(String::kMaxAsciiCharCode)); | 4537 __ SmiCompare(code_, Smi::FromInt(String::kMaxOneByteCharCode)); |
4538 __ j(above, &slow_case_); | 4538 __ j(above, &slow_case_); |
4539 | 4539 |
4540 __ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex); | 4540 __ LoadRoot(result_, Heap::kSingleCharacterStringCacheRootIndex); |
4541 SmiIndex index = masm->SmiToIndex(kScratchRegister, code_, kPointerSizeLog2); | 4541 SmiIndex index = masm->SmiToIndex(kScratchRegister, code_, kPointerSizeLog2); |
4542 __ movq(result_, FieldOperand(result_, index.reg, index.scale, | 4542 __ movq(result_, FieldOperand(result_, index.reg, index.scale, |
4543 FixedArray::kHeaderSize)); | 4543 FixedArray::kHeaderSize)); |
4544 __ CompareRoot(result_, Heap::kUndefinedValueRootIndex); | 4544 __ CompareRoot(result_, Heap::kUndefinedValueRootIndex); |
4545 __ j(equal, &slow_case_); | 4545 __ j(equal, &slow_case_); |
4546 __ bind(&exit_); | 4546 __ bind(&exit_); |
4547 } | 4547 } |
(...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6484 #endif | 6484 #endif |
6485 | 6485 |
6486 __ Ret(); | 6486 __ Ret(); |
6487 } | 6487 } |
6488 | 6488 |
6489 #undef __ | 6489 #undef __ |
6490 | 6490 |
6491 } } // namespace v8::internal | 6491 } } // namespace v8::internal |
6492 | 6492 |
6493 #endif // V8_TARGET_ARCH_X64 | 6493 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |