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

Side by Side Diff: src/scopeinfo.cc

Issue 7860045: Stack allocating block scoped variables. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased on tip of tree. Created 9 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 | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | src/scopes.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // Encode the flags. 79 // Encode the flags.
80 int flags = TypeField::encode(scope->type()) | 80 int flags = TypeField::encode(scope->type()) |
81 CallsEvalField::encode(scope->calls_eval()) | 81 CallsEvalField::encode(scope->calls_eval()) |
82 LanguageModeField::encode(scope->language_mode()) | 82 LanguageModeField::encode(scope->language_mode()) |
83 FunctionVariableField::encode(function_name_info) | 83 FunctionVariableField::encode(function_name_info) |
84 FunctionVariableMode::encode(function_variable_mode); 84 FunctionVariableMode::encode(function_variable_mode);
85 scope_info->SetFlags(flags); 85 scope_info->SetFlags(flags);
86 scope_info->SetParameterCount(parameter_count); 86 scope_info->SetParameterCount(parameter_count);
87 scope_info->SetStackLocalCount(stack_local_count); 87 scope_info->SetStackLocalCount(stack_local_count);
88 scope_info->SetContextLocalCount(context_local_count); 88 scope_info->SetContextLocalCount(context_local_count);
89 scope_info->SetStackSlotsDepth(scope->stack_slots_depth());
89 90
90 int index = kVariablePartIndex; 91 int index = kVariablePartIndex;
91 // Add parameters. 92 // Add parameters.
92 ASSERT(index == scope_info->ParameterEntriesIndex()); 93 ASSERT(index == scope_info->ParameterEntriesIndex());
93 for (int i = 0; i < parameter_count; ++i) { 94 for (int i = 0; i < parameter_count; ++i) {
94 scope_info->set(index++, *scope->parameter(i)->name()); 95 scope_info->set(index++, *scope->parameter(i)->name());
95 } 96 }
96 97
97 // Add stack locals' names. We are assuming that the stack locals' 98 // Add stack locals' names. We are assuming that the stack locals'
98 // slots are allocated in increasing order, so we can simply add 99 // slots are allocated in increasing order, so we can simply add
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 Context::MIN_CONTEXT_SLOTS, 500 Context::MIN_CONTEXT_SLOTS,
500 ContextLocalNameEntriesIndex(), 501 ContextLocalNameEntriesIndex(),
501 ContextLocalNameEntriesIndex() + ContextLocalCount(), 502 ContextLocalNameEntriesIndex() + ContextLocalCount(),
502 this); 503 this);
503 504
504 PrintF("}\n"); 505 PrintF("}\n");
505 } 506 }
506 #endif // DEBUG 507 #endif // DEBUG
507 508
508 } } // namespace v8::internal 509 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698