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

Side by Side Diff: src/objects.h

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/mips/full-codegen-mips.cc ('k') | src/parser.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 // 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 3173 matching lines...) Expand 10 before | Expand all | Expand 10 after
3184 #endif 3184 #endif
3185 3185
3186 // The layout of the static part of a ScopeInfo is as follows. Each entry is 3186 // The layout of the static part of a ScopeInfo is as follows. Each entry is
3187 // numeric and occupies one array slot. 3187 // numeric and occupies one array slot.
3188 // 1. A set of properties of the scope 3188 // 1. A set of properties of the scope
3189 // 2. The number of parameters. This only applies to function scopes. For 3189 // 2. The number of parameters. This only applies to function scopes. For
3190 // non-function scopes this is 0. 3190 // non-function scopes this is 0.
3191 // 3. The number of non-parameter variables allocated on the stack. 3191 // 3. The number of non-parameter variables allocated on the stack.
3192 // 4. The number of non-parameter and parameter variables allocated in the 3192 // 4. The number of non-parameter and parameter variables allocated in the
3193 // context. 3193 // context.
3194 // 5. The stack depth of the stack slots.
3194 #define FOR_EACH_NUMERIC_FIELD(V) \ 3195 #define FOR_EACH_NUMERIC_FIELD(V) \
3195 V(Flags) \ 3196 V(Flags) \
3196 V(ParameterCount) \ 3197 V(ParameterCount) \
3197 V(StackLocalCount) \ 3198 V(StackLocalCount) \
3198 V(ContextLocalCount) 3199 V(ContextLocalCount) \
3200 V(StackSlotsDepth)
3199 3201
3200 #define FIELD_ACCESSORS(name) \ 3202 #define FIELD_ACCESSORS(name) \
3201 void Set##name(int value) { \ 3203 void Set##name(int value) { \
3202 set(k##name, Smi::FromInt(value)); \ 3204 set(k##name, Smi::FromInt(value)); \
3203 } \ 3205 } \
3204 int name() { \ 3206 int name() { \
3205 if (length() > 0) { \ 3207 if (length() > 0) { \
3206 return Smi::cast(get(k##name))->value(); \ 3208 return Smi::cast(get(k##name))->value(); \
3207 } else { \ 3209 } else { \
3208 return 0; \ 3210 return 0; \
(...skipping 4750 matching lines...) Expand 10 before | Expand all | Expand 10 after
7959 } else { 7961 } else {
7960 value &= ~(1 << bit_position); 7962 value &= ~(1 << bit_position);
7961 } 7963 }
7962 return value; 7964 return value;
7963 } 7965 }
7964 }; 7966 };
7965 7967
7966 } } // namespace v8::internal 7968 } } // namespace v8::internal
7967 7969
7968 #endif // V8_OBJECTS_H_ 7970 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698