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

Side by Side Diff: src/heap.cc

Issue 6904166: Read isolate from page, not through map. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Remove Map::heap and use HeapObject::GetHeap instead. Created 9 years, 7 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 | « no previous file | src/mark-compact.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 1397
1398 template<ObjectContents object_contents, SizeRestriction size_restriction> 1398 template<ObjectContents object_contents, SizeRestriction size_restriction>
1399 static inline void EvacuateObject(Map* map, 1399 static inline void EvacuateObject(Map* map,
1400 HeapObject** slot, 1400 HeapObject** slot,
1401 HeapObject* object, 1401 HeapObject* object,
1402 int object_size) { 1402 int object_size) {
1403 ASSERT((size_restriction != SMALL) || 1403 ASSERT((size_restriction != SMALL) ||
1404 (object_size <= Page::kMaxHeapObjectSize)); 1404 (object_size <= Page::kMaxHeapObjectSize));
1405 ASSERT(object->Size() == object_size); 1405 ASSERT(object->Size() == object_size);
1406 1406
1407 Heap* heap = map->heap(); 1407 Heap* heap = map->GetHeap();
1408 if (heap->ShouldBePromoted(object->address(), object_size)) { 1408 if (heap->ShouldBePromoted(object->address(), object_size)) {
1409 MaybeObject* maybe_result; 1409 MaybeObject* maybe_result;
1410 1410
1411 if ((size_restriction != SMALL) && 1411 if ((size_restriction != SMALL) &&
1412 (object_size > Page::kMaxHeapObjectSize)) { 1412 (object_size > Page::kMaxHeapObjectSize)) {
1413 maybe_result = heap->lo_space()->AllocateRawFixedArray(object_size); 1413 maybe_result = heap->lo_space()->AllocateRawFixedArray(object_size);
1414 } else { 1414 } else {
1415 if (object_contents == DATA_OBJECT) { 1415 if (object_contents == DATA_OBJECT) {
1416 maybe_result = heap->old_data_space()->AllocateRaw(object_size); 1416 maybe_result = heap->old_data_space()->AllocateRaw(object_size);
1417 } else { 1417 } else {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 return ((type & kShortcutTypeMask) == kShortcutTypeTag); 1485 return ((type & kShortcutTypeMask) == kShortcutTypeTag);
1486 } 1486 }
1487 1487
1488 static inline void EvacuateShortcutCandidate(Map* map, 1488 static inline void EvacuateShortcutCandidate(Map* map,
1489 HeapObject** slot, 1489 HeapObject** slot,
1490 HeapObject* object) { 1490 HeapObject* object) {
1491 ASSERT(IsShortcutCandidate(map->instance_type())); 1491 ASSERT(IsShortcutCandidate(map->instance_type()));
1492 1492
1493 if (marks_handling == IGNORE_MARKS && 1493 if (marks_handling == IGNORE_MARKS &&
1494 ConsString::cast(object)->unchecked_second() == 1494 ConsString::cast(object)->unchecked_second() ==
1495 map->heap()->empty_string()) { 1495 map->GetHeap()->empty_string()) {
1496 HeapObject* first = 1496 HeapObject* first =
1497 HeapObject::cast(ConsString::cast(object)->unchecked_first()); 1497 HeapObject::cast(ConsString::cast(object)->unchecked_first());
1498 1498
1499 *slot = first; 1499 *slot = first;
1500 1500
1501 if (!map->heap()->InNewSpace(first)) { 1501 if (!map->GetHeap()->InNewSpace(first)) {
1502 object->set_map_word(MapWord::FromForwardingAddress(first)); 1502 object->set_map_word(MapWord::FromForwardingAddress(first));
1503 return; 1503 return;
1504 } 1504 }
1505 1505
1506 MapWord first_word = first->map_word(); 1506 MapWord first_word = first->map_word();
1507 if (first_word.IsForwardingAddress()) { 1507 if (first_word.IsForwardingAddress()) {
1508 HeapObject* target = first_word.ToForwardingAddress(); 1508 HeapObject* target = first_word.ToForwardingAddress();
1509 1509
1510 *slot = target; 1510 *slot = target;
1511 object->set_map_word(MapWord::FromForwardingAddress(target)); 1511 object->set_map_word(MapWord::FromForwardingAddress(target));
(...skipping 4378 matching lines...) Expand 10 before | Expand all | Expand 10 after
5890 } 5890 }
5891 5891
5892 5892
5893 void ExternalStringTable::TearDown() { 5893 void ExternalStringTable::TearDown() {
5894 new_space_strings_.Free(); 5894 new_space_strings_.Free();
5895 old_space_strings_.Free(); 5895 old_space_strings_.Free();
5896 } 5896 }
5897 5897
5898 5898
5899 } } // namespace v8::internal 5899 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698