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

Side by Side Diff: src/heap.cc

Issue 11274014: Store Object.observe state per-isolate rather than per-context (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 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 2796 matching lines...) Expand 10 before | Expand all | Expand 10 after
2807 if (!maybe_obj->ToObject(&obj)) return false; 2807 if (!maybe_obj->ToObject(&obj)) return false;
2808 } 2808 }
2809 set_regexp_multiple_cache(FixedArray::cast(obj)); 2809 set_regexp_multiple_cache(FixedArray::cast(obj));
2810 2810
2811 // Allocate cache for external strings pointing to native source code. 2811 // Allocate cache for external strings pointing to native source code.
2812 { MaybeObject* maybe_obj = AllocateFixedArray(Natives::GetBuiltinsCount()); 2812 { MaybeObject* maybe_obj = AllocateFixedArray(Natives::GetBuiltinsCount());
2813 if (!maybe_obj->ToObject(&obj)) return false; 2813 if (!maybe_obj->ToObject(&obj)) return false;
2814 } 2814 }
2815 set_natives_source_cache(FixedArray::cast(obj)); 2815 set_natives_source_cache(FixedArray::cast(obj));
2816 2816
2817 // Allocate object to hold object observation state.
2818 Map* object_observation_map;
2819 { MaybeObject* maybe_obj = AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
2820 if (!maybe_obj->To(&object_observation_map)) return false;
2821 }
2822 { MaybeObject* maybe_obj = AllocateJSObjectFromMap(object_observation_map);
2823 if (!maybe_obj->ToObject(&obj)) return false;
2824 }
2825 set_object_observation_state(JSObject::cast(obj));
2826
2817 // Handling of script id generation is in FACTORY->NewScript. 2827 // Handling of script id generation is in FACTORY->NewScript.
2818 set_last_script_id(undefined_value()); 2828 set_last_script_id(undefined_value());
2819 2829
2820 // Initialize keyed lookup cache. 2830 // Initialize keyed lookup cache.
2821 isolate_->keyed_lookup_cache()->Clear(); 2831 isolate_->keyed_lookup_cache()->Clear();
2822 2832
2823 // Initialize context slot cache. 2833 // Initialize context slot cache.
2824 isolate_->context_slot_cache()->Clear(); 2834 isolate_->context_slot_cache()->Clear();
2825 2835
2826 // Initialize descriptor cache. 2836 // Initialize descriptor cache.
(...skipping 4533 matching lines...) Expand 10 before | Expand all | Expand 10 after
7360 static_cast<int>(object_sizes_last_time_[index])); 7370 static_cast<int>(object_sizes_last_time_[index]));
7361 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7371 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7362 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7372 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7363 7373
7364 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7374 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7365 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7375 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7366 ClearObjectStats(); 7376 ClearObjectStats();
7367 } 7377 }
7368 7378
7369 } } // namespace v8::internal 7379 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/object-observe.js » ('j') | src/object-observe.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698