OLD | NEW |
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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 return reinterpret_cast<Context*>(context); | 187 return reinterpret_cast<Context*>(context); |
188 } | 188 } |
189 | 189 |
190 // The default context slot layout; indices are FixedArray slot indices. | 190 // The default context slot layout; indices are FixedArray slot indices. |
191 enum { | 191 enum { |
192 // These slots are in all contexts. | 192 // These slots are in all contexts. |
193 CLOSURE_INDEX, | 193 CLOSURE_INDEX, |
194 PREVIOUS_INDEX, | 194 PREVIOUS_INDEX, |
195 // The extension slot is used for either the global object (in global | 195 // The extension slot is used for either the global object (in global |
196 // contexts), eval extension object (function contexts), subject of with | 196 // contexts), eval extension object (function contexts), subject of with |
197 // (with contexts), or the variable name (catch contexts), the serialized | 197 // (with contexts), or the variable name (catch contexts). |
198 // scope info (block contexts). | |
199 EXTENSION_INDEX, | 198 EXTENSION_INDEX, |
200 GLOBAL_INDEX, | 199 GLOBAL_INDEX, |
201 MIN_CONTEXT_SLOTS, | 200 MIN_CONTEXT_SLOTS, |
202 | 201 |
203 // This slot holds the thrown value in catch contexts. | 202 // This slot holds the thrown value in catch contexts. |
204 THROWN_OBJECT_INDEX = MIN_CONTEXT_SLOTS, | 203 THROWN_OBJECT_INDEX = MIN_CONTEXT_SLOTS, |
205 | 204 |
206 // These slots are only in global contexts. | 205 // These slots are only in global contexts. |
207 GLOBAL_PROXY_INDEX = MIN_CONTEXT_SLOTS, | 206 GLOBAL_PROXY_INDEX = MIN_CONTEXT_SLOTS, |
208 SECURITY_TOKEN_INDEX, | 207 SECURITY_TOKEN_INDEX, |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 #ifdef DEBUG | 410 #ifdef DEBUG |
412 // Bootstrapping-aware type checks. | 411 // Bootstrapping-aware type checks. |
413 static bool IsBootstrappingOrContext(Object* object); | 412 static bool IsBootstrappingOrContext(Object* object); |
414 static bool IsBootstrappingOrGlobalObject(Object* object); | 413 static bool IsBootstrappingOrGlobalObject(Object* object); |
415 #endif | 414 #endif |
416 }; | 415 }; |
417 | 416 |
418 } } // namespace v8::internal | 417 } } // namespace v8::internal |
419 | 418 |
420 #endif // V8_CONTEXTS_H_ | 419 #endif // V8_CONTEXTS_H_ |
OLD | NEW |