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

Side by Side Diff: test/cctest/test-parsing.cc

Issue 2657943003: [parser] Skipping inner funcs: add variable names into the data for test purposes. (Closed)
Patch Set: code review (vogelheim@) Created 3 years, 10 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/parsing/preparsed-scope-data.cc ('k') | no next file » | 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 8706 matching lines...) Expand 10 before | Expand all | Expand 10 after
8717 local->mode() == CONST) { 8717 local->mode() == CONST) {
8718 ++variable_count; 8718 ++variable_count;
8719 } 8719 }
8720 } 8720 }
8721 8721
8722 CHECK_EQ(data->backing_store_[index++], variable_count); 8722 CHECK_EQ(data->backing_store_[index++], variable_count);
8723 8723
8724 for (Variable* local : scope->locals_) { 8724 for (Variable* local : scope->locals_) {
8725 if (local->mode() == VAR || local->mode() == LET || 8725 if (local->mode() == VAR || local->mode() == LET ||
8726 local->mode() == CONST) { 8726 local->mode() == CONST) {
8727 #ifdef DEBUG
8728 const AstRawString* local_name = local->raw_name();
8729 int name_length = data->backing_store_[index++];
8730 CHECK_EQ(name_length, local_name->length());
8731 for (int i = 0; i < name_length; ++i) {
8732 CHECK_EQ(data->backing_store_[index++], local_name->raw_data()[i]);
8733 }
8734 #endif
8727 CHECK_EQ(data->backing_store_[index++], local->location()); 8735 CHECK_EQ(data->backing_store_[index++], local->location());
8728 CHECK_EQ(data->backing_store_[index++], local->maybe_assigned()); 8736 CHECK_EQ(data->backing_store_[index++], local->maybe_assigned());
8729 } 8737 }
8730 } 8738 }
8731 8739
8732 for (Scope* inner = scope->inner_scope(); inner != nullptr; 8740 for (Scope* inner = scope->inner_scope(); inner != nullptr;
8733 inner = inner->sibling()) { 8741 inner = inner->sibling()) {
8734 CompareScopeToData(inner, data, index); 8742 CompareScopeToData(inner, data, index);
8735 } 8743 }
8736 } 8744 }
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
9099 eager_info.literal()->scope()->inner_scope()->inner_scope(); 9107 eager_info.literal()->scope()->inner_scope()->inner_scope();
9100 DCHECK_NOT_NULL(scope); 9108 DCHECK_NOT_NULL(scope);
9101 DCHECK_NULL(scope->sibling()); 9109 DCHECK_NULL(scope->sibling());
9102 DCHECK(scope->is_function_scope()); 9110 DCHECK(scope->is_function_scope());
9103 9111
9104 size_t index = 0; 9112 size_t index = 0;
9105 i::ScopeTestHelper::CompareScopeToData( 9113 i::ScopeTestHelper::CompareScopeToData(
9106 scope, lazy_info.preparsed_scope_data(), index); 9114 scope, lazy_info.preparsed_scope_data(), index);
9107 } 9115 }
9108 } 9116 }
OLDNEW
« no previous file with comments | « src/parsing/preparsed-scope-data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698