| 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 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 Handle<Name> name); | 1012 Handle<Name> name); |
| 1013 | 1013 |
| 1014 static bool HasCustomCallGenerator(Handle<JSFunction> function); | 1014 static bool HasCustomCallGenerator(Handle<JSFunction> function); |
| 1015 | 1015 |
| 1016 private: | 1016 private: |
| 1017 // Compiles a custom call constant/global IC. For constant calls cell is | 1017 // 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 | 1018 // NULL. Returns an empty handle if there is no custom call code for the |
| 1019 // given function. | 1019 // given function. |
| 1020 Handle<Code> CompileCustomCall(Handle<Object> object, | 1020 Handle<Code> CompileCustomCall(Handle<Object> object, |
| 1021 Handle<JSObject> holder, | 1021 Handle<JSObject> holder, |
| 1022 Handle<JSGlobalPropertyCell> cell, | 1022 Handle<Cell> cell, |
| 1023 Handle<JSFunction> function, | 1023 Handle<JSFunction> function, |
| 1024 Handle<String> name); | 1024 Handle<String> name); |
| 1025 | 1025 |
| 1026 #define DECLARE_CALL_GENERATOR(name) \ | 1026 #define DECLARE_CALL_GENERATOR(name) \ |
| 1027 Handle<Code> Compile##name##Call(Handle<Object> object, \ | 1027 Handle<Code> Compile##name##Call(Handle<Object> object, \ |
| 1028 Handle<JSObject> holder, \ | 1028 Handle<JSObject> holder, \ |
| 1029 Handle<JSGlobalPropertyCell> cell, \ | 1029 Handle<Cell> cell, \ |
| 1030 Handle<JSFunction> function, \ | 1030 Handle<JSFunction> function, \ |
| 1031 Handle<String> fname); | 1031 Handle<String> fname); |
| 1032 CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR) | 1032 CUSTOM_CALL_IC_GENERATORS(DECLARE_CALL_GENERATOR) |
| 1033 #undef DECLARE_CALL_GENERATOR | 1033 #undef DECLARE_CALL_GENERATOR |
| 1034 | 1034 |
| 1035 Handle<Code> CompileFastApiCall(const CallOptimization& optimization, | 1035 Handle<Code> CompileFastApiCall(const CallOptimization& optimization, |
| 1036 Handle<Object> object, | 1036 Handle<Object> object, |
| 1037 Handle<JSObject> holder, | 1037 Handle<JSObject> holder, |
| 1038 Handle<JSGlobalPropertyCell> cell, | 1038 Handle<Cell> cell, |
| 1039 Handle<JSFunction> function, | 1039 Handle<JSFunction> function, |
| 1040 Handle<String> name); | 1040 Handle<String> name); |
| 1041 | 1041 |
| 1042 Handle<Code> GetCode(Code::StubType type, Handle<Name> name); | 1042 Handle<Code> GetCode(Code::StubType type, Handle<Name> name); |
| 1043 Handle<Code> GetCode(Handle<JSFunction> function); | 1043 Handle<Code> GetCode(Handle<JSFunction> function); |
| 1044 | 1044 |
| 1045 const ParameterCount& arguments() { return arguments_; } | 1045 const ParameterCount& arguments() { return arguments_; } |
| 1046 | 1046 |
| 1047 void GenerateNameCheck(Handle<Name> name, Label* miss); | 1047 void GenerateNameCheck(Handle<Name> name, Label* miss); |
| 1048 | 1048 |
| 1049 void GenerateGlobalReceiverCheck(Handle<JSObject> object, | 1049 void GenerateGlobalReceiverCheck(Handle<JSObject> object, |
| 1050 Handle<JSObject> holder, | 1050 Handle<JSObject> holder, |
| 1051 Handle<Name> name, | 1051 Handle<Name> name, |
| 1052 Label* miss); | 1052 Label* miss); |
| 1053 | 1053 |
| 1054 // Generates code to load the function from the cell checking that | 1054 // Generates code to load the function from the cell checking that |
| 1055 // it still contains the same function. | 1055 // it still contains the same function. |
| 1056 void GenerateLoadFunctionFromCell(Handle<JSGlobalPropertyCell> cell, | 1056 void GenerateLoadFunctionFromCell(Handle<Cell> cell, |
| 1057 Handle<JSFunction> function, | 1057 Handle<JSFunction> function, |
| 1058 Label* miss); | 1058 Label* miss); |
| 1059 | 1059 |
| 1060 // Generates a jump to CallIC miss stub. | 1060 // Generates a jump to CallIC miss stub. |
| 1061 void GenerateMissBranch(); | 1061 void GenerateMissBranch(); |
| 1062 | 1062 |
| 1063 const ParameterCount arguments_; | 1063 const ParameterCount arguments_; |
| 1064 const Code::Kind kind_; | 1064 const Code::Kind kind_; |
| 1065 const Code::ExtraICState extra_state_; | 1065 const Code::ExtraICState extra_state_; |
| 1066 const InlineCacheHolderFlag cache_holder_; | 1066 const InlineCacheHolderFlag cache_holder_; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 Handle<JSFunction> constant_function_; | 1112 Handle<JSFunction> constant_function_; |
| 1113 bool is_simple_api_call_; | 1113 bool is_simple_api_call_; |
| 1114 Handle<FunctionTemplateInfo> expected_receiver_type_; | 1114 Handle<FunctionTemplateInfo> expected_receiver_type_; |
| 1115 Handle<CallHandlerInfo> api_call_info_; | 1115 Handle<CallHandlerInfo> api_call_info_; |
| 1116 }; | 1116 }; |
| 1117 | 1117 |
| 1118 | 1118 |
| 1119 } } // namespace v8::internal | 1119 } } // namespace v8::internal |
| 1120 | 1120 |
| 1121 #endif // V8_STUB_CACHE_H_ | 1121 #endif // V8_STUB_CACHE_H_ |
| OLD | NEW |