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

Side by Side Diff: src/objects-inl.h

Issue 11190050: Heavy cleanup of the external pointer API. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 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.h ('k') | src/profile-generator.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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 void holder::set_##name(bool value) { \ 127 void holder::set_##name(bool value) { \
128 set_##field(BooleanBit::set(field(), offset, value)); \ 128 set_##field(BooleanBit::set(field(), offset, value)); \
129 } 129 }
130 130
131 131
132 bool Object::IsFixedArrayBase() { 132 bool Object::IsFixedArrayBase() {
133 return IsFixedArray() || IsFixedDoubleArray(); 133 return IsFixedArray() || IsFixedDoubleArray();
134 } 134 }
135 135
136 136
137 // External objects are not extensible, so the map check is enough.
138 bool Object::IsExternal() {
139 return Object::IsHeapObject() &&
140 HeapObject::cast(this)->map() ==
141 HeapObject::cast(this)->GetHeap()->external_map();
142 }
143
144
137 bool Object::IsInstanceOf(FunctionTemplateInfo* expected) { 145 bool Object::IsInstanceOf(FunctionTemplateInfo* expected) {
138 // There is a constraint on the object; check. 146 // There is a constraint on the object; check.
139 if (!this->IsJSObject()) return false; 147 if (!this->IsJSObject()) return false;
140 // Fetch the constructor function of the object. 148 // Fetch the constructor function of the object.
141 Object* cons_obj = JSObject::cast(this)->map()->constructor(); 149 Object* cons_obj = JSObject::cast(this)->map()->constructor();
142 if (!cons_obj->IsJSFunction()) return false; 150 if (!cons_obj->IsJSFunction()) return false;
143 JSFunction* fun = JSFunction::cast(cons_obj); 151 JSFunction* fun = JSFunction::cast(cons_obj);
144 // Iterate through the chain of inheriting function templates to 152 // Iterate through the chain of inheriting function templates to
145 // see if the required one occurs. 153 // see if the required one occurs.
146 for (Object* type = fun->shared()->function_data(); 154 for (Object* type = fun->shared()->function_data();
(...skipping 5394 matching lines...) Expand 10 before | Expand all | Expand 10 after
5541 #undef WRITE_UINT32_FIELD 5549 #undef WRITE_UINT32_FIELD
5542 #undef READ_SHORT_FIELD 5550 #undef READ_SHORT_FIELD
5543 #undef WRITE_SHORT_FIELD 5551 #undef WRITE_SHORT_FIELD
5544 #undef READ_BYTE_FIELD 5552 #undef READ_BYTE_FIELD
5545 #undef WRITE_BYTE_FIELD 5553 #undef WRITE_BYTE_FIELD
5546 5554
5547 5555
5548 } } // namespace v8::internal 5556 } } // namespace v8::internal
5549 5557
5550 #endif // V8_OBJECTS_INL_H_ 5558 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/profile-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698