Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Side by Side Diff: src/stub-cache.h

Issue 67613005: Move template instance check from Object to FunctionTemplateInfo::IsTemplateFor (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects-inl.h ('k') | src/stub-cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 } 1030 }
1031 1031
1032 // Returns the depth of the object having the expected type in the 1032 // Returns the depth of the object having the expected type in the
1033 // prototype chain between the two arguments. 1033 // prototype chain between the two arguments.
1034 int GetPrototypeDepthOfExpectedType(Handle<JSObject> object, 1034 int GetPrototypeDepthOfExpectedType(Handle<JSObject> object,
1035 Handle<JSObject> holder) const; 1035 Handle<JSObject> holder) const;
1036 1036
1037 bool IsCompatibleReceiver(Object* receiver) { 1037 bool IsCompatibleReceiver(Object* receiver) {
1038 ASSERT(is_simple_api_call()); 1038 ASSERT(is_simple_api_call());
1039 if (expected_receiver_type_.is_null()) return true; 1039 if (expected_receiver_type_.is_null()) return true;
1040 return receiver->IsInstanceOf(*expected_receiver_type_); 1040 return expected_receiver_type_->IsTemplateFor(receiver);
1041 } 1041 }
1042 1042
1043 private: 1043 private:
1044 void Initialize(Handle<JSFunction> function); 1044 void Initialize(Handle<JSFunction> function);
1045 1045
1046 // Determines whether the given function can be called using the 1046 // Determines whether the given function can be called using the
1047 // fast api call builtin. 1047 // fast api call builtin.
1048 void AnalyzePossibleApiFunction(Handle<JSFunction> function); 1048 void AnalyzePossibleApiFunction(Handle<JSFunction> function);
1049 1049
1050 Handle<JSFunction> constant_function_; 1050 Handle<JSFunction> constant_function_;
1051 bool is_simple_api_call_; 1051 bool is_simple_api_call_;
1052 Handle<FunctionTemplateInfo> expected_receiver_type_; 1052 Handle<FunctionTemplateInfo> expected_receiver_type_;
1053 Handle<CallHandlerInfo> api_call_info_; 1053 Handle<CallHandlerInfo> api_call_info_;
1054 }; 1054 };
1055 1055
1056 1056
1057 } } // namespace v8::internal 1057 } } // namespace v8::internal
1058 1058
1059 #endif // V8_STUB_CACHE_H_ 1059 #endif // V8_STUB_CACHE_H_
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698