OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 Object* CallStubCompiler::CompileArrayPushCall(Object* object, | 830 Object* CallStubCompiler::CompileArrayPushCall(Object* object, |
831 JSObject* holder, | 831 JSObject* holder, |
832 JSFunction* function, | 832 JSFunction* function, |
833 String* name, | 833 String* name, |
834 CheckType check) { | 834 CheckType check) { |
835 // ----------- S t a t e ------------- | 835 // ----------- S t a t e ------------- |
836 // -- r2 : name | 836 // -- r2 : name |
837 // -- lr : return address | 837 // -- lr : return address |
838 // ----------------------------------- | 838 // ----------------------------------- |
839 | 839 |
| 840 // If object is not an array, bail out to regular call. |
| 841 if (!object->IsJSArray()) { |
| 842 return Heap::undefined_value(); |
| 843 } |
| 844 |
840 // TODO(639): faster implementation. | 845 // TODO(639): faster implementation. |
841 ASSERT(check == RECEIVER_MAP_CHECK); | 846 ASSERT(check == RECEIVER_MAP_CHECK); |
842 | 847 |
843 Label miss; | 848 Label miss; |
844 | 849 |
845 // Get the receiver from the stack | 850 // Get the receiver from the stack |
846 const int argc = arguments().immediate(); | 851 const int argc = arguments().immediate(); |
847 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); | 852 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); |
848 | 853 |
849 // Check that the receiver isn't a smi. | 854 // Check that the receiver isn't a smi. |
(...skipping 29 matching lines...) Expand all Loading... |
879 Object* CallStubCompiler::CompileArrayPopCall(Object* object, | 884 Object* CallStubCompiler::CompileArrayPopCall(Object* object, |
880 JSObject* holder, | 885 JSObject* holder, |
881 JSFunction* function, | 886 JSFunction* function, |
882 String* name, | 887 String* name, |
883 CheckType check) { | 888 CheckType check) { |
884 // ----------- S t a t e ------------- | 889 // ----------- S t a t e ------------- |
885 // -- r2 : name | 890 // -- r2 : name |
886 // -- lr : return address | 891 // -- lr : return address |
887 // ----------------------------------- | 892 // ----------------------------------- |
888 | 893 |
| 894 // If object is not an array, bail out to regular call. |
| 895 if (!object->IsJSArray()) { |
| 896 return Heap::undefined_value(); |
| 897 } |
| 898 |
889 // TODO(642): faster implementation. | 899 // TODO(642): faster implementation. |
890 ASSERT(check == RECEIVER_MAP_CHECK); | 900 ASSERT(check == RECEIVER_MAP_CHECK); |
891 | 901 |
892 Label miss; | 902 Label miss; |
893 | 903 |
894 // Get the receiver from the stack | 904 // Get the receiver from the stack |
895 const int argc = arguments().immediate(); | 905 const int argc = arguments().immediate(); |
896 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); | 906 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); |
897 | 907 |
898 // Check that the receiver isn't a smi. | 908 // Check that the receiver isn't a smi. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 String* name, | 941 String* name, |
932 CheckType check) { | 942 CheckType check) { |
933 // ----------- S t a t e ------------- | 943 // ----------- S t a t e ------------- |
934 // -- r2 : name | 944 // -- r2 : name |
935 // -- lr : return address | 945 // -- lr : return address |
936 // ----------------------------------- | 946 // ----------------------------------- |
937 SharedFunctionInfo* function_info = function->shared(); | 947 SharedFunctionInfo* function_info = function->shared(); |
938 if (function_info->HasCustomCallGenerator()) { | 948 if (function_info->HasCustomCallGenerator()) { |
939 CustomCallGenerator generator = | 949 CustomCallGenerator generator = |
940 ToCData<CustomCallGenerator>(function_info->function_data()); | 950 ToCData<CustomCallGenerator>(function_info->function_data()); |
941 return generator(this, object, holder, function, name, check); | 951 Object* result = generator(this, object, holder, function, name, check); |
| 952 // undefined means bail out to regular compiler. |
| 953 if (!result->IsUndefined()) { |
| 954 return result; |
| 955 } |
942 } | 956 } |
943 | 957 |
944 Label miss; | 958 Label miss; |
945 | 959 |
946 // Get the receiver from the stack | 960 // Get the receiver from the stack |
947 const int argc = arguments().immediate(); | 961 const int argc = arguments().immediate(); |
948 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); | 962 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); |
949 | 963 |
950 // Check that the receiver isn't a smi. | 964 // Check that the receiver isn't a smi. |
951 if (check != NUMBER_CHECK) { | 965 if (check != NUMBER_CHECK) { |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1947 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); | 1961 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); |
1948 | 1962 |
1949 // Return the generated code. | 1963 // Return the generated code. |
1950 return GetCode(); | 1964 return GetCode(); |
1951 } | 1965 } |
1952 | 1966 |
1953 | 1967 |
1954 #undef __ | 1968 #undef __ |
1955 | 1969 |
1956 } } // namespace v8::internal | 1970 } } // namespace v8::internal |
OLD | NEW |