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 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 Handle<FunctionTemplateInfo> expected_receiver_type() const { | 912 Handle<FunctionTemplateInfo> expected_receiver_type() const { |
913 ASSERT(is_simple_api_call()); | 913 ASSERT(is_simple_api_call()); |
914 return expected_receiver_type_; | 914 return expected_receiver_type_; |
915 } | 915 } |
916 | 916 |
917 Handle<CallHandlerInfo> api_call_info() const { | 917 Handle<CallHandlerInfo> api_call_info() const { |
918 ASSERT(is_simple_api_call()); | 918 ASSERT(is_simple_api_call()); |
919 return api_call_info_; | 919 return api_call_info_; |
920 } | 920 } |
921 | 921 |
922 // Returns the depth of the object having the expected type in the | 922 bool IsCompatibleReceiver(Handle<Object> receiver) const { |
923 // prototype chain between the two arguments. | 923 ASSERT(is_simple_api_call()); |
924 int GetPrototypeDepthOfExpectedType(Handle<JSObject> object, | 924 return expected_receiver_type_.is_null() || |
925 Handle<JSObject> holder) const; | 925 receiver->IsInstanceOf(*expected_receiver_type_); |
| 926 } |
926 | 927 |
927 private: | 928 private: |
928 void Initialize(Handle<JSFunction> function); | 929 void Initialize(Handle<JSFunction> function); |
929 | 930 |
930 // Determines whether the given function can be called using the | 931 // Determines whether the given function can be called using the |
931 // fast api call builtin. | 932 // fast api call builtin. |
932 void AnalyzePossibleApiFunction(Handle<JSFunction> function); | 933 void AnalyzePossibleApiFunction(Handle<JSFunction> function); |
933 | 934 |
934 Handle<JSFunction> constant_function_; | 935 Handle<JSFunction> constant_function_; |
935 bool is_simple_api_call_; | 936 bool is_simple_api_call_; |
936 Handle<FunctionTemplateInfo> expected_receiver_type_; | 937 Handle<FunctionTemplateInfo> expected_receiver_type_; |
937 Handle<CallHandlerInfo> api_call_info_; | 938 Handle<CallHandlerInfo> api_call_info_; |
938 }; | 939 }; |
939 | 940 |
940 | 941 |
941 } } // namespace v8::internal | 942 } } // namespace v8::internal |
942 | 943 |
943 #endif // V8_STUB_CACHE_H_ | 944 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |