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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 | 962 |
963 // Subset of FUNCTIONS_WITH_ID_LIST with custom constant/global call | 963 // Subset of FUNCTIONS_WITH_ID_LIST with custom constant/global call |
964 // IC stubs. | 964 // IC stubs. |
965 #define CUSTOM_CALL_IC_GENERATORS(V) \ | 965 #define CUSTOM_CALL_IC_GENERATORS(V) \ |
966 V(ArrayPush) \ | 966 V(ArrayPush) \ |
967 V(ArrayPop) \ | 967 V(ArrayPop) \ |
968 V(StringCharCodeAt) \ | 968 V(StringCharCodeAt) \ |
969 V(StringCharAt) \ | 969 V(StringCharAt) \ |
970 V(StringFromCharCode) \ | 970 V(StringFromCharCode) \ |
971 V(MathFloor) \ | 971 V(MathFloor) \ |
972 V(MathAbs) | 972 V(MathAbs) \ |
| 973 V(ArrayCode) |
| 974 |
| 975 |
| 976 #define SITE_SPECIFIC_CALL_GENERATORS(V) \ |
| 977 V(ArrayCode) |
973 | 978 |
974 | 979 |
975 class CallOptimization; | 980 class CallOptimization; |
976 | 981 |
977 class CallStubCompiler: public StubCompiler { | 982 class CallStubCompiler: public StubCompiler { |
978 public: | 983 public: |
979 CallStubCompiler(Isolate* isolate, | 984 CallStubCompiler(Isolate* isolate, |
980 int argc, | 985 int argc, |
981 Code::Kind kind, | 986 Code::Kind kind, |
982 Code::ExtraICState extra_state, | 987 Code::ExtraICState extra_state, |
(...skipping 22 matching lines...) Expand all Loading... |
1005 Handle<JSObject> holder, | 1010 Handle<JSObject> holder, |
1006 Handle<Name> name); | 1011 Handle<Name> name); |
1007 | 1012 |
1008 Handle<Code> CompileCallGlobal(Handle<JSObject> object, | 1013 Handle<Code> CompileCallGlobal(Handle<JSObject> object, |
1009 Handle<GlobalObject> holder, | 1014 Handle<GlobalObject> holder, |
1010 Handle<PropertyCell> cell, | 1015 Handle<PropertyCell> cell, |
1011 Handle<JSFunction> function, | 1016 Handle<JSFunction> function, |
1012 Handle<Name> name); | 1017 Handle<Name> name); |
1013 | 1018 |
1014 static bool HasCustomCallGenerator(Handle<JSFunction> function); | 1019 static bool HasCustomCallGenerator(Handle<JSFunction> function); |
| 1020 static bool CanBeCached(Handle<JSFunction> function); |
1015 | 1021 |
1016 private: | 1022 private: |
1017 // Compiles a custom call constant/global IC. For constant calls cell is | 1023 // Compiles a custom call constant/global IC. For constant calls cell is |
1018 // NULL. Returns an empty handle if there is no custom call code for the | 1024 // NULL. Returns an empty handle if there is no custom call code for the |
1019 // given function. | 1025 // given function. |
1020 Handle<Code> CompileCustomCall(Handle<Object> object, | 1026 Handle<Code> CompileCustomCall(Handle<Object> object, |
1021 Handle<JSObject> holder, | 1027 Handle<JSObject> holder, |
1022 Handle<Cell> cell, | 1028 Handle<Cell> cell, |
1023 Handle<JSFunction> function, | 1029 Handle<JSFunction> function, |
1024 Handle<String> name); | 1030 Handle<String> name, |
| 1031 Code::StubType type); |
1025 | 1032 |
1026 #define DECLARE_CALL_GENERATOR(name) \ | 1033 #define DECLARE_CALL_GENERATOR(name) \ |
1027 Handle<Code> Compile##name##Call(Handle<Object> object, \ | 1034 Handle<Code> Compile##name##Call(Handle<Object> object, \ |
1028 Handle<JSObject> holder, \ | 1035 Handle<JSObject> holder, \ |
1029 Handle<Cell> cell, \ | 1036 Handle<Cell> cell, \ |
1030 Handle<JSFunction> function, \ | 1037 Handle<JSFunction> function, \ |
1031 Handle<String> fname); | 1038 Handle<String> fname, \ |
| 1039 Code::StubType type); |
1032 CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR) | 1040 CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR) |
1033 #undef DECLARE_CALL_GENERATOR | 1041 #undef DECLARE_CALL_GENERATOR |
1034 | 1042 |
1035 Handle<Code> CompileFastApiCall(const CallOptimization& optimization, | 1043 Handle<Code> CompileFastApiCall(const CallOptimization& optimization, |
1036 Handle<Object> object, | 1044 Handle<Object> object, |
1037 Handle<JSObject> holder, | 1045 Handle<JSObject> holder, |
1038 Handle<Cell> cell, | 1046 Handle<Cell> cell, |
1039 Handle<JSFunction> function, | 1047 Handle<JSFunction> function, |
1040 Handle<String> name); | 1048 Handle<String> name); |
1041 | 1049 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 Handle<JSFunction> constant_function_; | 1120 Handle<JSFunction> constant_function_; |
1113 bool is_simple_api_call_; | 1121 bool is_simple_api_call_; |
1114 Handle<FunctionTemplateInfo> expected_receiver_type_; | 1122 Handle<FunctionTemplateInfo> expected_receiver_type_; |
1115 Handle<CallHandlerInfo> api_call_info_; | 1123 Handle<CallHandlerInfo> api_call_info_; |
1116 }; | 1124 }; |
1117 | 1125 |
1118 | 1126 |
1119 } } // namespace v8::internal | 1127 } } // namespace v8::internal |
1120 | 1128 |
1121 #endif // V8_STUB_CACHE_H_ | 1129 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |