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

Side by Side Diff: src/isolate.cc

Issue 2900703002: [es2015] Precompute the descriptive string for symbols. (Closed)
Patch Set: Address feedback. Created 3 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
« no previous file with comments | « src/heap/heap.cc ('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 // 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 #include "src/isolate.h" 5 #include "src/isolate.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <fstream> // NOLINT(readability/streams) 9 #include <fstream> // NOLINT(readability/streams)
10 #include <sstream> 10 #include <sstream>
(...skipping 3252 matching lines...) Expand 10 before | Expand all | Expand 10 after
3263 #endif 3263 #endif
3264 3264
3265 Handle<Symbol> Isolate::SymbolFor(Heap::RootListIndex dictionary_index, 3265 Handle<Symbol> Isolate::SymbolFor(Heap::RootListIndex dictionary_index,
3266 Handle<String> name, bool private_symbol) { 3266 Handle<String> name, bool private_symbol) {
3267 Handle<String> key = factory()->InternalizeString(name); 3267 Handle<String> key = factory()->InternalizeString(name);
3268 Handle<NameDictionary> dictionary = 3268 Handle<NameDictionary> dictionary =
3269 Handle<NameDictionary>::cast(heap()->root_handle(dictionary_index)); 3269 Handle<NameDictionary>::cast(heap()->root_handle(dictionary_index));
3270 int entry = dictionary->FindEntry(key); 3270 int entry = dictionary->FindEntry(key);
3271 Handle<Symbol> symbol; 3271 Handle<Symbol> symbol;
3272 if (entry == NameDictionary::kNotFound) { 3272 if (entry == NameDictionary::kNotFound) {
3273 symbol = 3273 symbol = private_symbol ? factory()->NewPrivateSymbol(key).ToHandleChecked()
3274 private_symbol ? factory()->NewPrivateSymbol() : factory()->NewSymbol(); 3274 : factory()->NewSymbol(key).ToHandleChecked();
3275 symbol->set_name(*key);
3276 dictionary = NameDictionary::Add(dictionary, key, symbol, 3275 dictionary = NameDictionary::Add(dictionary, key, symbol,
3277 PropertyDetails::Empty(), &entry); 3276 PropertyDetails::Empty(), &entry);
3278 switch (dictionary_index) { 3277 switch (dictionary_index) {
3279 case Heap::kPublicSymbolTableRootIndex: 3278 case Heap::kPublicSymbolTableRootIndex:
3280 symbol->set_is_public(true); 3279 symbol->set_is_public(true);
3281 heap()->set_public_symbol_table(*dictionary); 3280 heap()->set_public_symbol_table(*dictionary);
3282 break; 3281 break;
3283 case Heap::kApiSymbolTableRootIndex: 3282 case Heap::kApiSymbolTableRootIndex:
3284 heap()->set_api_symbol_table(*dictionary); 3283 heap()->set_api_symbol_table(*dictionary);
3285 break; 3284 break;
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
3776 // Then check whether this scope intercepts. 3775 // Then check whether this scope intercepts.
3777 if ((flag & intercept_mask_)) { 3776 if ((flag & intercept_mask_)) {
3778 intercepted_flags_ |= flag; 3777 intercepted_flags_ |= flag;
3779 return true; 3778 return true;
3780 } 3779 }
3781 return false; 3780 return false;
3782 } 3781 }
3783 3782
3784 } // namespace internal 3783 } // namespace internal
3785 } // namespace v8 3784 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698