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_H_ | 5 #ifndef V8_IC_H_ |
6 #define V8_IC_H_ | 6 #define V8_IC_H_ |
7 | 7 |
8 #include "src/ic/ic-state.h" | 8 #include "src/ic/ic-state.h" |
9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 class CallIC : public IC { | 250 class CallIC : public IC { |
251 public: | 251 public: |
252 CallIC(Isolate* isolate, CallICNexus* nexus) | 252 CallIC(Isolate* isolate, CallICNexus* nexus) |
253 : IC(EXTRA_CALL_FRAME, isolate, nexus) { | 253 : IC(EXTRA_CALL_FRAME, isolate, nexus) { |
254 DCHECK(nexus != NULL); | 254 DCHECK(nexus != NULL); |
255 } | 255 } |
256 | 256 |
257 void HandleMiss(Handle<Object> function); | 257 void HandleMiss(Handle<Object> function); |
258 | 258 |
259 // Code generator routines. | 259 // Code generator routines. |
260 static Handle<Code> initialize_stub(Isolate* isolate, int argc, | |
261 ConvertReceiverMode mode, | |
262 TailCallMode tail_call_mode); | |
263 static Handle<Code> initialize_stub_in_optimized_code( | 260 static Handle<Code> initialize_stub_in_optimized_code( |
264 Isolate* isolate, int argc, ConvertReceiverMode mode, | 261 Isolate* isolate, int argc, ConvertReceiverMode mode, |
265 TailCallMode tail_call_mode); | 262 TailCallMode tail_call_mode); |
266 | 263 |
267 static void Clear(Isolate* isolate, Code* host, CallICNexus* nexus); | 264 static void Clear(Isolate* isolate, Code* host, CallICNexus* nexus); |
268 }; | 265 }; |
269 | 266 |
270 | 267 |
271 class LoadIC : public IC { | 268 class LoadIC : public IC { |
272 public: | 269 public: |
(...skipping 14 matching lines...) Expand all Loading... |
287 bool ShouldThrowReferenceError(Handle<Object> receiver) { | 284 bool ShouldThrowReferenceError(Handle<Object> receiver) { |
288 return receiver->IsJSGlobalObject() && typeof_mode() == NOT_INSIDE_TYPEOF; | 285 return receiver->IsJSGlobalObject() && typeof_mode() == NOT_INSIDE_TYPEOF; |
289 } | 286 } |
290 | 287 |
291 // Code generator routines. | 288 // Code generator routines. |
292 | 289 |
293 static void GenerateMiss(MacroAssembler* masm); | 290 static void GenerateMiss(MacroAssembler* masm); |
294 static void GenerateRuntimeGetProperty(MacroAssembler* masm); | 291 static void GenerateRuntimeGetProperty(MacroAssembler* masm); |
295 static void GenerateNormal(MacroAssembler* masm); | 292 static void GenerateNormal(MacroAssembler* masm); |
296 | 293 |
297 static Handle<Code> initialize_stub(Isolate* isolate, | |
298 ExtraICState extra_state); | |
299 static Handle<Code> initialize_stub_in_optimized_code( | 294 static Handle<Code> initialize_stub_in_optimized_code( |
300 Isolate* isolate, ExtraICState extra_state, State initialization_state); | 295 Isolate* isolate, ExtraICState extra_state, State initialization_state); |
301 | 296 |
302 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, | 297 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, |
303 Handle<Name> name); | 298 Handle<Name> name); |
304 | 299 |
305 static void Clear(Isolate* isolate, Code* host, LoadICNexus* nexus); | 300 static void Clear(Isolate* isolate, Code* host, LoadICNexus* nexus); |
306 | 301 |
307 protected: | 302 protected: |
308 Handle<Code> slow_stub() const { | 303 Handle<Code> slow_stub() const { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 static void GenerateRuntimeGetProperty(MacroAssembler* masm); | 353 static void GenerateRuntimeGetProperty(MacroAssembler* masm); |
359 static void GenerateMegamorphic(MacroAssembler* masm); | 354 static void GenerateMegamorphic(MacroAssembler* masm); |
360 | 355 |
361 // Bit mask to be tested against bit field for the cases when | 356 // Bit mask to be tested against bit field for the cases when |
362 // generic stub should go into slow case. | 357 // generic stub should go into slow case. |
363 // Access check is necessary explicitly since generic stub does not perform | 358 // Access check is necessary explicitly since generic stub does not perform |
364 // map checks. | 359 // map checks. |
365 static const int kSlowCaseBitFieldMask = | 360 static const int kSlowCaseBitFieldMask = |
366 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); | 361 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); |
367 | 362 |
368 static Handle<Code> initialize_stub(Isolate* isolate, | |
369 ExtraICState extra_state); | |
370 static Handle<Code> initialize_stub_in_optimized_code( | 363 static Handle<Code> initialize_stub_in_optimized_code( |
371 Isolate* isolate, State initialization_state, ExtraICState extra_state); | 364 Isolate* isolate, State initialization_state, ExtraICState extra_state); |
372 static Handle<Code> ChooseMegamorphicStub(Isolate* isolate, | 365 static Handle<Code> ChooseMegamorphicStub(Isolate* isolate, |
373 ExtraICState extra_state); | 366 ExtraICState extra_state); |
374 | 367 |
375 static void Clear(Isolate* isolate, Code* host, KeyedLoadICNexus* nexus); | 368 static void Clear(Isolate* isolate, Code* host, KeyedLoadICNexus* nexus); |
376 | 369 |
377 protected: | 370 protected: |
378 // receiver is HeapObject because it could be a String or a JSObject | 371 // receiver is HeapObject because it could be a String or a JSObject |
379 Handle<Code> LoadElementStub(Handle<HeapObject> receiver); | 372 Handle<Code> LoadElementStub(Handle<HeapObject> receiver); |
(...skipping 19 matching lines...) Expand all Loading... |
399 } | 392 } |
400 | 393 |
401 // Code generators for stub routines. Only called once at startup. | 394 // Code generators for stub routines. Only called once at startup. |
402 static void GenerateSlow(MacroAssembler* masm); | 395 static void GenerateSlow(MacroAssembler* masm); |
403 static void GenerateMiss(MacroAssembler* masm); | 396 static void GenerateMiss(MacroAssembler* masm); |
404 static void GenerateMegamorphic(MacroAssembler* masm); | 397 static void GenerateMegamorphic(MacroAssembler* masm); |
405 static void GenerateNormal(MacroAssembler* masm); | 398 static void GenerateNormal(MacroAssembler* masm); |
406 static void GenerateRuntimeSetProperty(MacroAssembler* masm, | 399 static void GenerateRuntimeSetProperty(MacroAssembler* masm, |
407 LanguageMode language_mode); | 400 LanguageMode language_mode); |
408 | 401 |
409 static Handle<Code> initialize_stub(Isolate* isolate, | |
410 LanguageMode language_mode, | |
411 State initialization_state); | |
412 static Handle<Code> initialize_stub_in_optimized_code( | 402 static Handle<Code> initialize_stub_in_optimized_code( |
413 Isolate* isolate, LanguageMode language_mode, State initialization_state); | 403 Isolate* isolate, LanguageMode language_mode, State initialization_state); |
414 | 404 |
415 MUST_USE_RESULT MaybeHandle<Object> Store( | 405 MUST_USE_RESULT MaybeHandle<Object> Store( |
416 Handle<Object> object, Handle<Name> name, Handle<Object> value, | 406 Handle<Object> object, Handle<Name> name, Handle<Object> value, |
417 JSReceiver::StoreFromKeyed store_mode = | 407 JSReceiver::StoreFromKeyed store_mode = |
418 JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED); | 408 JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED); |
419 | 409 |
420 bool LookupForWrite(LookupIterator* it, Handle<Object> value, | 410 bool LookupForWrite(LookupIterator* it, Handle<Object> value, |
421 JSReceiver::StoreFromKeyed store_mode); | 411 JSReceiver::StoreFromKeyed store_mode); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 MUST_USE_RESULT MaybeHandle<Object> Store(Handle<Object> object, | 463 MUST_USE_RESULT MaybeHandle<Object> Store(Handle<Object> object, |
474 Handle<Object> name, | 464 Handle<Object> name, |
475 Handle<Object> value); | 465 Handle<Object> value); |
476 | 466 |
477 // Code generators for stub routines. Only called once at startup. | 467 // Code generators for stub routines. Only called once at startup. |
478 static void GenerateMiss(MacroAssembler* masm); | 468 static void GenerateMiss(MacroAssembler* masm); |
479 static void GenerateSlow(MacroAssembler* masm); | 469 static void GenerateSlow(MacroAssembler* masm); |
480 static void GenerateMegamorphic(MacroAssembler* masm, | 470 static void GenerateMegamorphic(MacroAssembler* masm, |
481 LanguageMode language_mode); | 471 LanguageMode language_mode); |
482 | 472 |
483 static Handle<Code> initialize_stub(Isolate* isolate, | |
484 LanguageMode language_mode, | |
485 State initialization_state); | |
486 | |
487 static Handle<Code> initialize_stub_in_optimized_code( | 473 static Handle<Code> initialize_stub_in_optimized_code( |
488 Isolate* isolate, LanguageMode language_mode, State initialization_state); | 474 Isolate* isolate, LanguageMode language_mode, State initialization_state); |
489 static Handle<Code> ChooseMegamorphicStub(Isolate* isolate, | 475 static Handle<Code> ChooseMegamorphicStub(Isolate* isolate, |
490 ExtraICState extra_state); | 476 ExtraICState extra_state); |
491 | 477 |
492 static void Clear(Isolate* isolate, Code* host, KeyedStoreICNexus* nexus); | 478 static void Clear(Isolate* isolate, Code* host, KeyedStoreICNexus* nexus); |
493 | 479 |
494 protected: | 480 protected: |
495 Handle<Code> StoreElementStub(Handle<Map> receiver_map, | 481 Handle<Code> StoreElementStub(Handle<Map> receiver_map, |
496 KeyedAccessStoreMode store_mode); | 482 KeyedAccessStoreMode store_mode); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 | 541 |
556 // Helper for BinaryOpIC and CompareIC. | 542 // Helper for BinaryOpIC and CompareIC. |
557 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 543 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
558 void PatchInlinedSmiCode(Isolate* isolate, Address address, | 544 void PatchInlinedSmiCode(Isolate* isolate, Address address, |
559 InlinedSmiCheck check); | 545 InlinedSmiCheck check); |
560 | 546 |
561 } // namespace internal | 547 } // namespace internal |
562 } // namespace v8 | 548 } // namespace v8 |
563 | 549 |
564 #endif // V8_IC_H_ | 550 #endif // V8_IC_H_ |
OLD | NEW |