OLD | NEW |
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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 ASSERT(IsGlobalContext()); \ | 390 ASSERT(IsGlobalContext()); \ |
391 set(index, value); \ | 391 set(index, value); \ |
392 } \ | 392 } \ |
393 type* name() { \ | 393 type* name() { \ |
394 ASSERT(IsGlobalContext()); \ | 394 ASSERT(IsGlobalContext()); \ |
395 return type::cast(get(index)); \ | 395 return type::cast(get(index)); \ |
396 } | 396 } |
397 GLOBAL_CONTEXT_FIELDS(GLOBAL_CONTEXT_FIELD_ACCESSORS) | 397 GLOBAL_CONTEXT_FIELDS(GLOBAL_CONTEXT_FIELD_ACCESSORS) |
398 #undef GLOBAL_CONTEXT_FIELD_ACCESSORS | 398 #undef GLOBAL_CONTEXT_FIELD_ACCESSORS |
399 | 399 |
400 // Lookup the the slot called name, starting with the current context. | 400 // Lookup the slot called name, starting with the current context. |
401 // There are three possibilities: | 401 // There are three possibilities: |
402 // | 402 // |
403 // 1) result->IsContext(): | 403 // 1) result->IsContext(): |
404 // The binding was found in a context. *index is always the | 404 // The binding was found in a context. *index is always the |
405 // non-negative slot index. *attributes is NONE for var and let | 405 // non-negative slot index. *attributes is NONE for var and let |
406 // declarations, READ_ONLY for const declarations (never ABSENT). | 406 // declarations, READ_ONLY for const declarations (never ABSENT). |
407 // | 407 // |
408 // 2) result->IsJSObject(): | 408 // 2) result->IsJSObject(): |
409 // The binding was found as a named property in a context extension | 409 // The binding was found as a named property in a context extension |
410 // object (i.e., was introduced via eval), as a property on the subject | 410 // object (i.e., was introduced via eval), as a property on the subject |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 #ifdef DEBUG | 443 #ifdef DEBUG |
444 // Bootstrapping-aware type checks. | 444 // Bootstrapping-aware type checks. |
445 static bool IsBootstrappingOrContext(Object* object); | 445 static bool IsBootstrappingOrContext(Object* object); |
446 static bool IsBootstrappingOrGlobalObject(Object* object); | 446 static bool IsBootstrappingOrGlobalObject(Object* object); |
447 #endif | 447 #endif |
448 }; | 448 }; |
449 | 449 |
450 } } // namespace v8::internal | 450 } } // namespace v8::internal |
451 | 451 |
452 #endif // V8_CONTEXTS_H_ | 452 #endif // V8_CONTEXTS_H_ |
OLD | NEW |