Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/d8.cc

Issue 2478473003: [d8] cleanly force exit in d8 on windows. (Closed)
Patch Set: . Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/d8-posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 factory->NewJSArrayWithElements(arguments_array); 1562 factory->NewJSArrayWithElements(arguments_array);
1563 context->Global() 1563 context->Global()
1564 ->Set(context, 1564 ->Set(context,
1565 String::NewFromUtf8(isolate, "arguments", NewStringType::kNormal) 1565 String::NewFromUtf8(isolate, "arguments", NewStringType::kNormal)
1566 .ToLocalChecked(), 1566 .ToLocalChecked(),
1567 Utils::ToLocal(arguments_jsarray)) 1567 Utils::ToLocal(arguments_jsarray))
1568 .FromJust(); 1568 .FromJust();
1569 return handle_scope.Escape(context); 1569 return handle_scope.Escape(context);
1570 } 1570 }
1571 1571
1572
1573 void Shell::Exit(int exit_code) {
1574 // Use _exit instead of exit to avoid races between isolate
1575 // threads and static destructors.
1576 fflush(stdout);
1577 fflush(stderr);
1578 _exit(exit_code);
1579 }
1580
1581
1582 struct CounterAndKey { 1572 struct CounterAndKey {
1583 Counter* counter; 1573 Counter* counter;
1584 const char* key; 1574 const char* key;
1585 }; 1575 };
1586 1576
1587 1577
1588 inline bool operator<(const CounterAndKey& lhs, const CounterAndKey& rhs) { 1578 inline bool operator<(const CounterAndKey& lhs, const CounterAndKey& rhs) {
1589 return strcmp(lhs.key, rhs.key) < 0; 1579 return strcmp(lhs.key, rhs.key) < 0;
1590 } 1580 }
1591 1581
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after
2956 } 2946 }
2957 2947
2958 } // namespace v8 2948 } // namespace v8
2959 2949
2960 2950
2961 #ifndef GOOGLE3 2951 #ifndef GOOGLE3
2962 int main(int argc, char* argv[]) { 2952 int main(int argc, char* argv[]) {
2963 return v8::Shell::Main(argc, argv); 2953 return v8::Shell::Main(argc, argv);
2964 } 2954 }
2965 #endif 2955 #endif
OLDNEW
« no previous file with comments | « no previous file | src/d8-posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698