OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_CONTEXTS_H_ | 5 #ifndef V8_CONTEXTS_H_ |
6 #define V8_CONTEXTS_H_ | 6 #define V8_CONTEXTS_H_ |
7 | 7 |
8 #include "src/heap/heap.h" | 8 #include "src/heap/heap.h" |
9 #include "src/objects.h" | 9 #include "src/objects.h" |
10 | 10 |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 // | 498 // |
499 // 2) result->IsJSObject(): | 499 // 2) result->IsJSObject(): |
500 // The binding was found as a named property in a context extension | 500 // The binding was found as a named property in a context extension |
501 // object (i.e., was introduced via eval), as a property on the subject | 501 // object (i.e., was introduced via eval), as a property on the subject |
502 // of with, or as a property of the global object. *index is -1 and | 502 // of with, or as a property of the global object. *index is -1 and |
503 // *attributes is not ABSENT. | 503 // *attributes is not ABSENT. |
504 // | 504 // |
505 // 3) result.is_null(): | 505 // 3) result.is_null(): |
506 // There was no binding found, *index is always -1 and *attributes is | 506 // There was no binding found, *index is always -1 and *attributes is |
507 // always ABSENT. | 507 // always ABSENT. |
508 Handle<Object> Lookup(Handle<String> name, | 508 Handle<Object> Lookup(Handle<String> name, ContextLookupFlags flags, |
509 ContextLookupFlags flags, | 509 int* index, PropertyAttributes* attributes, |
510 int* index, | 510 BindingFlags* binding_flags, |
511 PropertyAttributes* attributes, | 511 VariableMode* variable_mode); |
512 BindingFlags* binding_flags); | |
513 | 512 |
514 // Code generation support. | 513 // Code generation support. |
515 static int SlotOffset(int index) { | 514 static int SlotOffset(int index) { |
516 return kHeaderSize + index * kPointerSize - kHeapObjectTag; | 515 return kHeaderSize + index * kPointerSize - kHeapObjectTag; |
517 } | 516 } |
518 | 517 |
519 static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind) { | 518 static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind) { |
520 // Note: Must be kept in sync with FastNewClosureStub::Generate. | 519 // Note: Must be kept in sync with FastNewClosureStub::Generate. |
521 if (IsGeneratorFunction(kind)) { | 520 if (IsGeneratorFunction(kind)) { |
522 return is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX | 521 return is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 #endif | 566 #endif |
568 | 567 |
569 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 568 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
570 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 569 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
571 }; | 570 }; |
572 | 571 |
573 } // namespace internal | 572 } // namespace internal |
574 } // namespace v8 | 573 } // namespace v8 |
575 | 574 |
576 #endif // V8_CONTEXTS_H_ | 575 #endif // V8_CONTEXTS_H_ |
OLD | NEW |