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_STUB_CACHE_H_ | 5 #ifndef V8_STUB_CACHE_H_ |
6 #define V8_STUB_CACHE_H_ | 6 #define V8_STUB_CACHE_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 bool IncludesNumberType(TypeHandleList* types); | 496 bool IncludesNumberType(TypeHandleList* types); |
497 | 497 |
498 Code::Kind kind_; | 498 Code::Kind kind_; |
499 CacheHolderFlag cache_holder_; | 499 CacheHolderFlag cache_holder_; |
500 Register* registers_; | 500 Register* registers_; |
501 }; | 501 }; |
502 | 502 |
503 | 503 |
504 class LoadStubCompiler: public BaseLoadStoreStubCompiler { | 504 class LoadStubCompiler: public BaseLoadStoreStubCompiler { |
505 public: | 505 public: |
506 LoadStubCompiler(Isolate* isolate, | 506 LoadStubCompiler(Isolate* isolate, Code::Kind kind = Code::LOAD_IC, |
507 ExtraICState extra_ic_state = kNoExtraICState, | 507 ExtraICState extra_ic_state = kNoExtraICState, |
508 CacheHolderFlag cache_holder = kCacheOnReceiver, | 508 CacheHolderFlag cache_holder = kCacheOnReceiver) |
509 Code::Kind kind = Code::LOAD_IC) | |
510 : BaseLoadStoreStubCompiler(isolate, kind, extra_ic_state, cache_holder) { | 509 : BaseLoadStoreStubCompiler(isolate, kind, extra_ic_state, cache_holder) { |
511 } | 510 } |
512 virtual ~LoadStubCompiler() { } | 511 virtual ~LoadStubCompiler() { } |
| 512 static Register* registers(); |
513 | 513 |
514 Handle<Code> CompileLoadField(Handle<HeapType> type, | 514 Handle<Code> CompileLoadField(Handle<HeapType> type, |
515 Handle<JSObject> holder, | 515 Handle<JSObject> holder, |
516 Handle<Name> name, | 516 Handle<Name> name, |
517 FieldIndex index, | 517 FieldIndex index, |
518 Representation representation); | 518 Representation representation); |
519 | 519 |
520 Handle<Code> CompileLoadCallback(Handle<HeapType> type, | 520 Handle<Code> CompileLoadCallback(Handle<HeapType> type, |
521 Handle<JSObject> holder, | 521 Handle<JSObject> holder, |
522 Handle<Name> name, | 522 Handle<Name> name, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 Handle<Object> object, | 596 Handle<Object> object, |
597 Handle<JSObject> holder, | 597 Handle<JSObject> holder, |
598 LookupResult* lookup, | 598 LookupResult* lookup, |
599 Handle<Name> name); | 599 Handle<Name> name); |
600 void GenerateLoadPostInterceptor(Register reg, | 600 void GenerateLoadPostInterceptor(Register reg, |
601 Handle<JSObject> interceptor_holder, | 601 Handle<JSObject> interceptor_holder, |
602 Handle<Name> name, | 602 Handle<Name> name, |
603 LookupResult* lookup); | 603 LookupResult* lookup); |
604 | 604 |
605 private: | 605 private: |
606 static Register* registers(); | |
607 Register scratch4() { return registers_[5]; } | 606 Register scratch4() { return registers_[5]; } |
608 friend class BaseLoadStoreStubCompiler; | 607 friend class BaseLoadStoreStubCompiler; |
609 }; | 608 }; |
610 | 609 |
611 | 610 |
612 class KeyedLoadStubCompiler: public LoadStubCompiler { | 611 class KeyedLoadStubCompiler : public StubCompiler { |
613 public: | 612 public: |
614 KeyedLoadStubCompiler(Isolate* isolate, | 613 KeyedLoadStubCompiler(Isolate* isolate, |
615 ExtraICState extra_ic_state = kNoExtraICState, | 614 ExtraICState extra_ic_state = kNoExtraICState) |
616 CacheHolderFlag cache_holder = kCacheOnReceiver) | 615 : StubCompiler(isolate, extra_ic_state) { |
617 : LoadStubCompiler(isolate, extra_ic_state, cache_holder, | 616 registers_ = LoadStubCompiler::registers(); |
618 Code::KEYED_LOAD_IC) {} | 617 } |
619 | 618 |
620 Handle<Code> CompileLoadElement(Handle<Map> receiver_map); | 619 Handle<Code> CompileLoadElement(Handle<Map> receiver_map); |
621 | 620 |
622 void CompileElementHandlers(MapHandleList* receiver_maps, | 621 void CompileElementHandlers(MapHandleList* receiver_maps, |
623 CodeHandleList* handlers); | 622 CodeHandleList* handlers); |
624 | 623 |
625 static void GenerateLoadDictionaryElement(MacroAssembler* masm); | 624 static void GenerateLoadDictionaryElement(MacroAssembler* masm); |
626 | 625 |
| 626 Register receiver() { return registers_[0]; } |
| 627 Register name() { return registers_[1]; } |
| 628 Register scratch1() { return registers_[2]; } |
| 629 Register scratch2() { return registers_[3]; } |
| 630 Register scratch3() { return registers_[4]; } |
| 631 |
627 private: | 632 private: |
628 static Register* registers(); | 633 static Register* registers(); |
629 friend class BaseLoadStoreStubCompiler; | 634 Register* registers_; |
630 }; | 635 }; |
631 | 636 |
632 | 637 |
633 class StoreStubCompiler: public BaseLoadStoreStubCompiler { | 638 class StoreStubCompiler: public BaseLoadStoreStubCompiler { |
634 public: | 639 public: |
635 StoreStubCompiler(Isolate* isolate, | 640 StoreStubCompiler(Isolate* isolate, |
636 ExtraICState extra_ic_state, | 641 ExtraICState extra_ic_state, |
637 Code::Kind kind = Code::STORE_IC) | 642 Code::Kind kind = Code::STORE_IC) |
638 : BaseLoadStoreStubCompiler(isolate, kind, extra_ic_state) {} | 643 : BaseLoadStoreStubCompiler(isolate, kind, extra_ic_state) {} |
639 | 644 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 Handle<JSFunction> constant_function_; | 827 Handle<JSFunction> constant_function_; |
823 bool is_simple_api_call_; | 828 bool is_simple_api_call_; |
824 Handle<FunctionTemplateInfo> expected_receiver_type_; | 829 Handle<FunctionTemplateInfo> expected_receiver_type_; |
825 Handle<CallHandlerInfo> api_call_info_; | 830 Handle<CallHandlerInfo> api_call_info_; |
826 }; | 831 }; |
827 | 832 |
828 | 833 |
829 } } // namespace v8::internal | 834 } } // namespace v8::internal |
830 | 835 |
831 #endif // V8_STUB_CACHE_H_ | 836 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |