OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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_AST_SCOPEINFO_H_ | 5 #ifndef V8_AST_SCOPEINFO_H_ |
6 #define V8_AST_SCOPEINFO_H_ | 6 #define V8_AST_SCOPEINFO_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/modules.h" | 9 #include "src/ast/modules.h" |
10 #include "src/ast/variables.h" | 10 #include "src/ast/variables.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 }; | 101 }; |
102 | 102 |
103 Key keys_[kLength]; | 103 Key keys_[kLength]; |
104 uint32_t values_[kLength]; | 104 uint32_t values_[kLength]; |
105 | 105 |
106 friend class Isolate; | 106 friend class Isolate; |
107 DISALLOW_COPY_AND_ASSIGN(ContextSlotCache); | 107 DISALLOW_COPY_AND_ASSIGN(ContextSlotCache); |
108 }; | 108 }; |
109 | 109 |
110 | 110 |
111 | |
112 | |
113 //--------------------------------------------------------------------------- | 111 //--------------------------------------------------------------------------- |
114 // Auxiliary class used for the description of module instances. | 112 // Auxiliary class used for the description of module instances. |
115 // Used by Runtime_DeclareModules. | 113 // Used by Runtime_DeclareModules. |
116 | 114 |
117 class ModuleInfo: public FixedArray { | 115 class ModuleInfo : public FixedArray { |
118 public: | 116 public: |
119 static ModuleInfo* cast(Object* description) { | 117 static ModuleInfo* cast(Object* description) { |
120 return static_cast<ModuleInfo*>(FixedArray::cast(description)); | 118 return static_cast<ModuleInfo*>(FixedArray::cast(description)); |
121 } | 119 } |
122 | 120 |
123 static Handle<ModuleInfo> Create(Isolate* isolate, | 121 static Handle<ModuleInfo> Create(Isolate* isolate, |
124 ModuleDescriptor* descriptor, Scope* scope); | 122 ModuleDescriptor* descriptor, Scope* scope); |
125 | 123 |
126 // Index of module's context in host context. | 124 // Index of module's context in host context. |
127 int host_index() { return Smi::cast(get(HOST_OFFSET))->value(); } | 125 int host_index() { return Smi::cast(get(HOST_OFFSET))->value(); } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 void set_index(int i, int index) { | 164 void set_index(int i, int index) { |
167 set(index_offset(i), Smi::FromInt(index)); | 165 set(index_offset(i), Smi::FromInt(index)); |
168 } | 166 } |
169 }; | 167 }; |
170 | 168 |
171 | 169 |
172 } // namespace internal | 170 } // namespace internal |
173 } // namespace v8 | 171 } // namespace v8 |
174 | 172 |
175 #endif // V8_AST_SCOPEINFO_H_ | 173 #endif // V8_AST_SCOPEINFO_H_ |
OLD | NEW |