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

Side by Side Diff: src/builtins.cc

Issue 12319144: Avoid TLS accesses in Object::Lookup and Object::GetPrototype. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Simplified Object::GetPrototype a bit Created 7 years, 9 months 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/arm/stub-cache-arm.cc ('k') | src/handles.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 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 // 1215 //
1216 1216
1217 1217
1218 // Searches the hidden prototype chain of the given object for the first 1218 // Searches the hidden prototype chain of the given object for the first
1219 // object that is an instance of the given type. If no such object can 1219 // object that is an instance of the given type. If no such object can
1220 // be found then Heap::null_value() is returned. 1220 // be found then Heap::null_value() is returned.
1221 static inline Object* FindHidden(Heap* heap, 1221 static inline Object* FindHidden(Heap* heap,
1222 Object* object, 1222 Object* object,
1223 FunctionTemplateInfo* type) { 1223 FunctionTemplateInfo* type) {
1224 if (object->IsInstanceOf(type)) return object; 1224 if (object->IsInstanceOf(type)) return object;
1225 Object* proto = object->GetPrototype(); 1225 Object* proto = object->GetPrototype(heap->isolate());
1226 if (proto->IsJSObject() && 1226 if (proto->IsJSObject() &&
1227 JSObject::cast(proto)->map()->is_hidden_prototype()) { 1227 JSObject::cast(proto)->map()->is_hidden_prototype()) {
1228 return FindHidden(heap, proto, type); 1228 return FindHidden(heap, proto, type);
1229 } 1229 }
1230 return heap->null_value(); 1230 return heap->null_value();
1231 } 1231 }
1232 1232
1233 1233
1234 // Returns the holder JSObject if the function can legally be called 1234 // Returns the holder JSObject if the function can legally be called
1235 // with this receiver. Returns Heap::null_value() if the call is 1235 // with this receiver. Returns Heap::null_value() if the call is
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 return Handle<Code>(code_address); \ 1875 return Handle<Code>(code_address); \
1876 } 1876 }
1877 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 1877 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
1878 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 1878 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
1879 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 1879 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
1880 #undef DEFINE_BUILTIN_ACCESSOR_C 1880 #undef DEFINE_BUILTIN_ACCESSOR_C
1881 #undef DEFINE_BUILTIN_ACCESSOR_A 1881 #undef DEFINE_BUILTIN_ACCESSOR_A
1882 1882
1883 1883
1884 } } // namespace v8::internal 1884 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698