| 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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 544                         ContextLookupFlags flags, | 544                         ContextLookupFlags flags, | 
| 545                         int* index, | 545                         int* index, | 
| 546                         PropertyAttributes* attributes, | 546                         PropertyAttributes* attributes, | 
| 547                         BindingFlags* binding_flags); | 547                         BindingFlags* binding_flags); | 
| 548 | 548 | 
| 549   // Code generation support. | 549   // Code generation support. | 
| 550   static int SlotOffset(int index) { | 550   static int SlotOffset(int index) { | 
| 551     return kHeaderSize + index * kPointerSize - kHeapObjectTag; | 551     return kHeaderSize + index * kPointerSize - kHeapObjectTag; | 
| 552   } | 552   } | 
| 553 | 553 | 
| 554   static int FunctionMapIndex(StrictMode strict_mode, bool is_generator) { | 554   static int FunctionMapIndex(StrictMode strict_mode, bool is_generator, | 
| 555     return is_generator | 555                               bool is_concise_method) { | 
| 556       ? (strict_mode == SLOPPY | 556     if (is_generator) { | 
| 557          ? SLOPPY_GENERATOR_FUNCTION_MAP_INDEX | 557       return strict_mode == SLOPPY ? SLOPPY_GENERATOR_FUNCTION_MAP_INDEX | 
| 558          : STRICT_GENERATOR_FUNCTION_MAP_INDEX) | 558                                    : STRICT_GENERATOR_FUNCTION_MAP_INDEX; | 
| 559       : (strict_mode == SLOPPY | 559     } | 
| 560          ? SLOPPY_FUNCTION_MAP_INDEX | 560 | 
| 561          : STRICT_FUNCTION_MAP_INDEX); | 561     if (is_concise_method) { | 
|  | 562       return strict_mode == SLOPPY | 
|  | 563                  ? SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX | 
|  | 564                  : STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX; | 
|  | 565     } | 
|  | 566 | 
|  | 567     return strict_mode == SLOPPY ? SLOPPY_FUNCTION_MAP_INDEX | 
|  | 568                                  : STRICT_FUNCTION_MAP_INDEX; | 
| 562   } | 569   } | 
| 563 | 570 | 
| 564   static const int kSize = kHeaderSize + NATIVE_CONTEXT_SLOTS * kPointerSize; | 571   static const int kSize = kHeaderSize + NATIVE_CONTEXT_SLOTS * kPointerSize; | 
| 565 | 572 | 
| 566   // GC support. | 573   // GC support. | 
| 567   typedef FixedBodyDescriptor< | 574   typedef FixedBodyDescriptor< | 
| 568       kHeaderSize, kSize, kSize> ScavengeBodyDescriptor; | 575       kHeaderSize, kSize, kSize> ScavengeBodyDescriptor; | 
| 569 | 576 | 
| 570   typedef FixedBodyDescriptor< | 577   typedef FixedBodyDescriptor< | 
| 571       kHeaderSize, | 578       kHeaderSize, | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 582   static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); | 589   static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); | 
| 583 #endif | 590 #endif | 
| 584 | 591 | 
| 585   STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 592   STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 
| 586   STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 593   STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 
| 587 }; | 594 }; | 
| 588 | 595 | 
| 589 } }  // namespace v8::internal | 596 } }  // namespace v8::internal | 
| 590 | 597 | 
| 591 #endif  // V8_CONTEXTS_H_ | 598 #endif  // V8_CONTEXTS_H_ | 
| OLD | NEW | 
|---|