OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_IC_CALL_OPTIMIZATION_H_ | 5 #ifndef V8_IC_CALL_OPTIMIZATION_H_ |
6 #define V8_IC_CALL_OPTIMIZATION_H_ | 6 #define V8_IC_CALL_OPTIMIZATION_H_ |
7 | 7 |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/ic/access-compiler.h" | 9 #include "src/ic/access-compiler.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 enum HolderLookup { kHolderNotFound, kHolderIsReceiver, kHolderFound }; | 39 enum HolderLookup { kHolderNotFound, kHolderIsReceiver, kHolderFound }; |
40 Handle<JSObject> LookupHolderOfExpectedType( | 40 Handle<JSObject> LookupHolderOfExpectedType( |
41 Handle<Map> receiver_map, HolderLookup* holder_lookup, | 41 Handle<Map> receiver_map, HolderLookup* holder_lookup, |
42 int* holder_depth_in_prototype_chain = NULL) const; | 42 int* holder_depth_in_prototype_chain = NULL) const; |
43 | 43 |
44 // Check if the api holder is between the receiver and the holder. | 44 // Check if the api holder is between the receiver and the holder. |
45 bool IsCompatibleReceiver(Handle<Object> receiver, | 45 bool IsCompatibleReceiver(Handle<Object> receiver, |
46 Handle<JSObject> holder) const; | 46 Handle<JSObject> holder) const; |
47 | 47 |
| 48 // Check if the api holder is between the receiver and the holder. |
| 49 bool IsCompatibleReceiverType(Handle<Map> receiver_map, |
| 50 Handle<JSObject> holder) const; |
| 51 |
48 private: | 52 private: |
49 void Initialize(Handle<JSFunction> function); | 53 void Initialize(Handle<JSFunction> function); |
50 | 54 |
51 // Determines whether the given function can be called using the | 55 // Determines whether the given function can be called using the |
52 // fast api call builtin. | 56 // fast api call builtin. |
53 void AnalyzePossibleApiFunction(Handle<JSFunction> function); | 57 void AnalyzePossibleApiFunction(Handle<JSFunction> function); |
54 | 58 |
55 Handle<JSFunction> constant_function_; | 59 Handle<JSFunction> constant_function_; |
56 bool is_simple_api_call_; | 60 bool is_simple_api_call_; |
57 Handle<FunctionTemplateInfo> expected_receiver_type_; | 61 Handle<FunctionTemplateInfo> expected_receiver_type_; |
58 Handle<CallHandlerInfo> api_call_info_; | 62 Handle<CallHandlerInfo> api_call_info_; |
59 }; | 63 }; |
60 } | 64 } |
61 } // namespace v8::internal | 65 } // namespace v8::internal |
62 | 66 |
63 #endif // V8_IC_CALL_OPTIMIZATION_H_ | 67 #endif // V8_IC_CALL_OPTIMIZATION_H_ |
OLD | NEW |