OLD | NEW |
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 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2849 if (!maybe_obj->ToObject(&obj)) return false; | 2849 if (!maybe_obj->ToObject(&obj)) return false; |
2850 } | 2850 } |
2851 set_regexp_multiple_cache(FixedArray::cast(obj)); | 2851 set_regexp_multiple_cache(FixedArray::cast(obj)); |
2852 | 2852 |
2853 // Allocate cache for external strings pointing to native source code. | 2853 // Allocate cache for external strings pointing to native source code. |
2854 { MaybeObject* maybe_obj = AllocateFixedArray(Natives::GetBuiltinsCount()); | 2854 { MaybeObject* maybe_obj = AllocateFixedArray(Natives::GetBuiltinsCount()); |
2855 if (!maybe_obj->ToObject(&obj)) return false; | 2855 if (!maybe_obj->ToObject(&obj)) return false; |
2856 } | 2856 } |
2857 set_natives_source_cache(FixedArray::cast(obj)); | 2857 set_natives_source_cache(FixedArray::cast(obj)); |
2858 | 2858 |
| 2859 // Allocate object to hold object observation state. |
| 2860 Map* object_observation_map; |
| 2861 { MaybeObject* maybe_obj = AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
| 2862 if (!maybe_obj->To(&object_observation_map)) return false; |
| 2863 } |
| 2864 { MaybeObject* maybe_obj = AllocateJSObjectFromMap(object_observation_map); |
| 2865 if (!maybe_obj->ToObject(&obj)) return false; |
| 2866 } |
| 2867 set_object_observation_state(JSObject::cast(obj)); |
| 2868 |
2859 // Handling of script id generation is in FACTORY->NewScript. | 2869 // Handling of script id generation is in FACTORY->NewScript. |
2860 set_last_script_id(undefined_value()); | 2870 set_last_script_id(undefined_value()); |
2861 | 2871 |
2862 // Initialize keyed lookup cache. | 2872 // Initialize keyed lookup cache. |
2863 isolate_->keyed_lookup_cache()->Clear(); | 2873 isolate_->keyed_lookup_cache()->Clear(); |
2864 | 2874 |
2865 // Initialize context slot cache. | 2875 // Initialize context slot cache. |
2866 isolate_->context_slot_cache()->Clear(); | 2876 isolate_->context_slot_cache()->Clear(); |
2867 | 2877 |
2868 // Initialize descriptor cache. | 2878 // Initialize descriptor cache. |
(...skipping 4548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7417 static_cast<int>(object_sizes_last_time_[index])); | 7427 static_cast<int>(object_sizes_last_time_[index])); |
7418 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | 7428 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) |
7419 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7429 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7420 | 7430 |
7421 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7431 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7422 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7432 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7423 ClearObjectStats(); | 7433 ClearObjectStats(); |
7424 } | 7434 } |
7425 | 7435 |
7426 } } // namespace v8::internal | 7436 } } // namespace v8::internal |
OLD | NEW |