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

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

Issue 2895008: Virtually dispatched specialized scavengers. (Closed)
Patch Set: Created 10 years, 5 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
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 2042 matching lines...) Expand 10 before | Expand all | Expand 10 after
2053 return ptr[index]; 2053 return ptr[index];
2054 } 2054 }
2055 2055
2056 2056
2057 void ExternalFloatArray::set(int index, float value) { 2057 void ExternalFloatArray::set(int index, float value) {
2058 ASSERT((index >= 0) && (index < this->length())); 2058 ASSERT((index >= 0) && (index < this->length()));
2059 float* ptr = static_cast<float*>(external_pointer()); 2059 float* ptr = static_cast<float*>(external_pointer());
2060 ptr[index] = value; 2060 ptr[index] = value;
2061 } 2061 }
2062 2062
2063 inline Scavenger Map::scavenger() {
2064 Scavenger callback = reinterpret_cast<Scavenger>(
2065 READ_INTPTR_FIELD(this, kIterateBodyCallbackOffset));
2066
2067 ASSERT(callback == Heap::GetScavenger(instance_type(),
2068 instance_size()));
2069
2070 return callback;
2071 }
2072
2073 inline void Map::set_scavenger(Scavenger callback) {
2074 ASSERT(!reinterpret_cast<Object*>(
2075 reinterpret_cast<intptr_t>(callback))->IsHeapObject());
2076 WRITE_INTPTR_FIELD(this,
2077 kIterateBodyCallbackOffset,
2078 reinterpret_cast<intptr_t>(callback));
2079 }
2063 2080
2064 int Map::instance_size() { 2081 int Map::instance_size() {
2065 return READ_BYTE_FIELD(this, kInstanceSizeOffset) << kPointerSizeLog2; 2082 return READ_BYTE_FIELD(this, kInstanceSizeOffset) << kPointerSizeLog2;
2066 } 2083 }
2067 2084
2068 2085
2069 int Map::inobject_properties() { 2086 int Map::inobject_properties() {
2070 return READ_BYTE_FIELD(this, kInObjectPropertiesOffset); 2087 return READ_BYTE_FIELD(this, kInObjectPropertiesOffset);
2071 } 2088 }
2072 2089
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after
3302 #undef WRITE_INT_FIELD 3319 #undef WRITE_INT_FIELD
3303 #undef READ_SHORT_FIELD 3320 #undef READ_SHORT_FIELD
3304 #undef WRITE_SHORT_FIELD 3321 #undef WRITE_SHORT_FIELD
3305 #undef READ_BYTE_FIELD 3322 #undef READ_BYTE_FIELD
3306 #undef WRITE_BYTE_FIELD 3323 #undef WRITE_BYTE_FIELD
3307 3324
3308 3325
3309 } } // namespace v8::internal 3326 } } // namespace v8::internal
3310 3327
3311 #endif // V8_OBJECTS_INL_H_ 3328 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/heap.cc ('K') | « src/objects.cc ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698