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

Side by Side Diff: src/d8.cc

Issue 25002004: make v8::Locker not use Isolate::GetCurrent() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 months 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 | Annotate | Revision Log
« no previous file with comments | « include/v8.h ('k') | src/isolate.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 // 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 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 const int kLongIdlePauseInMs = 1000; 1521 const int kLongIdlePauseInMs = 1000;
1522 V8::ContextDisposedNotification(); 1522 V8::ContextDisposedNotification();
1523 V8::IdleNotification(kLongIdlePauseInMs); 1523 V8::IdleNotification(kLongIdlePauseInMs);
1524 } 1524 }
1525 } 1525 }
1526 1526
1527 #ifndef V8_SHARED 1527 #ifndef V8_SHARED
1528 // Start preemption if threads have been created and preemption is enabled. 1528 // Start preemption if threads have been created and preemption is enabled.
1529 if (threads.length() > 0 1529 if (threads.length() > 0
1530 && options.use_preemption) { 1530 && options.use_preemption) {
1531 Locker::StartPreemption(options.preemption_interval); 1531 Locker::StartPreemption(isolate, options.preemption_interval);
1532 } 1532 }
1533 #endif // V8_SHARED 1533 #endif // V8_SHARED
1534 } 1534 }
1535 1535
1536 #ifndef V8_SHARED 1536 #ifndef V8_SHARED
1537 for (int i = 1; i < options.num_isolates; ++i) { 1537 for (int i = 1; i < options.num_isolates; ++i) {
1538 options.isolate_sources[i].WaitForThread(); 1538 options.isolate_sources[i].WaitForThread();
1539 } 1539 }
1540 1540
1541 for (int i = 0; i < threads.length(); i++) { 1541 for (int i = 0; i < threads.length(); i++) {
1542 i::Thread* thread = threads[i]; 1542 i::Thread* thread = threads[i];
1543 thread->Join(); 1543 thread->Join();
1544 delete thread; 1544 delete thread;
1545 } 1545 }
1546 1546
1547 if (threads.length() > 0 && options.use_preemption) { 1547 if (threads.length() > 0 && options.use_preemption) {
1548 Locker lock(isolate); 1548 Locker lock(isolate);
1549 Locker::StopPreemption(); 1549 Locker::StopPreemption(isolate);
1550 } 1550 }
1551 #endif // V8_SHARED 1551 #endif // V8_SHARED
1552 return 0; 1552 return 0;
1553 } 1553 }
1554 1554
1555 1555
1556 #ifdef V8_SHARED 1556 #ifdef V8_SHARED
1557 static void SetStandaloneFlagsViaCommandLine() { 1557 static void SetStandaloneFlagsViaCommandLine() {
1558 int fake_argc = 2; 1558 int fake_argc = 2;
1559 char **fake_argv = new char*[2]; 1559 char **fake_argv = new char*[2];
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1729 } 1729 }
1730 1730
1731 } // namespace v8 1731 } // namespace v8
1732 1732
1733 1733
1734 #ifndef GOOGLE3 1734 #ifndef GOOGLE3
1735 int main(int argc, char* argv[]) { 1735 int main(int argc, char* argv[]) {
1736 return v8::Shell::Main(argc, argv); 1736 return v8::Shell::Main(argc, argv);
1737 } 1737 }
1738 #endif 1738 #endif
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698