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

Side by Side Diff: src/transitions-inl.h

Issue 776143005: Optimize Object.seal and Object.preventExtensions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add nonextensible and sealed as special transitions Created 6 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
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/v8natives.js » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_TRANSITIONS_INL_H_ 5 #ifndef V8_TRANSITIONS_INL_H_
6 #define V8_TRANSITIONS_INL_H_ 6 #define V8_TRANSITIONS_INL_H_
7 7
8 #include "src/transitions.h" 8 #include "src/transitions.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 return kNotFound; 150 return kNotFound;
151 } 151 }
152 return internal::Search<ALL_ENTRIES>(this, name, 0, out_insertion_index); 152 return internal::Search<ALL_ENTRIES>(this, name, 0, out_insertion_index);
153 } 153 }
154 154
155 155
156 #ifdef DEBUG 156 #ifdef DEBUG
157 bool TransitionArray::IsSpecialTransition(Name* name) { 157 bool TransitionArray::IsSpecialTransition(Name* name) {
158 if (!name->IsSymbol()) return false; 158 if (!name->IsSymbol()) return false;
159 Heap* heap = name->GetHeap(); 159 Heap* heap = name->GetHeap();
160 return name == heap->frozen_symbol() || 160 return name == heap->nonextensible_symbol() ||
161 name == heap->sealed_symbol() || name == heap->frozen_symbol() ||
161 name == heap->elements_transition_symbol() || 162 name == heap->elements_transition_symbol() ||
162 name == heap->observed_symbol(); 163 name == heap->observed_symbol();
163 } 164 }
164 #endif 165 #endif
165 166
166 167
167 int TransitionArray::CompareKeys(Name* key1, uint32_t hash1, 168 int TransitionArray::CompareKeys(Name* key1, uint32_t hash1,
168 bool is_data_property1, 169 bool is_data_property1,
169 PropertyAttributes attributes1, Name* key2, 170 PropertyAttributes attributes1, Name* key2,
170 uint32_t hash2, bool is_data_property2, 171 uint32_t hash2, bool is_data_property2,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 239
239 240
240 #undef FIELD_ADDR 241 #undef FIELD_ADDR
241 #undef WRITE_FIELD 242 #undef WRITE_FIELD
242 #undef CONDITIONAL_WRITE_BARRIER 243 #undef CONDITIONAL_WRITE_BARRIER
243 244
244 245
245 } } // namespace v8::internal 246 } } // namespace v8::internal
246 247
247 #endif // V8_TRANSITIONS_INL_H_ 248 #endif // V8_TRANSITIONS_INL_H_
OLDNEW
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698