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 | 10 |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 Handle<Object> key); | 405 Handle<Object> key); |
406 | 406 |
407 // Code generator routines. | 407 // Code generator routines. |
408 static void GenerateMiss(MacroAssembler* masm); | 408 static void GenerateMiss(MacroAssembler* masm); |
409 static void GenerateRuntimeGetProperty(MacroAssembler* masm); | 409 static void GenerateRuntimeGetProperty(MacroAssembler* masm); |
410 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } | 410 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
411 static void GeneratePreMonomorphic(MacroAssembler* masm) { | 411 static void GeneratePreMonomorphic(MacroAssembler* masm) { |
412 GenerateMiss(masm); | 412 GenerateMiss(masm); |
413 } | 413 } |
414 static void GenerateGeneric(MacroAssembler* masm); | 414 static void GenerateGeneric(MacroAssembler* masm); |
415 static void GenerateString(MacroAssembler* masm); | |
416 | 415 |
417 // Bit mask to be tested against bit field for the cases when | 416 // Bit mask to be tested against bit field for the cases when |
418 // generic stub should go into slow case. | 417 // generic stub should go into slow case. |
419 // Access check is necessary explicitly since generic stub does not perform | 418 // Access check is necessary explicitly since generic stub does not perform |
420 // map checks. | 419 // map checks. |
421 static const int kSlowCaseBitFieldMask = | 420 static const int kSlowCaseBitFieldMask = |
422 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); | 421 (1 << Map::kIsAccessCheckNeeded) | (1 << Map::kHasIndexedInterceptor); |
423 | 422 |
424 static Handle<Code> generic_stub(Isolate* isolate); | 423 static Handle<Code> generic_stub(Isolate* isolate); |
425 static Handle<Code> pre_monomorphic_stub(Isolate* isolate); | 424 static Handle<Code> pre_monomorphic_stub(Isolate* isolate); |
426 | 425 |
427 protected: | 426 protected: |
428 Handle<Code> LoadElementStub(Handle<JSObject> receiver); | 427 // receiver is HeapObject because it could be a String or a JSObject |
| 428 Handle<Code> LoadElementStub(Handle<HeapObject> receiver); |
429 virtual Handle<Code> pre_monomorphic_stub() const { | 429 virtual Handle<Code> pre_monomorphic_stub() const { |
430 return pre_monomorphic_stub(isolate()); | 430 return pre_monomorphic_stub(isolate()); |
431 } | 431 } |
432 | 432 |
433 private: | 433 private: |
434 Handle<Code> generic_stub() const { return generic_stub(isolate()); } | 434 Handle<Code> generic_stub() const { return generic_stub(isolate()); } |
435 Handle<Code> string_stub() { | |
436 return isolate()->builtins()->KeyedLoadIC_String(); | |
437 } | |
438 | 435 |
439 static void Clear(Isolate* isolate, Address address, Code* target, | 436 static void Clear(Isolate* isolate, Address address, Code* target, |
440 ConstantPoolArray* constant_pool); | 437 ConstantPoolArray* constant_pool); |
441 | 438 |
442 friend class IC; | 439 friend class IC; |
443 }; | 440 }; |
444 | 441 |
445 | 442 |
446 class StoreIC : public IC { | 443 class StoreIC : public IC { |
447 public: | 444 public: |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 | 685 |
689 // Support functions for interceptor handlers. | 686 // Support functions for interceptor handlers. |
690 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); | 687 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); |
691 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); | 688 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); |
692 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); | 689 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); |
693 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); | 690 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); |
694 } | 691 } |
695 } // namespace v8::internal | 692 } // namespace v8::internal |
696 | 693 |
697 #endif // V8_IC_H_ | 694 #endif // V8_IC_H_ |
OLD | NEW |