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

Side by Side Diff: src/heap.cc

Issue 117483002: Make cells pointing to JSObjects weak in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 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 3286 matching lines...) Expand 10 before | Expand all | Expand 10 after
3297 if (!maybe_obj->ToObject(&obj)) return false; 3297 if (!maybe_obj->ToObject(&obj)) return false;
3298 } 3298 }
3299 set_regexp_multiple_cache(FixedArray::cast(obj)); 3299 set_regexp_multiple_cache(FixedArray::cast(obj));
3300 3300
3301 // Allocate cache for external strings pointing to native source code. 3301 // Allocate cache for external strings pointing to native source code.
3302 { MaybeObject* maybe_obj = AllocateFixedArray(Natives::GetBuiltinsCount()); 3302 { MaybeObject* maybe_obj = AllocateFixedArray(Natives::GetBuiltinsCount());
3303 if (!maybe_obj->ToObject(&obj)) return false; 3303 if (!maybe_obj->ToObject(&obj)) return false;
3304 } 3304 }
3305 set_natives_source_cache(FixedArray::cast(obj)); 3305 set_natives_source_cache(FixedArray::cast(obj));
3306 3306
3307 { MaybeObject* maybe_obj = AllocateCell(undefined_value());
3308 if (!maybe_obj->ToObject(&obj)) return false;
3309 }
3310 set_undefined_cell(Cell::cast(obj));
3311
Michael Starzinger 2014/01/10 13:45:19 nit: Only one empty new-line here.
ulan 2014/01/13 11:35:06 Done.
3312
3307 // Allocate object to hold object observation state. 3313 // Allocate object to hold object observation state.
3308 { MaybeObject* maybe_obj = AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); 3314 { MaybeObject* maybe_obj = AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
3309 if (!maybe_obj->ToObject(&obj)) return false; 3315 if (!maybe_obj->ToObject(&obj)) return false;
3310 } 3316 }
3311 { MaybeObject* maybe_obj = AllocateJSObjectFromMap(Map::cast(obj)); 3317 { MaybeObject* maybe_obj = AllocateJSObjectFromMap(Map::cast(obj));
3312 if (!maybe_obj->ToObject(&obj)) return false; 3318 if (!maybe_obj->ToObject(&obj)) return false;
3313 } 3319 }
3314 set_observation_state(JSObject::cast(obj)); 3320 set_observation_state(JSObject::cast(obj));
3315 3321
3316 { MaybeObject* maybe_obj = AllocateSymbol(); 3322 { MaybeObject* maybe_obj = AllocateSymbol();
(...skipping 4618 matching lines...) Expand 10 before | Expand all | Expand 10 after
7935 static_cast<int>(object_sizes_last_time_[index])); 7941 static_cast<int>(object_sizes_last_time_[index]));
7936 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 7942 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
7937 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7943 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7938 7944
7939 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7945 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7940 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7946 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7941 ClearObjectStats(); 7947 ClearObjectStats();
7942 } 7948 }
7943 7949
7944 } } // namespace v8::internal 7950 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/lithium-codegen.cc » ('j') | src/objects-visiting-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698