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

Side by Side Diff: src/heap.cc

Issue 245963007: Clean up some uses of Failures and MaybeObjects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 6 years, 8 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 | « src/execution.cc ('k') | src/ia32/macro-assembler-ia32.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 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 4513 matching lines...) Expand 10 before | Expand all | Expand 10 after
4524 4524
4525 MaybeObject* Heap::AllocateStruct(InstanceType type) { 4525 MaybeObject* Heap::AllocateStruct(InstanceType type) {
4526 Map* map; 4526 Map* map;
4527 switch (type) { 4527 switch (type) {
4528 #define MAKE_CASE(NAME, Name, name) \ 4528 #define MAKE_CASE(NAME, Name, name) \
4529 case NAME##_TYPE: map = name##_map(); break; 4529 case NAME##_TYPE: map = name##_map(); break;
4530 STRUCT_LIST(MAKE_CASE) 4530 STRUCT_LIST(MAKE_CASE)
4531 #undef MAKE_CASE 4531 #undef MAKE_CASE
4532 default: 4532 default:
4533 UNREACHABLE(); 4533 UNREACHABLE();
4534 return Failure::InternalError(); 4534 return exception();
4535 } 4535 }
4536 int size = map->instance_size(); 4536 int size = map->instance_size();
4537 AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, TENURED); 4537 AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, TENURED);
4538 Object* result; 4538 Object* result;
4539 { MaybeObject* maybe_result = Allocate(map, space); 4539 { MaybeObject* maybe_result = Allocate(map, space);
4540 if (!maybe_result->ToObject(&result)) return maybe_result; 4540 if (!maybe_result->ToObject(&result)) return maybe_result;
4541 } 4541 }
4542 Struct::cast(result)->InitializeBody(size); 4542 Struct::cast(result)->InitializeBody(size);
4543 return result; 4543 return result;
4544 } 4544 }
(...skipping 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after
6737 static_cast<int>(object_sizes_last_time_[index])); 6737 static_cast<int>(object_sizes_last_time_[index]));
6738 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6738 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6739 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6739 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6740 6740
6741 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6741 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6742 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6742 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6743 ClearObjectStats(); 6743 ClearObjectStats();
6744 } 6744 }
6745 6745
6746 } } // namespace v8::internal 6746 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/execution.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698