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

Side by Side Diff: src/serialize.cc

Issue 8700: As discussed on the phone, I'd like your thoughts on the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 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
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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 3, 586 3,
587 "StackGuard::address_of_limit()"); 587 "StackGuard::address_of_limit()");
588 Add(ExternalReference::debug_break().address(), 588 Add(ExternalReference::debug_break().address(),
589 UNCLASSIFIED, 589 UNCLASSIFIED,
590 4, 590 4,
591 "Debug::Break()"); 591 "Debug::Break()");
592 Add(ExternalReference::new_space_start().address(), 592 Add(ExternalReference::new_space_start().address(),
593 UNCLASSIFIED, 593 UNCLASSIFIED,
594 5, 594 5,
595 "Heap::NewSpaceStart()"); 595 "Heap::NewSpaceStart()");
596 Add(ExternalReference::heap_always_allocate_scope_depth().address(),
597 UNCLASSIFIED,
598 6,
599 "Heap::always_allocate_scope_depth()");
596 Add(ExternalReference::new_space_allocation_limit_address().address(), 600 Add(ExternalReference::new_space_allocation_limit_address().address(),
597 UNCLASSIFIED, 601 UNCLASSIFIED,
598 6, 602 7,
599 "Heap::NewSpaceAllocationLimitAddress()"); 603 "Heap::NewSpaceAllocationLimitAddress()");
600 Add(ExternalReference::new_space_allocation_top_address().address(), 604 Add(ExternalReference::new_space_allocation_top_address().address(),
601 UNCLASSIFIED, 605 UNCLASSIFIED,
602 7, 606 8,
603 "Heap::NewSpaceAllocationTopAddress()"); 607 "Heap::NewSpaceAllocationTopAddress()");
604 Add(ExternalReference::debug_step_in_fp_address().address(), 608 Add(ExternalReference::debug_step_in_fp_address().address(),
605 UNCLASSIFIED, 609 UNCLASSIFIED,
606 8, 610 9,
607 "Debug::step_in_fp_addr()"); 611 "Debug::step_in_fp_addr()");
608 } 612 }
609 613
610 614
611 ExternalReferenceEncoder::ExternalReferenceEncoder() 615 ExternalReferenceEncoder::ExternalReferenceEncoder()
612 : encodings_(Match) { 616 : encodings_(Match) {
613 ExternalReferenceTable* external_references = 617 ExternalReferenceTable* external_references =
614 ExternalReferenceTable::instance(); 618 ExternalReferenceTable::instance();
615 for (int i = 0; i < external_references->size(); ++i) { 619 for (int i = 0; i < external_references->size(); ++i) {
616 Put(external_references->address(i), i); 620 Put(external_references->address(i), i);
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 Address a = GetEncodedAddress(); 1398 Address a = GetEncodedAddress();
1395 1399
1396 // Get a raw object of the right size in the right space. 1400 // Get a raw object of the right size in the right space.
1397 AllocationSpace space = GetSpace(a); 1401 AllocationSpace space = GetSpace(a);
1398 Object* o; 1402 Object* o;
1399 if (IsLargeExecutableObject(a)) { 1403 if (IsLargeExecutableObject(a)) {
1400 o = Heap::lo_space()->AllocateRawCode(size); 1404 o = Heap::lo_space()->AllocateRawCode(size);
1401 } else if (IsLargeFixedArray(a)) { 1405 } else if (IsLargeFixedArray(a)) {
1402 o = Heap::lo_space()->AllocateRawFixedArray(size); 1406 o = Heap::lo_space()->AllocateRawFixedArray(size);
1403 } else { 1407 } else {
1404 o = Heap::AllocateRaw(size, space); 1408 AllocationSpace retry_space = (space == NEW_SPACE)
1409 ? Heap::TargetSpaceId(type)
1410 : space;
1411 o = Heap::AllocateRaw(size, space, retry_space);
1405 } 1412 }
1406 ASSERT(!o->IsFailure()); 1413 ASSERT(!o->IsFailure());
1407 // Check that the simulation of heap allocation was correct. 1414 // Check that the simulation of heap allocation was correct.
1408 ASSERT(o == Resolve(a)); 1415 ASSERT(o == Resolve(a));
1409 1416
1410 // Read any recursively embedded objects. 1417 // Read any recursively embedded objects.
1411 int c = reader_.GetC(); 1418 int c = reader_.GetC();
1412 while (c == '[') { 1419 while (c == '[') {
1413 GetObject(); 1420 GetObject();
1414 c = reader_.GetC(); 1421 c = reader_.GetC();
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 ASSERT(index < large_objects_.length()); 1514 ASSERT(index < large_objects_.length());
1508 } 1515 }
1509 return large_objects_[index]; // s.page_offset() is ignored. 1516 return large_objects_[index]; // s.page_offset() is ignored.
1510 } 1517 }
1511 UNREACHABLE(); 1518 UNREACHABLE();
1512 return NULL; 1519 return NULL;
1513 } 1520 }
1514 1521
1515 1522
1516 } } // namespace v8::internal 1523 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698