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

Side by Side Diff: src/heap.cc

Issue 14888005: Make Object.freeze fast (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Handle review comments Created 7 years, 7 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/heap.h ('k') | src/objects.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 2946 matching lines...) Expand 10 before | Expand all | Expand 10 after
2957 2957
2958 // Allocate object to hold object observation state. 2958 // Allocate object to hold object observation state.
2959 { MaybeObject* maybe_obj = AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); 2959 { MaybeObject* maybe_obj = AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
2960 if (!maybe_obj->ToObject(&obj)) return false; 2960 if (!maybe_obj->ToObject(&obj)) return false;
2961 } 2961 }
2962 { MaybeObject* maybe_obj = AllocateJSObjectFromMap(Map::cast(obj)); 2962 { MaybeObject* maybe_obj = AllocateJSObjectFromMap(Map::cast(obj));
2963 if (!maybe_obj->ToObject(&obj)) return false; 2963 if (!maybe_obj->ToObject(&obj)) return false;
2964 } 2964 }
2965 set_observation_state(JSObject::cast(obj)); 2965 set_observation_state(JSObject::cast(obj));
2966 2966
2967 { MaybeObject* maybe_obj = AllocateSymbol();
2968 if (!maybe_obj->ToObject(&obj)) return false;
2969 }
2970 set_frozen_symbol(Symbol::cast(obj));
2971
2972 { MaybeObject* maybe_obj = SeededNumberDictionary::Allocate(this, 0, TENURED);
2973 if (!maybe_obj->ToObject(&obj)) return false;
2974 }
2975 SeededNumberDictionary::cast(obj)->set_requires_slow_elements();
2976 set_empty_slow_element_dictionary(SeededNumberDictionary::cast(obj));
2977
2967 // Handling of script id generation is in FACTORY->NewScript. 2978 // Handling of script id generation is in FACTORY->NewScript.
2968 set_last_script_id(undefined_value()); 2979 set_last_script_id(undefined_value());
2969 2980
2970 // Initialize keyed lookup cache. 2981 // Initialize keyed lookup cache.
2971 isolate_->keyed_lookup_cache()->Clear(); 2982 isolate_->keyed_lookup_cache()->Clear();
2972 2983
2973 // Initialize context slot cache. 2984 // Initialize context slot cache.
2974 isolate_->context_slot_cache()->Clear(); 2985 isolate_->context_slot_cache()->Clear();
2975 2986
2976 // Initialize descriptor cache. 2987 // Initialize descriptor cache.
(...skipping 4969 matching lines...) Expand 10 before | Expand all | Expand 10 after
7946 if (FLAG_parallel_recompilation) { 7957 if (FLAG_parallel_recompilation) {
7947 heap_->relocation_mutex_->Lock(); 7958 heap_->relocation_mutex_->Lock();
7948 #ifdef DEBUG 7959 #ifdef DEBUG
7949 heap_->relocation_mutex_locked_by_optimizer_thread_ = 7960 heap_->relocation_mutex_locked_by_optimizer_thread_ =
7950 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 7961 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
7951 #endif // DEBUG 7962 #endif // DEBUG
7952 } 7963 }
7953 } 7964 }
7954 7965
7955 } } // namespace v8::internal 7966 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698