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

Side by Side Diff: src/heap.cc

Issue 3089005: [Isolates] Add a pointer to Heap to a meta map. (Closed)
Patch Set: review feedback Created 10 years, 4 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
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 1353
1354 Object* Heap::AllocatePartialMap(InstanceType instance_type, 1354 Object* Heap::AllocatePartialMap(InstanceType instance_type,
1355 int instance_size) { 1355 int instance_size) {
1356 Object* result = AllocateRawMap(); 1356 Object* result = AllocateRawMap();
1357 if (result->IsFailure()) return result; 1357 if (result->IsFailure()) return result;
1358 1358
1359 // Map::cast cannot be used due to uninitialized map field. 1359 // Map::cast cannot be used due to uninitialized map field.
1360 reinterpret_cast<Map*>(result)->set_map(raw_unchecked_meta_map()); 1360 reinterpret_cast<Map*>(result)->set_map(raw_unchecked_meta_map());
1361 reinterpret_cast<Map*>(result)->set_instance_type(instance_type); 1361 reinterpret_cast<Map*>(result)->set_instance_type(instance_type);
1362 reinterpret_cast<Map*>(result)->set_instance_size(instance_size); 1362 reinterpret_cast<Map*>(result)->set_instance_size(instance_size);
1363 reinterpret_cast<Map*>(result)-> 1363 if (instance_type == MAP_TYPE) {
1364 set_scavenger(GetScavenger(instance_type, instance_size)); 1364 reinterpret_cast<Map*>(result)->set_heap(this);
1365 } else {
1366 reinterpret_cast<Map*>(result)->set_scavenger(GetScavenger(instance_type,
1367 instance_size));
1368 }
1365 reinterpret_cast<Map*>(result)->set_inobject_properties(0); 1369 reinterpret_cast<Map*>(result)->set_inobject_properties(0);
1366 reinterpret_cast<Map*>(result)->set_pre_allocated_property_fields(0); 1370 reinterpret_cast<Map*>(result)->set_pre_allocated_property_fields(0);
1367 reinterpret_cast<Map*>(result)->set_unused_property_fields(0); 1371 reinterpret_cast<Map*>(result)->set_unused_property_fields(0);
1368 reinterpret_cast<Map*>(result)->set_bit_field(0); 1372 reinterpret_cast<Map*>(result)->set_bit_field(0);
1369 reinterpret_cast<Map*>(result)->set_bit_field2(0); 1373 reinterpret_cast<Map*>(result)->set_bit_field2(0);
1370 return result; 1374 return result;
1371 } 1375 }
1372 1376
1373 1377
1374 Object* Heap::AllocateMap(InstanceType instance_type, int instance_size) { 1378 Object* Heap::AllocateMap(InstanceType instance_type, int instance_size) {
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1865 Object* obj = AllocateFixedArray(number_string_cache_size * 2, TENURED); 1869 Object* obj = AllocateFixedArray(number_string_cache_size * 2, TENURED);
1866 if (!obj->IsFailure()) set_number_string_cache(FixedArray::cast(obj)); 1870 if (!obj->IsFailure()) set_number_string_cache(FixedArray::cast(obj));
1867 return obj; 1871 return obj;
1868 } 1872 }
1869 1873
1870 1874
1871 void Heap::FlushNumberStringCache() { 1875 void Heap::FlushNumberStringCache() {
1872 // Flush the number to string cache. 1876 // Flush the number to string cache.
1873 int len = number_string_cache()->length(); 1877 int len = number_string_cache()->length();
1874 for (int i = 0; i < len; i++) { 1878 for (int i = 0; i < len; i++) {
1875 number_string_cache()->set_undefined(i); 1879 number_string_cache()->set_undefined(this, i);
1876 } 1880 }
1877 } 1881 }
1878 1882
1879 1883
1880 static inline int double_get_hash(double d) { 1884 static inline int double_get_hash(double d) {
1881 DoubleRepresentation rep(d); 1885 DoubleRepresentation rep(d);
1882 return static_cast<int>(rep.bits) ^ static_cast<int>(rep.bits >> 32); 1886 return static_cast<int>(rep.bits) ^ static_cast<int>(rep.bits >> 32);
1883 } 1887 }
1884 1888
1885 1889
(...skipping 3108 matching lines...) Expand 10 before | Expand all | Expand 10 after
4994 } 4998 }
4995 4999
4996 5000
4997 void ExternalStringTable::TearDown() { 5001 void ExternalStringTable::TearDown() {
4998 new_space_strings_.Free(); 5002 new_space_strings_.Free();
4999 old_space_strings_.Free(); 5003 old_space_strings_.Free();
5000 } 5004 }
5001 5005
5002 5006
5003 } } // namespace v8::internal 5007 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698