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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 ExternalReference(IC_Utility(IC::kLoadElementWithInterceptor), | 860 ExternalReference(IC_Utility(IC::kLoadElementWithInterceptor), |
861 masm->isolate()), | 861 masm->isolate()), |
862 2, 1); | 862 2, 1); |
863 | 863 |
864 __ bind(&slow); | 864 __ bind(&slow); |
865 PropertyAccessCompiler::TailCallBuiltin( | 865 PropertyAccessCompiler::TailCallBuiltin( |
866 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); | 866 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); |
867 } | 867 } |
868 | 868 |
869 | 869 |
| 870 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { |
| 871 // Return address is on the stack. |
| 872 Label miss; |
| 873 |
| 874 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 875 Register index = LoadDescriptor::NameRegister(); |
| 876 Register scratch = rbx; |
| 877 Register result = rax; |
| 878 DCHECK(!scratch.is(receiver) && !scratch.is(index)); |
| 879 |
| 880 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, |
| 881 &miss, // When not a string. |
| 882 &miss, // When not a number. |
| 883 &miss, // When index out of range. |
| 884 STRING_INDEX_IS_ARRAY_INDEX, |
| 885 RECEIVER_IS_STRING); |
| 886 char_at_generator.GenerateFast(masm); |
| 887 __ ret(0); |
| 888 |
| 889 StubRuntimeCallHelper call_helper; |
| 890 char_at_generator.GenerateSlow(masm, call_helper); |
| 891 |
| 892 __ bind(&miss); |
| 893 PropertyAccessCompiler::TailCallBuiltin( |
| 894 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC)); |
| 895 } |
| 896 |
| 897 |
870 void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { | 898 void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { |
871 // rsp[0] : return address | 899 // rsp[0] : return address |
872 // rsp[8] : number of parameters | 900 // rsp[8] : number of parameters |
873 // rsp[16] : receiver displacement | 901 // rsp[16] : receiver displacement |
874 // rsp[24] : function | 902 // rsp[24] : function |
875 | 903 |
876 // Check if the calling frame is an arguments adaptor frame. | 904 // Check if the calling frame is an arguments adaptor frame. |
877 Label adaptor_frame, try_allocate, runtime; | 905 Label adaptor_frame, try_allocate, runtime; |
878 __ movp(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); | 906 __ movp(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); |
879 __ movp(rcx, Operand(rdx, StandardFrameConstants::kContextOffset)); | 907 __ movp(rcx, Operand(rdx, StandardFrameConstants::kContextOffset)); |
(...skipping 3789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4669 return_value_operand, | 4697 return_value_operand, |
4670 NULL); | 4698 NULL); |
4671 } | 4699 } |
4672 | 4700 |
4673 | 4701 |
4674 #undef __ | 4702 #undef __ |
4675 | 4703 |
4676 } } // namespace v8::internal | 4704 } } // namespace v8::internal |
4677 | 4705 |
4678 #endif // V8_TARGET_ARCH_X64 | 4706 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |