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

Side by Side Diff: src/builtins.cc

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/bootstrapper.cc ('k') | src/objects.h » ('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 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 // ----------------------------------------------------------------------------- 1097 // -----------------------------------------------------------------------------
1098 // 1098 //
1099 1099
1100 1100
1101 // Searches the hidden prototype chain of the given object for the first 1101 // Searches the hidden prototype chain of the given object for the first
1102 // object that is an instance of the given type. If no such object can 1102 // object that is an instance of the given type. If no such object can
1103 // be found then Heap::null_value() is returned. 1103 // be found then Heap::null_value() is returned.
1104 static inline Object* FindHidden(Heap* heap, 1104 static inline Object* FindHidden(Heap* heap,
1105 Object* object, 1105 Object* object,
1106 FunctionTemplateInfo* type) { 1106 FunctionTemplateInfo* type) {
1107 if (object->IsInstanceOf(type)) return object; 1107 if (type->IsTemplateFor(object)) return object;
1108 Object* proto = object->GetPrototype(heap->isolate()); 1108 Object* proto = object->GetPrototype(heap->isolate());
1109 if (proto->IsJSObject() && 1109 if (proto->IsJSObject() &&
1110 JSObject::cast(proto)->map()->is_hidden_prototype()) { 1110 JSObject::cast(proto)->map()->is_hidden_prototype()) {
1111 return FindHidden(heap, proto, type); 1111 return FindHidden(heap, proto, type);
1112 } 1112 }
1113 return heap->null_value(); 1113 return heap->null_value();
1114 } 1114 }
1115 1115
1116 1116
1117 // Returns the holder JSObject if the function can legally be called 1117 // Returns the holder JSObject if the function can legally be called
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1813 } 1813 }
1814 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 1814 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1815 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 1815 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1816 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 1816 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
1817 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 1817 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1818 #undef DEFINE_BUILTIN_ACCESSOR_C 1818 #undef DEFINE_BUILTIN_ACCESSOR_C
1819 #undef DEFINE_BUILTIN_ACCESSOR_A 1819 #undef DEFINE_BUILTIN_ACCESSOR_A
1820 1820
1821 1821
1822 } } // namespace v8::internal 1822 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698