OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 7 #if V8_TARGET_ARCH_X64 |
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 2721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2732 kPointerSize); | 2732 kPointerSize); |
2733 } | 2733 } |
2734 } | 2734 } |
2735 | 2735 |
2736 | 2736 |
2737 // ------------------------------------------------------------------------- | 2737 // ------------------------------------------------------------------------- |
2738 // StringCharCodeAtGenerator | 2738 // StringCharCodeAtGenerator |
2739 | 2739 |
2740 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { | 2740 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { |
2741 // If the receiver is a smi trigger the non-string case. | 2741 // If the receiver is a smi trigger the non-string case. |
2742 __ JumpIfSmi(object_, receiver_not_string_); | 2742 if (check_mode_ == RECEIVER_IS_UNKNOWN) { |
| 2743 __ JumpIfSmi(object_, receiver_not_string_); |
2743 | 2744 |
2744 // Fetch the instance type of the receiver into result register. | 2745 // Fetch the instance type of the receiver into result register. |
2745 __ movp(result_, FieldOperand(object_, HeapObject::kMapOffset)); | 2746 __ movp(result_, FieldOperand(object_, HeapObject::kMapOffset)); |
2746 __ movzxbl(result_, FieldOperand(result_, Map::kInstanceTypeOffset)); | 2747 __ movzxbl(result_, FieldOperand(result_, Map::kInstanceTypeOffset)); |
2747 // If the receiver is not a string trigger the non-string case. | 2748 // If the receiver is not a string trigger the non-string case. |
2748 __ testb(result_, Immediate(kIsNotStringMask)); | 2749 __ testb(result_, Immediate(kIsNotStringMask)); |
2749 __ j(not_zero, receiver_not_string_); | 2750 __ j(not_zero, receiver_not_string_); |
| 2751 } |
2750 | 2752 |
2751 // If the index is non-smi trigger the non-smi case. | 2753 // If the index is non-smi trigger the non-smi case. |
2752 __ JumpIfNotSmi(index_, &index_not_smi_); | 2754 __ JumpIfNotSmi(index_, &index_not_smi_); |
2753 __ bind(&got_smi_index_); | 2755 __ bind(&got_smi_index_); |
2754 | 2756 |
2755 // Check for index out of range. | 2757 // Check for index out of range. |
2756 __ SmiCompare(index_, FieldOperand(object_, String::kLengthOffset)); | 2758 __ SmiCompare(index_, FieldOperand(object_, String::kLengthOffset)); |
2757 __ j(above_equal, index_out_of_range_); | 2759 __ j(above_equal, index_out_of_range_); |
2758 | 2760 |
2759 __ SmiToInteger32(index_, index_); | 2761 __ SmiToInteger32(index_, index_); |
(...skipping 1937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4697 return_value_operand, | 4699 return_value_operand, |
4698 NULL); | 4700 NULL); |
4699 } | 4701 } |
4700 | 4702 |
4701 | 4703 |
4702 #undef __ | 4704 #undef __ |
4703 | 4705 |
4704 } } // namespace v8::internal | 4706 } } // namespace v8::internal |
4705 | 4707 |
4706 #endif // V8_TARGET_ARCH_X64 | 4708 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |