| 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). | 197 // (with contexts), or the variable name (catch contexts), the serialized |
| 198 // scope info (block contexts). |
| 198 EXTENSION_INDEX, | 199 EXTENSION_INDEX, |
| 199 GLOBAL_INDEX, | 200 GLOBAL_INDEX, |
| 200 MIN_CONTEXT_SLOTS, | 201 MIN_CONTEXT_SLOTS, |
| 201 | 202 |
| 202 // This slot holds the thrown value in catch contexts. | 203 // This slot holds the thrown value in catch contexts. |
| 203 THROWN_OBJECT_INDEX = MIN_CONTEXT_SLOTS, | 204 THROWN_OBJECT_INDEX = MIN_CONTEXT_SLOTS, |
| 204 | 205 |
| 205 // These slots are only in global contexts. | 206 // These slots are only in global contexts. |
| 206 GLOBAL_PROXY_INDEX = MIN_CONTEXT_SLOTS, | 207 GLOBAL_PROXY_INDEX = MIN_CONTEXT_SLOTS, |
| 207 SECURITY_TOKEN_INDEX, | 208 SECURITY_TOKEN_INDEX, |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 #ifdef DEBUG | 411 #ifdef DEBUG |
| 411 // Bootstrapping-aware type checks. | 412 // Bootstrapping-aware type checks. |
| 412 static bool IsBootstrappingOrContext(Object* object); | 413 static bool IsBootstrappingOrContext(Object* object); |
| 413 static bool IsBootstrappingOrGlobalObject(Object* object); | 414 static bool IsBootstrappingOrGlobalObject(Object* object); |
| 414 #endif | 415 #endif |
| 415 }; | 416 }; |
| 416 | 417 |
| 417 } } // namespace v8::internal | 418 } } // namespace v8::internal |
| 418 | 419 |
| 419 #endif // V8_CONTEXTS_H_ | 420 #endif // V8_CONTEXTS_H_ |
| OLD | NEW |