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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 return code; | 140 return code; |
141 } | 141 } |
142 | 142 |
143 | 143 |
144 Handle<Code> StubCache::ComputeLoadField(Handle<String> name, | 144 Handle<Code> StubCache::ComputeLoadField(Handle<String> name, |
145 Handle<JSObject> receiver, | 145 Handle<JSObject> receiver, |
146 Handle<JSObject> holder, | 146 Handle<JSObject> holder, |
147 PropertyIndex field) { | 147 PropertyIndex field) { |
148 InlineCacheHolderFlag cache_holder = | 148 InlineCacheHolderFlag cache_holder = |
149 IC::GetCodeCacheForObject(*receiver, *holder); | 149 IC::GetCodeCacheForObject(*receiver, *holder); |
150 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); | 150 Handle<JSObject> map_holder( |
| 151 IC::GetCodeCacheHolder(isolate_, *receiver, cache_holder)); |
151 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::FIELD); | 152 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::FIELD); |
152 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), | 153 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), |
153 isolate_); | 154 isolate_); |
154 if (probe->IsCode()) return Handle<Code>::cast(probe); | 155 if (probe->IsCode()) return Handle<Code>::cast(probe); |
155 | 156 |
156 LoadStubCompiler compiler(isolate_); | 157 LoadStubCompiler compiler(isolate_); |
157 Handle<Code> code = compiler.CompileLoadField(receiver, holder, name, field); | 158 Handle<Code> code = compiler.CompileLoadField(receiver, holder, name, field); |
158 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); | 159 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); |
159 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); | 160 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); |
160 JSObject::UpdateMapCodeCache(map_holder, name, code); | 161 JSObject::UpdateMapCodeCache(map_holder, name, code); |
161 return code; | 162 return code; |
162 } | 163 } |
163 | 164 |
164 | 165 |
165 Handle<Code> StubCache::ComputeLoadCallback( | 166 Handle<Code> StubCache::ComputeLoadCallback( |
166 Handle<String> name, | 167 Handle<String> name, |
167 Handle<JSObject> receiver, | 168 Handle<JSObject> receiver, |
168 Handle<JSObject> holder, | 169 Handle<JSObject> holder, |
169 Handle<ExecutableAccessorInfo> callback) { | 170 Handle<ExecutableAccessorInfo> callback) { |
170 ASSERT(v8::ToCData<Address>(callback->getter()) != 0); | 171 ASSERT(v8::ToCData<Address>(callback->getter()) != 0); |
171 InlineCacheHolderFlag cache_holder = | 172 InlineCacheHolderFlag cache_holder = |
172 IC::GetCodeCacheForObject(*receiver, *holder); | 173 IC::GetCodeCacheForObject(*receiver, *holder); |
173 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); | 174 Handle<JSObject> map_holder( |
| 175 IC::GetCodeCacheHolder(isolate_, *receiver, cache_holder)); |
174 Code::Flags flags = | 176 Code::Flags flags = |
175 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CALLBACKS); | 177 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CALLBACKS); |
176 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), | 178 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), |
177 isolate_); | 179 isolate_); |
178 if (probe->IsCode()) return Handle<Code>::cast(probe); | 180 if (probe->IsCode()) return Handle<Code>::cast(probe); |
179 | 181 |
180 LoadStubCompiler compiler(isolate_); | 182 LoadStubCompiler compiler(isolate_); |
181 Handle<Code> code = | 183 Handle<Code> code = |
182 compiler.CompileLoadCallback(receiver, holder, name, callback); | 184 compiler.CompileLoadCallback(receiver, holder, name, callback); |
183 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); | 185 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); |
184 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); | 186 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); |
185 JSObject::UpdateMapCodeCache(map_holder, name, code); | 187 JSObject::UpdateMapCodeCache(map_holder, name, code); |
186 return code; | 188 return code; |
187 } | 189 } |
188 | 190 |
189 | 191 |
190 Handle<Code> StubCache::ComputeLoadViaGetter(Handle<String> name, | 192 Handle<Code> StubCache::ComputeLoadViaGetter(Handle<String> name, |
191 Handle<JSObject> receiver, | 193 Handle<JSObject> receiver, |
192 Handle<JSObject> holder, | 194 Handle<JSObject> holder, |
193 Handle<JSFunction> getter) { | 195 Handle<JSFunction> getter) { |
194 InlineCacheHolderFlag cache_holder = | 196 InlineCacheHolderFlag cache_holder = |
195 IC::GetCodeCacheForObject(*receiver, *holder); | 197 IC::GetCodeCacheForObject(*receiver, *holder); |
196 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); | 198 Handle<JSObject> map_holder( |
| 199 IC::GetCodeCacheHolder(isolate_, *receiver, cache_holder)); |
197 Code::Flags flags = | 200 Code::Flags flags = |
198 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CALLBACKS); | 201 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CALLBACKS); |
199 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), | 202 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), |
200 isolate_); | 203 isolate_); |
201 if (probe->IsCode()) return Handle<Code>::cast(probe); | 204 if (probe->IsCode()) return Handle<Code>::cast(probe); |
202 | 205 |
203 LoadStubCompiler compiler(isolate_); | 206 LoadStubCompiler compiler(isolate_); |
204 Handle<Code> code = | 207 Handle<Code> code = |
205 compiler.CompileLoadViaGetter(receiver, holder, name, getter); | 208 compiler.CompileLoadViaGetter(receiver, holder, name, getter); |
206 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); | 209 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); |
207 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); | 210 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); |
208 JSObject::UpdateMapCodeCache(map_holder, name, code); | 211 JSObject::UpdateMapCodeCache(map_holder, name, code); |
209 return code; | 212 return code; |
210 } | 213 } |
211 | 214 |
212 | 215 |
213 Handle<Code> StubCache::ComputeLoadConstant(Handle<String> name, | 216 Handle<Code> StubCache::ComputeLoadConstant(Handle<String> name, |
214 Handle<JSObject> receiver, | 217 Handle<JSObject> receiver, |
215 Handle<JSObject> holder, | 218 Handle<JSObject> holder, |
216 Handle<JSFunction> value) { | 219 Handle<JSFunction> value) { |
217 InlineCacheHolderFlag cache_holder = | 220 InlineCacheHolderFlag cache_holder = |
218 IC::GetCodeCacheForObject(*receiver, *holder); | 221 IC::GetCodeCacheForObject(*receiver, *holder); |
219 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); | 222 Handle<JSObject> map_holder( |
| 223 IC::GetCodeCacheHolder(isolate_, *receiver, cache_holder)); |
220 Code::Flags flags = | 224 Code::Flags flags = |
221 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CONSTANT_FUNCTION); | 225 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::CONSTANT_FUNCTION); |
222 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), | 226 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), |
223 isolate_); | 227 isolate_); |
224 if (probe->IsCode()) return Handle<Code>::cast(probe); | 228 if (probe->IsCode()) return Handle<Code>::cast(probe); |
225 | 229 |
226 LoadStubCompiler compiler(isolate_); | 230 LoadStubCompiler compiler(isolate_); |
227 Handle<Code> code = | 231 Handle<Code> code = |
228 compiler.CompileLoadConstant(receiver, holder, name, value); | 232 compiler.CompileLoadConstant(receiver, holder, name, value); |
229 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); | 233 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); |
230 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); | 234 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); |
231 JSObject::UpdateMapCodeCache(map_holder, name, code); | 235 JSObject::UpdateMapCodeCache(map_holder, name, code); |
232 return code; | 236 return code; |
233 } | 237 } |
234 | 238 |
235 | 239 |
236 Handle<Code> StubCache::ComputeLoadInterceptor(Handle<String> name, | 240 Handle<Code> StubCache::ComputeLoadInterceptor(Handle<String> name, |
237 Handle<JSObject> receiver, | 241 Handle<JSObject> receiver, |
238 Handle<JSObject> holder) { | 242 Handle<JSObject> holder) { |
239 InlineCacheHolderFlag cache_holder = | 243 InlineCacheHolderFlag cache_holder = |
240 IC::GetCodeCacheForObject(*receiver, *holder); | 244 IC::GetCodeCacheForObject(*receiver, *holder); |
241 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); | 245 Handle<JSObject> map_holder( |
| 246 IC::GetCodeCacheHolder(isolate_, *receiver, cache_holder)); |
242 Code::Flags flags = | 247 Code::Flags flags = |
243 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::INTERCEPTOR); | 248 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::INTERCEPTOR); |
244 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), | 249 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), |
245 isolate_); | 250 isolate_); |
246 if (probe->IsCode()) return Handle<Code>::cast(probe); | 251 if (probe->IsCode()) return Handle<Code>::cast(probe); |
247 | 252 |
248 LoadStubCompiler compiler(isolate_); | 253 LoadStubCompiler compiler(isolate_); |
249 Handle<Code> code = | 254 Handle<Code> code = |
250 compiler.CompileLoadInterceptor(receiver, holder, name); | 255 compiler.CompileLoadInterceptor(receiver, holder, name); |
251 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); | 256 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); |
252 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); | 257 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); |
253 JSObject::UpdateMapCodeCache(map_holder, name, code); | 258 JSObject::UpdateMapCodeCache(map_holder, name, code); |
254 return code; | 259 return code; |
255 } | 260 } |
256 | 261 |
257 | 262 |
258 Handle<Code> StubCache::ComputeLoadNormal() { | 263 Handle<Code> StubCache::ComputeLoadNormal() { |
259 return isolate_->builtins()->LoadIC_Normal(); | 264 return isolate_->builtins()->LoadIC_Normal(); |
260 } | 265 } |
261 | 266 |
262 | 267 |
263 Handle<Code> StubCache::ComputeLoadGlobal(Handle<String> name, | 268 Handle<Code> StubCache::ComputeLoadGlobal(Handle<String> name, |
264 Handle<JSObject> receiver, | 269 Handle<JSObject> receiver, |
265 Handle<GlobalObject> holder, | 270 Handle<GlobalObject> holder, |
266 Handle<JSGlobalPropertyCell> cell, | 271 Handle<JSGlobalPropertyCell> cell, |
267 bool is_dont_delete) { | 272 bool is_dont_delete) { |
268 InlineCacheHolderFlag cache_holder = | 273 InlineCacheHolderFlag cache_holder = |
269 IC::GetCodeCacheForObject(*receiver, *holder); | 274 IC::GetCodeCacheForObject(*receiver, *holder); |
270 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); | 275 Handle<JSObject> map_holder( |
| 276 IC::GetCodeCacheHolder(isolate_, *receiver, cache_holder)); |
271 Code::Flags flags = | 277 Code::Flags flags = |
272 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::NORMAL); | 278 Code::ComputeMonomorphicFlags(Code::LOAD_IC, Code::NORMAL); |
273 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), | 279 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), |
274 isolate_); | 280 isolate_); |
275 if (probe->IsCode()) return Handle<Code>::cast(probe); | 281 if (probe->IsCode()) return Handle<Code>::cast(probe); |
276 | 282 |
277 LoadStubCompiler compiler(isolate_); | 283 LoadStubCompiler compiler(isolate_); |
278 Handle<Code> code = | 284 Handle<Code> code = |
279 compiler.CompileLoadGlobal(receiver, holder, cell, name, is_dont_delete); | 285 compiler.CompileLoadGlobal(receiver, holder, cell, name, is_dont_delete); |
280 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); | 286 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); |
281 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); | 287 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); |
282 JSObject::UpdateMapCodeCache(map_holder, name, code); | 288 JSObject::UpdateMapCodeCache(map_holder, name, code); |
283 return code; | 289 return code; |
284 } | 290 } |
285 | 291 |
286 | 292 |
287 Handle<Code> StubCache::ComputeKeyedLoadField(Handle<String> name, | 293 Handle<Code> StubCache::ComputeKeyedLoadField(Handle<String> name, |
288 Handle<JSObject> receiver, | 294 Handle<JSObject> receiver, |
289 Handle<JSObject> holder, | 295 Handle<JSObject> holder, |
290 PropertyIndex field) { | 296 PropertyIndex field) { |
291 InlineCacheHolderFlag cache_holder = | 297 InlineCacheHolderFlag cache_holder = |
292 IC::GetCodeCacheForObject(*receiver, *holder); | 298 IC::GetCodeCacheForObject(*receiver, *holder); |
293 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); | 299 Handle<JSObject> map_holder( |
| 300 IC::GetCodeCacheHolder(isolate_, *receiver, cache_holder)); |
294 Code::Flags flags = | 301 Code::Flags flags = |
295 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::FIELD); | 302 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::FIELD); |
296 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), | 303 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), |
297 isolate_); | 304 isolate_); |
298 if (probe->IsCode()) return Handle<Code>::cast(probe); | 305 if (probe->IsCode()) return Handle<Code>::cast(probe); |
299 | 306 |
300 KeyedLoadStubCompiler compiler(isolate_); | 307 KeyedLoadStubCompiler compiler(isolate_); |
301 Handle<Code> code = compiler.CompileLoadField(receiver, holder, name, field); | 308 Handle<Code> code = compiler.CompileLoadField(receiver, holder, name, field); |
302 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); | 309 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); |
303 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); | 310 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); |
304 JSObject::UpdateMapCodeCache(map_holder, name, code); | 311 JSObject::UpdateMapCodeCache(map_holder, name, code); |
305 return code; | 312 return code; |
306 } | 313 } |
307 | 314 |
308 | 315 |
309 Handle<Code> StubCache::ComputeKeyedLoadConstant(Handle<String> name, | 316 Handle<Code> StubCache::ComputeKeyedLoadConstant(Handle<String> name, |
310 Handle<JSObject> receiver, | 317 Handle<JSObject> receiver, |
311 Handle<JSObject> holder, | 318 Handle<JSObject> holder, |
312 Handle<JSFunction> value) { | 319 Handle<JSFunction> value) { |
313 InlineCacheHolderFlag cache_holder = | 320 InlineCacheHolderFlag cache_holder = |
314 IC::GetCodeCacheForObject(*receiver, *holder); | 321 IC::GetCodeCacheForObject(*receiver, *holder); |
315 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); | 322 Handle<JSObject> map_holder( |
| 323 IC::GetCodeCacheHolder(isolate_, *receiver, cache_holder)); |
316 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, | 324 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, |
317 Code::CONSTANT_FUNCTION); | 325 Code::CONSTANT_FUNCTION); |
318 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), | 326 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), |
319 isolate_); | 327 isolate_); |
320 if (probe->IsCode()) return Handle<Code>::cast(probe); | 328 if (probe->IsCode()) return Handle<Code>::cast(probe); |
321 | 329 |
322 KeyedLoadStubCompiler compiler(isolate_); | 330 KeyedLoadStubCompiler compiler(isolate_); |
323 Handle<Code> code = | 331 Handle<Code> code = |
324 compiler.CompileLoadConstant(receiver, holder, name, value); | 332 compiler.CompileLoadConstant(receiver, holder, name, value); |
325 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); | 333 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); |
326 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); | 334 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); |
327 JSObject::UpdateMapCodeCache(map_holder, name, code); | 335 JSObject::UpdateMapCodeCache(map_holder, name, code); |
328 return code; | 336 return code; |
329 } | 337 } |
330 | 338 |
331 | 339 |
332 Handle<Code> StubCache::ComputeKeyedLoadInterceptor(Handle<String> name, | 340 Handle<Code> StubCache::ComputeKeyedLoadInterceptor(Handle<String> name, |
333 Handle<JSObject> receiver, | 341 Handle<JSObject> receiver, |
334 Handle<JSObject> holder) { | 342 Handle<JSObject> holder) { |
335 InlineCacheHolderFlag cache_holder = | 343 InlineCacheHolderFlag cache_holder = |
336 IC::GetCodeCacheForObject(*receiver, *holder); | 344 IC::GetCodeCacheForObject(*receiver, *holder); |
337 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); | 345 Handle<JSObject> map_holder( |
| 346 IC::GetCodeCacheHolder(isolate_, *receiver, cache_holder)); |
338 Code::Flags flags = | 347 Code::Flags flags = |
339 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::INTERCEPTOR); | 348 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::INTERCEPTOR); |
340 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), | 349 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), |
341 isolate_); | 350 isolate_); |
342 if (probe->IsCode()) return Handle<Code>::cast(probe); | 351 if (probe->IsCode()) return Handle<Code>::cast(probe); |
343 | 352 |
344 KeyedLoadStubCompiler compiler(isolate_); | 353 KeyedLoadStubCompiler compiler(isolate_); |
345 Handle<Code> code = compiler.CompileLoadInterceptor(receiver, holder, name); | 354 Handle<Code> code = compiler.CompileLoadInterceptor(receiver, holder, name); |
346 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); | 355 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); |
347 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); | 356 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); |
348 JSObject::UpdateMapCodeCache(map_holder, name, code); | 357 JSObject::UpdateMapCodeCache(map_holder, name, code); |
349 return code; | 358 return code; |
350 } | 359 } |
351 | 360 |
352 | 361 |
353 Handle<Code> StubCache::ComputeKeyedLoadCallback( | 362 Handle<Code> StubCache::ComputeKeyedLoadCallback( |
354 Handle<String> name, | 363 Handle<String> name, |
355 Handle<JSObject> receiver, | 364 Handle<JSObject> receiver, |
356 Handle<JSObject> holder, | 365 Handle<JSObject> holder, |
357 Handle<ExecutableAccessorInfo> callback) { | 366 Handle<ExecutableAccessorInfo> callback) { |
358 InlineCacheHolderFlag cache_holder = | 367 InlineCacheHolderFlag cache_holder = |
359 IC::GetCodeCacheForObject(*receiver, *holder); | 368 IC::GetCodeCacheForObject(*receiver, *holder); |
360 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); | 369 Handle<JSObject> map_holder( |
| 370 IC::GetCodeCacheHolder(isolate_, *receiver, cache_holder)); |
361 Code::Flags flags = | 371 Code::Flags flags = |
362 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::CALLBACKS); | 372 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::CALLBACKS); |
363 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), | 373 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), |
364 isolate_); | 374 isolate_); |
365 if (probe->IsCode()) return Handle<Code>::cast(probe); | 375 if (probe->IsCode()) return Handle<Code>::cast(probe); |
366 | 376 |
367 KeyedLoadStubCompiler compiler(isolate_); | 377 KeyedLoadStubCompiler compiler(isolate_); |
368 Handle<Code> code = | 378 Handle<Code> code = |
369 compiler.CompileLoadCallback(receiver, holder, name, callback); | 379 compiler.CompileLoadCallback(receiver, holder, name, callback); |
370 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); | 380 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 Handle<Code> StubCache::ComputeCallConstant(int argc, | 571 Handle<Code> StubCache::ComputeCallConstant(int argc, |
562 Code::Kind kind, | 572 Code::Kind kind, |
563 Code::ExtraICState extra_state, | 573 Code::ExtraICState extra_state, |
564 Handle<String> name, | 574 Handle<String> name, |
565 Handle<Object> object, | 575 Handle<Object> object, |
566 Handle<JSObject> holder, | 576 Handle<JSObject> holder, |
567 Handle<JSFunction> function) { | 577 Handle<JSFunction> function) { |
568 // Compute the check type and the map. | 578 // Compute the check type and the map. |
569 InlineCacheHolderFlag cache_holder = | 579 InlineCacheHolderFlag cache_holder = |
570 IC::GetCodeCacheForObject(*object, *holder); | 580 IC::GetCodeCacheForObject(*object, *holder); |
571 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*object, cache_holder)); | 581 Handle<JSObject> map_holder( |
| 582 IC::GetCodeCacheHolder(isolate_, *object, cache_holder)); |
572 | 583 |
573 // Compute check type based on receiver/holder. | 584 // Compute check type based on receiver/holder. |
574 CheckType check = RECEIVER_MAP_CHECK; | 585 CheckType check = RECEIVER_MAP_CHECK; |
575 if (object->IsString()) { | 586 if (object->IsString()) { |
576 check = STRING_CHECK; | 587 check = STRING_CHECK; |
577 } else if (object->IsNumber()) { | 588 } else if (object->IsNumber()) { |
578 check = NUMBER_CHECK; | 589 check = NUMBER_CHECK; |
579 } else if (object->IsBoolean()) { | 590 } else if (object->IsBoolean()) { |
580 check = BOOLEAN_CHECK; | 591 check = BOOLEAN_CHECK; |
581 } | 592 } |
(...skipping 29 matching lines...) Expand all Loading... |
611 Handle<Code> StubCache::ComputeCallField(int argc, | 622 Handle<Code> StubCache::ComputeCallField(int argc, |
612 Code::Kind kind, | 623 Code::Kind kind, |
613 Code::ExtraICState extra_state, | 624 Code::ExtraICState extra_state, |
614 Handle<String> name, | 625 Handle<String> name, |
615 Handle<Object> object, | 626 Handle<Object> object, |
616 Handle<JSObject> holder, | 627 Handle<JSObject> holder, |
617 PropertyIndex index) { | 628 PropertyIndex index) { |
618 // Compute the check type and the map. | 629 // Compute the check type and the map. |
619 InlineCacheHolderFlag cache_holder = | 630 InlineCacheHolderFlag cache_holder = |
620 IC::GetCodeCacheForObject(*object, *holder); | 631 IC::GetCodeCacheForObject(*object, *holder); |
621 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*object, cache_holder)); | 632 Handle<JSObject> map_holder( |
| 633 IC::GetCodeCacheHolder(isolate_, *object, cache_holder)); |
622 | 634 |
623 // TODO(1233596): We cannot do receiver map check for non-JS objects | 635 // TODO(1233596): We cannot do receiver map check for non-JS objects |
624 // because they may be represented as immediates without a | 636 // because they may be represented as immediates without a |
625 // map. Instead, we check against the map in the holder. | 637 // map. Instead, we check against the map in the holder. |
626 if (object->IsNumber() || object->IsBoolean() || object->IsString()) { | 638 if (object->IsNumber() || object->IsBoolean() || object->IsString()) { |
627 object = holder; | 639 object = holder; |
628 } | 640 } |
629 | 641 |
630 Code::Flags flags = | 642 Code::Flags flags = |
631 Code::ComputeMonomorphicFlags(kind, Code::FIELD, extra_state, | 643 Code::ComputeMonomorphicFlags(kind, Code::FIELD, extra_state, |
(...skipping 17 matching lines...) Expand all Loading... |
649 | 661 |
650 Handle<Code> StubCache::ComputeCallInterceptor(int argc, | 662 Handle<Code> StubCache::ComputeCallInterceptor(int argc, |
651 Code::Kind kind, | 663 Code::Kind kind, |
652 Code::ExtraICState extra_state, | 664 Code::ExtraICState extra_state, |
653 Handle<String> name, | 665 Handle<String> name, |
654 Handle<Object> object, | 666 Handle<Object> object, |
655 Handle<JSObject> holder) { | 667 Handle<JSObject> holder) { |
656 // Compute the check type and the map. | 668 // Compute the check type and the map. |
657 InlineCacheHolderFlag cache_holder = | 669 InlineCacheHolderFlag cache_holder = |
658 IC::GetCodeCacheForObject(*object, *holder); | 670 IC::GetCodeCacheForObject(*object, *holder); |
659 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*object, cache_holder)); | 671 Handle<JSObject> map_holder( |
| 672 IC::GetCodeCacheHolder(isolate_, *object, cache_holder)); |
660 | 673 |
661 // TODO(1233596): We cannot do receiver map check for non-JS objects | 674 // TODO(1233596): We cannot do receiver map check for non-JS objects |
662 // because they may be represented as immediates without a | 675 // because they may be represented as immediates without a |
663 // map. Instead, we check against the map in the holder. | 676 // map. Instead, we check against the map in the holder. |
664 if (object->IsNumber() || object->IsBoolean() || object->IsString()) { | 677 if (object->IsNumber() || object->IsBoolean() || object->IsString()) { |
665 object = holder; | 678 object = holder; |
666 } | 679 } |
667 | 680 |
668 Code::Flags flags = | 681 Code::Flags flags = |
669 Code::ComputeMonomorphicFlags(kind, Code::INTERCEPTOR, extra_state, | 682 Code::ComputeMonomorphicFlags(kind, Code::INTERCEPTOR, extra_state, |
(...skipping 18 matching lines...) Expand all Loading... |
688 Handle<Code> StubCache::ComputeCallGlobal(int argc, | 701 Handle<Code> StubCache::ComputeCallGlobal(int argc, |
689 Code::Kind kind, | 702 Code::Kind kind, |
690 Code::ExtraICState extra_state, | 703 Code::ExtraICState extra_state, |
691 Handle<String> name, | 704 Handle<String> name, |
692 Handle<JSObject> receiver, | 705 Handle<JSObject> receiver, |
693 Handle<GlobalObject> holder, | 706 Handle<GlobalObject> holder, |
694 Handle<JSGlobalPropertyCell> cell, | 707 Handle<JSGlobalPropertyCell> cell, |
695 Handle<JSFunction> function) { | 708 Handle<JSFunction> function) { |
696 InlineCacheHolderFlag cache_holder = | 709 InlineCacheHolderFlag cache_holder = |
697 IC::GetCodeCacheForObject(*receiver, *holder); | 710 IC::GetCodeCacheForObject(*receiver, *holder); |
698 Handle<JSObject> map_holder(IC::GetCodeCacheHolder(*receiver, cache_holder)); | 711 Handle<JSObject> map_holder( |
| 712 IC::GetCodeCacheHolder(isolate_, *receiver, cache_holder)); |
699 Code::Flags flags = | 713 Code::Flags flags = |
700 Code::ComputeMonomorphicFlags(kind, Code::NORMAL, extra_state, | 714 Code::ComputeMonomorphicFlags(kind, Code::NORMAL, extra_state, |
701 cache_holder, argc); | 715 cache_holder, argc); |
702 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), | 716 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), |
703 isolate_); | 717 isolate_); |
704 if (probe->IsCode()) return Handle<Code>::cast(probe); | 718 if (probe->IsCode()) return Handle<Code>::cast(probe); |
705 | 719 |
706 CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder); | 720 CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder); |
707 Handle<Code> code = | 721 Handle<Code> code = |
708 compiler.CompileCallGlobal(receiver, holder, cell, function, name); | 722 compiler.CompileCallGlobal(receiver, holder, cell, function, name); |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 Handle<FunctionTemplateInfo>( | 1779 Handle<FunctionTemplateInfo>( |
1766 FunctionTemplateInfo::cast(signature->receiver())); | 1780 FunctionTemplateInfo::cast(signature->receiver())); |
1767 } | 1781 } |
1768 } | 1782 } |
1769 | 1783 |
1770 is_simple_api_call_ = true; | 1784 is_simple_api_call_ = true; |
1771 } | 1785 } |
1772 | 1786 |
1773 | 1787 |
1774 } } // namespace v8::internal | 1788 } } // namespace v8::internal |
OLD | NEW |