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/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 | 121 |
122 Code* IC::raw_target() const { | 122 Code* IC::raw_target() const { |
123 return GetTargetAtAddress(address(), constant_pool()); | 123 return GetTargetAtAddress(address(), constant_pool()); |
124 } | 124 } |
125 | 125 |
126 void IC::UpdateTarget() { target_ = handle(raw_target(), isolate_); } | 126 void IC::UpdateTarget() { target_ = handle(raw_target(), isolate_); } |
127 | 127 |
128 | 128 |
129 JSFunction* IC::GetRootConstructor(Map* receiver_map, Context* native_context) { | 129 JSFunction* IC::GetRootConstructor(Map* receiver_map, Context* native_context) { |
130 Isolate* isolate = receiver_map->GetIsolate(); | 130 DisallowHeapAllocation no_alloc; |
131 if (receiver_map == isolate->heap()->boolean_map()) { | 131 if (receiver_map->IsPrimitiveMap()) { |
132 return native_context->boolean_function(); | 132 int constructor_function_index = |
| 133 receiver_map->GetConstructorFunctionIndex(); |
| 134 if (constructor_function_index != Map::kNoConstructorFunctionIndex) { |
| 135 return JSFunction::cast(native_context->get(constructor_function_index)); |
| 136 } |
133 } | 137 } |
134 if (receiver_map->instance_type() == HEAP_NUMBER_TYPE) { | |
135 return native_context->number_function(); | |
136 } | |
137 if (receiver_map->instance_type() < FIRST_NONSTRING_TYPE) { | |
138 return native_context->string_function(); | |
139 } | |
140 if (receiver_map->instance_type() == SYMBOL_TYPE) { | |
141 return native_context->symbol_function(); | |
142 } | |
143 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ | |
144 if (receiver_map == isolate->heap()->type##_map()) { \ | |
145 return native_context->type##_function(); \ | |
146 } | |
147 SIMD128_TYPES(SIMD128_TYPE) | |
148 #undef SIMD128_TYPE | |
149 return nullptr; | 138 return nullptr; |
150 } | 139 } |
151 | 140 |
152 | 141 |
153 Handle<Map> IC::GetHandlerCacheHolder(Handle<Map> receiver_map, | 142 Handle<Map> IC::GetHandlerCacheHolder(Handle<Map> receiver_map, |
154 bool receiver_is_holder, Isolate* isolate, | 143 bool receiver_is_holder, Isolate* isolate, |
155 CacheHolderFlag* flag) { | 144 CacheHolderFlag* flag) { |
156 if (receiver_is_holder) { | 145 if (receiver_is_holder) { |
157 *flag = kCacheOnReceiver; | 146 *flag = kCacheOnReceiver; |
158 return receiver_map; | 147 return receiver_map; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 bool IC::AddressIsDeoptimizedCode(Isolate* isolate, Address address) { | 189 bool IC::AddressIsDeoptimizedCode(Isolate* isolate, Address address) { |
201 Code* host = | 190 Code* host = |
202 isolate->inner_pointer_to_code_cache()->GetCacheEntry(address)->code; | 191 isolate->inner_pointer_to_code_cache()->GetCacheEntry(address)->code; |
203 return (host->kind() == Code::OPTIMIZED_FUNCTION && | 192 return (host->kind() == Code::OPTIMIZED_FUNCTION && |
204 host->marked_for_deoptimization()); | 193 host->marked_for_deoptimization()); |
205 } | 194 } |
206 } | 195 } |
207 } // namespace v8::internal | 196 } // namespace v8::internal |
208 | 197 |
209 #endif // V8_IC_INL_H_ | 198 #endif // V8_IC_INL_H_ |
OLD | NEW |