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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 } | 1030 } |
1031 | 1031 |
1032 // Returns the depth of the object having the expected type in the | 1032 // Returns the depth of the object having the expected type in the |
1033 // prototype chain between the two arguments. | 1033 // prototype chain between the two arguments. |
1034 int GetPrototypeDepthOfExpectedType(Handle<JSObject> object, | 1034 int GetPrototypeDepthOfExpectedType(Handle<JSObject> object, |
1035 Handle<JSObject> holder) const; | 1035 Handle<JSObject> holder) const; |
1036 | 1036 |
1037 bool IsCompatibleReceiver(Object* receiver) { | 1037 bool IsCompatibleReceiver(Object* receiver) { |
1038 ASSERT(is_simple_api_call()); | 1038 ASSERT(is_simple_api_call()); |
1039 if (expected_receiver_type_.is_null()) return true; | 1039 if (expected_receiver_type_.is_null()) return true; |
1040 return receiver->IsInstanceOf(*expected_receiver_type_); | 1040 return expected_receiver_type_->IsTemplateFor(receiver); |
1041 } | 1041 } |
1042 | 1042 |
1043 private: | 1043 private: |
1044 void Initialize(Handle<JSFunction> function); | 1044 void Initialize(Handle<JSFunction> function); |
1045 | 1045 |
1046 // Determines whether the given function can be called using the | 1046 // Determines whether the given function can be called using the |
1047 // fast api call builtin. | 1047 // fast api call builtin. |
1048 void AnalyzePossibleApiFunction(Handle<JSFunction> function); | 1048 void AnalyzePossibleApiFunction(Handle<JSFunction> function); |
1049 | 1049 |
1050 Handle<JSFunction> constant_function_; | 1050 Handle<JSFunction> constant_function_; |
1051 bool is_simple_api_call_; | 1051 bool is_simple_api_call_; |
1052 Handle<FunctionTemplateInfo> expected_receiver_type_; | 1052 Handle<FunctionTemplateInfo> expected_receiver_type_; |
1053 Handle<CallHandlerInfo> api_call_info_; | 1053 Handle<CallHandlerInfo> api_call_info_; |
1054 }; | 1054 }; |
1055 | 1055 |
1056 | 1056 |
1057 } } // namespace v8::internal | 1057 } } // namespace v8::internal |
1058 | 1058 |
1059 #endif // V8_STUB_CACHE_H_ | 1059 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |