OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #ifndef V8_SHARED | 61 #ifndef V8_SHARED |
62 #include "api.h" | 62 #include "api.h" |
63 #include "checks.h" | 63 #include "checks.h" |
64 #include "d8-debug.h" | 64 #include "d8-debug.h" |
65 #include "debug.h" | 65 #include "debug.h" |
66 #include "natives.h" | 66 #include "natives.h" |
67 #include "platform.h" | 67 #include "platform.h" |
68 #include "v8.h" | 68 #include "v8.h" |
69 #endif // V8_SHARED | 69 #endif // V8_SHARED |
70 | 70 |
71 #if !defined(_WIN32) && !defined(_WIN64) | 71 #if V8_OS_UNIX |
72 #include <unistd.h> // NOLINT | 72 #include <unistd.h> // NOLINT |
73 #endif | 73 #endif |
74 | 74 |
75 #ifndef ASSERT | 75 #ifndef ASSERT |
76 #define ASSERT(condition) assert(condition) | 76 #define ASSERT(condition) assert(condition) |
77 #endif | 77 #endif |
78 | 78 |
79 namespace v8 { | 79 namespace v8 { |
80 | 80 |
81 | 81 |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 realm_template->Set(String::New("dispose"), | 861 realm_template->Set(String::New("dispose"), |
862 FunctionTemplate::New(RealmDispose)); | 862 FunctionTemplate::New(RealmDispose)); |
863 realm_template->Set(String::New("switch"), | 863 realm_template->Set(String::New("switch"), |
864 FunctionTemplate::New(RealmSwitch)); | 864 FunctionTemplate::New(RealmSwitch)); |
865 realm_template->Set(String::New("eval"), | 865 realm_template->Set(String::New("eval"), |
866 FunctionTemplate::New(RealmEval)); | 866 FunctionTemplate::New(RealmEval)); |
867 realm_template->SetAccessor(String::New("shared"), | 867 realm_template->SetAccessor(String::New("shared"), |
868 RealmSharedGet, RealmSharedSet); | 868 RealmSharedGet, RealmSharedSet); |
869 global_template->Set(String::New("Realm"), realm_template); | 869 global_template->Set(String::New("Realm"), realm_template); |
870 | 870 |
871 #if !defined(V8_SHARED) && !defined(_WIN32) && !defined(_WIN64) | 871 #if !defined(V8_SHARED) && V8_OS_UNIX |
872 Handle<ObjectTemplate> os_templ = ObjectTemplate::New(); | 872 Handle<ObjectTemplate> os_templ = ObjectTemplate::New(); |
873 AddOSMethods(os_templ); | 873 AddOSMethods(os_templ); |
874 global_template->Set(String::New("os"), os_templ); | 874 global_template->Set(String::New("os"), os_templ); |
875 #endif // V8_SHARED | 875 #endif // V8_SHARED |
876 | 876 |
877 return global_template; | 877 return global_template; |
878 } | 878 } |
879 | 879 |
880 | 880 |
881 void Shell::Initialize(Isolate* isolate) { | 881 void Shell::Initialize(Isolate* isolate) { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 } | 1013 } |
1014 delete context_mutex_; | 1014 delete context_mutex_; |
1015 delete counters_file_; | 1015 delete counters_file_; |
1016 delete counter_map_; | 1016 delete counter_map_; |
1017 #endif // V8_SHARED | 1017 #endif // V8_SHARED |
1018 } | 1018 } |
1019 | 1019 |
1020 | 1020 |
1021 | 1021 |
1022 static FILE* FOpen(const char* path, const char* mode) { | 1022 static FILE* FOpen(const char* path, const char* mode) { |
1023 #if defined(_MSC_VER) && (defined(_WIN32) || defined(_WIN64)) | 1023 #if V8_CC_MSVC |
1024 FILE* result; | 1024 FILE* result; |
1025 if (fopen_s(&result, path, mode) == 0) { | 1025 if (fopen_s(&result, path, mode) == 0) { |
1026 return result; | 1026 return result; |
1027 } else { | 1027 } else { |
1028 return NULL; | 1028 return NULL; |
1029 } | 1029 } |
1030 #else | 1030 #else |
1031 FILE* file = fopen(path, mode); | 1031 FILE* file = fopen(path, mode); |
1032 if (file == NULL) return NULL; | 1032 if (file == NULL) return NULL; |
1033 struct stat file_stat; | 1033 struct stat file_stat; |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1647 } | 1647 } |
1648 | 1648 |
1649 } // namespace v8 | 1649 } // namespace v8 |
1650 | 1650 |
1651 | 1651 |
1652 #ifndef GOOGLE3 | 1652 #ifndef GOOGLE3 |
1653 int main(int argc, char* argv[]) { | 1653 int main(int argc, char* argv[]) { |
1654 return v8::Shell::Main(argc, argv); | 1654 return v8::Shell::Main(argc, argv); |
1655 } | 1655 } |
1656 #endif | 1656 #endif |
OLD | NEW |