| 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 20 matching lines...) Expand all Loading... |
| 31 return expected_receiver_type_; | 31 return expected_receiver_type_; |
| 32 } | 32 } |
| 33 | 33 |
| 34 Handle<CallHandlerInfo> api_call_info() const { | 34 Handle<CallHandlerInfo> api_call_info() const { |
| 35 DCHECK(is_simple_api_call()); | 35 DCHECK(is_simple_api_call()); |
| 36 return api_call_info_; | 36 return api_call_info_; |
| 37 } | 37 } |
| 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) const; | 41 Handle<Map> receiver_map, HolderLookup* holder_lookup, |
| 42 int* holder_depth_in_prototype_chain = NULL) const; |
| 42 | 43 |
| 43 // 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. |
| 44 bool IsCompatibleReceiver(Handle<Object> receiver, | 45 bool IsCompatibleReceiver(Handle<Object> receiver, |
| 45 Handle<JSObject> holder) const; | 46 Handle<JSObject> holder) const; |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 void Initialize(Handle<JSFunction> function); | 49 void Initialize(Handle<JSFunction> function); |
| 49 | 50 |
| 50 // Determines whether the given function can be called using the | 51 // Determines whether the given function can be called using the |
| 51 // fast api call builtin. | 52 // fast api call builtin. |
| 52 void AnalyzePossibleApiFunction(Handle<JSFunction> function); | 53 void AnalyzePossibleApiFunction(Handle<JSFunction> function); |
| 53 | 54 |
| 54 Handle<JSFunction> constant_function_; | 55 Handle<JSFunction> constant_function_; |
| 55 bool is_simple_api_call_; | 56 bool is_simple_api_call_; |
| 56 Handle<FunctionTemplateInfo> expected_receiver_type_; | 57 Handle<FunctionTemplateInfo> expected_receiver_type_; |
| 57 Handle<CallHandlerInfo> api_call_info_; | 58 Handle<CallHandlerInfo> api_call_info_; |
| 58 }; | 59 }; |
| 59 } | 60 } |
| 60 } // namespace v8::internal | 61 } // namespace v8::internal |
| 61 | 62 |
| 62 #endif // V8_IC_CALL_OPTIMIZATION_H_ | 63 #endif // V8_IC_CALL_OPTIMIZATION_H_ |
| OLD | NEW |