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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 237 |
238 // Lookup a variable `name` in a ScriptContextTable. | 238 // Lookup a variable `name` in a ScriptContextTable. |
239 // If it returns true, the variable is found and `result` contains | 239 // If it returns true, the variable is found and `result` contains |
240 // valid information about its location. | 240 // valid information about its location. |
241 // If it returns false, `result` is untouched. | 241 // If it returns false, `result` is untouched. |
242 MUST_USE_RESULT | 242 MUST_USE_RESULT |
243 static bool Lookup(Handle<ScriptContextTable> table, Handle<String> name, | 243 static bool Lookup(Handle<ScriptContextTable> table, Handle<String> name, |
244 LookupResult* result); | 244 LookupResult* result); |
245 | 245 |
246 MUST_USE_RESULT | 246 MUST_USE_RESULT |
247 static bool LookupLexical(Handle<ScriptContextTable> table, | |
248 Handle<String> name); | |
249 | |
250 MUST_USE_RESULT | |
251 static Handle<ScriptContextTable> Extend(Handle<ScriptContextTable> table, | 247 static Handle<ScriptContextTable> Extend(Handle<ScriptContextTable> table, |
252 Handle<Context> script_context); | 248 Handle<Context> script_context); |
253 | 249 |
254 static int GetContextOffset(int context_index) { | 250 static int GetContextOffset(int context_index) { |
255 return kFirstContextOffset + context_index * kPointerSize; | 251 return kFirstContextOffset + context_index * kPointerSize; |
256 } | 252 } |
257 | 253 |
258 private: | 254 private: |
259 static const int kUsedSlot = 0; | 255 static const int kUsedSlot = 0; |
260 static const int kFirstContextOffset = | 256 static const int kFirstContextOffset = |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); | 669 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); |
674 #endif | 670 #endif |
675 | 671 |
676 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 672 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
677 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 673 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
678 }; | 674 }; |
679 | 675 |
680 } } // namespace v8::internal | 676 } } // namespace v8::internal |
681 | 677 |
682 #endif // V8_CONTEXTS_H_ | 678 #endif // V8_CONTEXTS_H_ |
OLD | NEW |