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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 Handle<JSObject> last, | 604 Handle<JSObject> last, |
605 Handle<Name> name); | 605 Handle<Name> name); |
606 | 606 |
607 void GenerateLoadField(Register reg, | 607 void GenerateLoadField(Register reg, |
608 Handle<JSObject> holder, | 608 Handle<JSObject> holder, |
609 PropertyIndex field, | 609 PropertyIndex field, |
610 Representation representation); | 610 Representation representation); |
611 void GenerateLoadConstant(Handle<Object> value); | 611 void GenerateLoadConstant(Handle<Object> value); |
612 void GenerateLoadCallback(Register reg, | 612 void GenerateLoadCallback(Register reg, |
613 Handle<ExecutableAccessorInfo> callback); | 613 Handle<ExecutableAccessorInfo> callback); |
614 void GenerateLoadCallback(const CallOptimization& call_optimization); | 614 void GenerateLoadCallback(const CallOptimization& call_optimization, |
| 615 Handle<Map> receiver_map); |
615 void GenerateLoadInterceptor(Register holder_reg, | 616 void GenerateLoadInterceptor(Register holder_reg, |
616 Handle<Object> object, | 617 Handle<Object> object, |
617 Handle<JSObject> holder, | 618 Handle<JSObject> holder, |
618 LookupResult* lookup, | 619 LookupResult* lookup, |
619 Handle<Name> name); | 620 Handle<Name> name); |
620 void GenerateLoadPostInterceptor(Register reg, | 621 void GenerateLoadPostInterceptor(Register reg, |
621 Handle<JSObject> interceptor_holder, | 622 Handle<JSObject> interceptor_holder, |
622 Handle<Name> name, | 623 Handle<Name> name, |
623 LookupResult* lookup); | 624 LookupResult* lookup); |
624 | 625 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 | 821 |
821 enum HolderLookup { | 822 enum HolderLookup { |
822 kHolderNotFound, | 823 kHolderNotFound, |
823 kHolderIsReceiver, | 824 kHolderIsReceiver, |
824 kHolderFound | 825 kHolderFound |
825 }; | 826 }; |
826 Handle<JSObject> LookupHolderOfExpectedType( | 827 Handle<JSObject> LookupHolderOfExpectedType( |
827 Handle<Map> receiver_map, | 828 Handle<Map> receiver_map, |
828 HolderLookup* holder_lookup) const; | 829 HolderLookup* holder_lookup) const; |
829 | 830 |
830 bool IsCompatibleReceiver(Object* receiver) { | 831 // Check if the api holder is between the receiver and the holder. |
831 ASSERT(is_simple_api_call()); | 832 bool IsCompatibleReceiver(Handle<Object> receiver, |
832 if (expected_receiver_type_.is_null()) return true; | 833 Handle<JSObject> holder) const; |
833 return expected_receiver_type_->IsTemplateFor(receiver); | |
834 } | |
835 | 834 |
836 private: | 835 private: |
837 void Initialize(Handle<JSFunction> function); | 836 void Initialize(Handle<JSFunction> function); |
838 | 837 |
839 // Determines whether the given function can be called using the | 838 // Determines whether the given function can be called using the |
840 // fast api call builtin. | 839 // fast api call builtin. |
841 void AnalyzePossibleApiFunction(Handle<JSFunction> function); | 840 void AnalyzePossibleApiFunction(Handle<JSFunction> function); |
842 | 841 |
843 Handle<JSFunction> constant_function_; | 842 Handle<JSFunction> constant_function_; |
844 bool is_simple_api_call_; | 843 bool is_simple_api_call_; |
845 Handle<FunctionTemplateInfo> expected_receiver_type_; | 844 Handle<FunctionTemplateInfo> expected_receiver_type_; |
846 Handle<CallHandlerInfo> api_call_info_; | 845 Handle<CallHandlerInfo> api_call_info_; |
847 }; | 846 }; |
848 | 847 |
849 | 848 |
850 } } // namespace v8::internal | 849 } } // namespace v8::internal |
851 | 850 |
852 #endif // V8_STUB_CACHE_H_ | 851 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |