| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_INL_H_ | 5 #ifndef V8_IC_INL_H_ |
| 6 #define V8_IC_INL_H_ | 6 #define V8_IC_INL_H_ |
| 7 | 7 |
| 8 #include "src/ic/ic.h" | 8 #include "src/ic/ic.h" |
| 9 | 9 |
| 10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 | 86 |
| 87 void IC::set_target(Code* code) { | 87 void IC::set_target(Code* code) { |
| 88 SetTargetAtAddress(address(), code, constant_pool()); | 88 SetTargetAtAddress(address(), code, constant_pool()); |
| 89 } | 89 } |
| 90 | 90 |
| 91 Code* IC::target() const { | 91 Code* IC::target() const { |
| 92 return GetTargetAtAddress(address(), constant_pool()); | 92 return GetTargetAtAddress(address(), constant_pool()); |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool IC::IsHandler(Object* object) { |
| 96 return (object->IsSmi() && (object != nullptr)) || |
| 97 (object->IsCode() && Code::cast(object)->is_handler()); |
| 98 } |
| 99 |
| 95 Handle<Map> IC::GetHandlerCacheHolder(Handle<Map> receiver_map, | 100 Handle<Map> IC::GetHandlerCacheHolder(Handle<Map> receiver_map, |
| 96 bool receiver_is_holder, Isolate* isolate, | 101 bool receiver_is_holder, Isolate* isolate, |
| 97 CacheHolderFlag* flag) { | 102 CacheHolderFlag* flag) { |
| 98 if (receiver_is_holder) { | 103 if (receiver_is_holder) { |
| 99 *flag = kCacheOnReceiver; | 104 *flag = kCacheOnReceiver; |
| 100 return receiver_map; | 105 return receiver_map; |
| 101 } | 106 } |
| 102 Handle<JSFunction> builtin_ctor; | 107 Handle<JSFunction> builtin_ctor; |
| 103 if (Map::GetConstructorFunction(receiver_map, isolate->native_context()) | 108 if (Map::GetConstructorFunction(receiver_map, isolate->native_context()) |
| 104 .ToHandle(&builtin_ctor)) { | 109 .ToHandle(&builtin_ctor)) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 bool IC::AddressIsDeoptimizedCode(Isolate* isolate, Address address) { | 147 bool IC::AddressIsDeoptimizedCode(Isolate* isolate, Address address) { |
| 143 Code* host = | 148 Code* host = |
| 144 isolate->inner_pointer_to_code_cache()->GetCacheEntry(address)->code; | 149 isolate->inner_pointer_to_code_cache()->GetCacheEntry(address)->code; |
| 145 return (host->kind() == Code::OPTIMIZED_FUNCTION && | 150 return (host->kind() == Code::OPTIMIZED_FUNCTION && |
| 146 host->marked_for_deoptimization()); | 151 host->marked_for_deoptimization()); |
| 147 } | 152 } |
| 148 } // namespace internal | 153 } // namespace internal |
| 149 } // namespace v8 | 154 } // namespace v8 |
| 150 | 155 |
| 151 #endif // V8_IC_INL_H_ | 156 #endif // V8_IC_INL_H_ |
| OLD | NEW |