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 #include <errno.h> | 5 #include <errno.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <string.h> | 7 #include <string.h> |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 : module_to_directory_map(10, ModuleGlobalHash(isolate)) {} | 631 : module_to_directory_map(10, ModuleGlobalHash(isolate)) {} |
632 | 632 |
633 // Map from normalized module specifier to Module. | 633 // Map from normalized module specifier to Module. |
634 std::unordered_map<std::string, Global<Module>> specifier_to_module_map; | 634 std::unordered_map<std::string, Global<Module>> specifier_to_module_map; |
635 // Map from Module to the directory that Module was loaded from. | 635 // Map from Module to the directory that Module was loaded from. |
636 std::unordered_map<Global<Module>, std::string, ModuleGlobalHash> | 636 std::unordered_map<Global<Module>, std::string, ModuleGlobalHash> |
637 module_to_directory_map; | 637 module_to_directory_map; |
638 }; | 638 }; |
639 | 639 |
640 enum { | 640 enum { |
641 // The debugger reserves the first slot in the Context embedder data. | |
642 kDebugIdIndex = Context::kDebugIdIndex, | |
643 kModuleEmbedderDataIndex, | 641 kModuleEmbedderDataIndex, |
644 kInspectorClientIndex | 642 kInspectorClientIndex |
645 }; | 643 }; |
646 | 644 |
647 void InitializeModuleEmbedderData(Local<Context> context) { | 645 void InitializeModuleEmbedderData(Local<Context> context) { |
648 context->SetAlignedPointerInEmbedderData( | 646 context->SetAlignedPointerInEmbedderData( |
649 kModuleEmbedderDataIndex, new ModuleEmbedderData(context->GetIsolate())); | 647 kModuleEmbedderDataIndex, new ModuleEmbedderData(context->GetIsolate())); |
650 } | 648 } |
651 | 649 |
652 ModuleEmbedderData* GetModuleDataFromContext(Local<Context> context) { | 650 ModuleEmbedderData* GetModuleDataFromContext(Local<Context> context) { |
(...skipping 2398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3051 } | 3049 } |
3052 | 3050 |
3053 } // namespace v8 | 3051 } // namespace v8 |
3054 | 3052 |
3055 | 3053 |
3056 #ifndef GOOGLE3 | 3054 #ifndef GOOGLE3 |
3057 int main(int argc, char* argv[]) { | 3055 int main(int argc, char* argv[]) { |
3058 return v8::Shell::Main(argc, argv); | 3056 return v8::Shell::Main(argc, argv); |
3059 } | 3057 } |
3060 #endif | 3058 #endif |
OLD | NEW |