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 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 } | 861 } |
862 | 862 |
863 Register transition_map() { | 863 Register transition_map() { |
864 return registers()[3]; | 864 return registers()[3]; |
865 } | 865 } |
866 | 866 |
867 friend class BaseLoadStoreStubCompiler; | 867 friend class BaseLoadStoreStubCompiler; |
868 }; | 868 }; |
869 | 869 |
870 | 870 |
| 871 // Subset of FUNCTIONS_WITH_ID_LIST with custom constant/global call |
| 872 // IC stubs. |
| 873 #define CUSTOM_CALL_IC_GENERATORS(V) \ |
| 874 V(ArrayPush) \ |
| 875 V(ArrayPop) |
| 876 |
| 877 |
871 class CallStubCompiler: public StubCompiler { | 878 class CallStubCompiler: public StubCompiler { |
872 public: | 879 public: |
873 CallStubCompiler(Isolate* isolate, | 880 CallStubCompiler(Isolate* isolate, |
874 int argc, | 881 int argc, |
875 Code::Kind kind, | 882 Code::Kind kind, |
876 ExtraICState extra_state, | 883 ExtraICState extra_state, |
877 InlineCacheHolderFlag cache_holder = OWN_MAP); | 884 InlineCacheHolderFlag cache_holder = OWN_MAP); |
878 | 885 |
879 Handle<Code> CompileCallField(Handle<JSObject> object, | 886 Handle<Code> CompileCallField(Handle<JSObject> object, |
880 Handle<JSObject> holder, | 887 Handle<JSObject> holder, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 // Compiles a custom call constant/global IC. For constant calls cell is | 934 // Compiles a custom call constant/global IC. For constant calls cell is |
928 // NULL. Returns an empty handle if there is no custom call code for the | 935 // NULL. Returns an empty handle if there is no custom call code for the |
929 // given function. | 936 // given function. |
930 Handle<Code> CompileCustomCall(Handle<Object> object, | 937 Handle<Code> CompileCustomCall(Handle<Object> object, |
931 Handle<JSObject> holder, | 938 Handle<JSObject> holder, |
932 Handle<Cell> cell, | 939 Handle<Cell> cell, |
933 Handle<JSFunction> function, | 940 Handle<JSFunction> function, |
934 Handle<String> name, | 941 Handle<String> name, |
935 Code::StubType type); | 942 Code::StubType type); |
936 | 943 |
| 944 #define DECLARE_CALL_GENERATOR(name) \ |
| 945 Handle<Code> Compile##name##Call(Handle<Object> object, \ |
| 946 Handle<JSObject> holder, \ |
| 947 Handle<Cell> cell, \ |
| 948 Handle<JSFunction> function, \ |
| 949 Handle<String> fname, \ |
| 950 Code::StubType type); |
| 951 CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR) |
| 952 #undef DECLARE_CALL_GENERATOR |
| 953 |
937 Handle<Code> CompileFastApiCall(const CallOptimization& optimization, | 954 Handle<Code> CompileFastApiCall(const CallOptimization& optimization, |
938 Handle<Object> object, | 955 Handle<Object> object, |
939 Handle<JSObject> holder, | 956 Handle<JSObject> holder, |
940 Handle<Cell> cell, | 957 Handle<Cell> cell, |
941 Handle<JSFunction> function, | 958 Handle<JSFunction> function, |
942 Handle<String> name); | 959 Handle<String> name); |
943 | 960 |
944 Handle<Code> GetCode(Code::StubType type, Handle<Name> name); | 961 Handle<Code> GetCode(Code::StubType type, Handle<Name> name); |
945 Handle<Code> GetCode(Handle<JSFunction> function); | 962 Handle<Code> GetCode(Handle<JSFunction> function); |
946 | 963 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 Handle<JSFunction> constant_function_; | 1042 Handle<JSFunction> constant_function_; |
1026 bool is_simple_api_call_; | 1043 bool is_simple_api_call_; |
1027 Handle<FunctionTemplateInfo> expected_receiver_type_; | 1044 Handle<FunctionTemplateInfo> expected_receiver_type_; |
1028 Handle<CallHandlerInfo> api_call_info_; | 1045 Handle<CallHandlerInfo> api_call_info_; |
1029 }; | 1046 }; |
1030 | 1047 |
1031 | 1048 |
1032 } } // namespace v8::internal | 1049 } } // namespace v8::internal |
1033 | 1050 |
1034 #endif // V8_STUB_CACHE_H_ | 1051 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |