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

Side by Side Diff: src/ast/scopeinfo.cc

Issue 2452543003: Don't wrap roots in Handle just to dereference immediately. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "src/ast/context-slot-cache.h" 7 #include "src/ast/context-slot-cache.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/ast/variables.h" 9 #include "src/ast/variables.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 scope_info->SetContextLocalCount(context_local_count); 366 scope_info->SetContextLocalCount(context_local_count);
367 367
368 int index = kVariablePartIndex; 368 int index = kVariablePartIndex;
369 const int first_slot_index = 0; 369 const int first_slot_index = 0;
370 DCHECK_EQ(index, scope_info->StackLocalFirstSlotIndex()); 370 DCHECK_EQ(index, scope_info->StackLocalFirstSlotIndex());
371 scope_info->set(index++, Smi::FromInt(first_slot_index)); 371 scope_info->set(index++, Smi::FromInt(first_slot_index));
372 DCHECK_EQ(index, scope_info->StackLocalNamesIndex()); 372 DCHECK_EQ(index, scope_info->StackLocalNamesIndex());
373 373
374 // Here we add info for context-allocated "this". 374 // Here we add info for context-allocated "this".
375 DCHECK_EQ(index, scope_info->ContextLocalNamesIndex()); 375 DCHECK_EQ(index, scope_info->ContextLocalNamesIndex());
376 scope_info->set(index++, *isolate->factory()->this_string()); 376 scope_info->set(index++, isolate->heap()->this_string());
377 DCHECK_EQ(index, scope_info->ContextLocalInfosIndex()); 377 DCHECK_EQ(index, scope_info->ContextLocalInfosIndex());
378 const uint32_t value = VariableModeField::encode(CONST) | 378 const uint32_t value = VariableModeField::encode(CONST) |
379 InitFlagField::encode(kCreatedInitialized) | 379 InitFlagField::encode(kCreatedInitialized) |
380 MaybeAssignedFlagField::encode(kNotAssigned); 380 MaybeAssignedFlagField::encode(kNotAssigned);
381 scope_info->set(index++, Smi::FromInt(value)); 381 scope_info->set(index++, Smi::FromInt(value));
382 382
383 // And here we record that this scopeinfo binds a receiver. 383 // And here we record that this scopeinfo binds a receiver.
384 DCHECK_EQ(index, scope_info->ReceiverInfoIndex()); 384 DCHECK_EQ(index, scope_info->ReceiverInfoIndex());
385 const int receiver_index = Context::MIN_CONTEXT_SLOTS + 0; 385 const int receiver_index = Context::MIN_CONTEXT_SLOTS + 0;
386 scope_info->set(index++, Smi::FromInt(receiver_index)); 386 scope_info->set(index++, Smi::FromInt(receiver_index));
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 result->set(kModuleRequestsIndex, *module_requests); 899 result->set(kModuleRequestsIndex, *module_requests);
900 result->set(kSpecialExportsIndex, *special_exports); 900 result->set(kSpecialExportsIndex, *special_exports);
901 result->set(kRegularExportsIndex, *regular_exports); 901 result->set(kRegularExportsIndex, *regular_exports);
902 result->set(kNamespaceImportsIndex, *namespace_imports); 902 result->set(kNamespaceImportsIndex, *namespace_imports);
903 result->set(kRegularImportsIndex, *regular_imports); 903 result->set(kRegularImportsIndex, *regular_imports);
904 return result; 904 return result;
905 } 905 }
906 906
907 } // namespace internal 907 } // namespace internal
908 } // namespace v8 908 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698