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

Side by Side Diff: src/api.cc

Issue 104583003: [platform] Implement a worker pool (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 | « no previous file | src/default-platform.h » ('j') | src/libplatform/default-platform.h » ('J')
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 29 matching lines...) Expand all
40 #include "counters.h" 40 #include "counters.h"
41 #include "cpu-profiler.h" 41 #include "cpu-profiler.h"
42 #include "debug.h" 42 #include "debug.h"
43 #include "deoptimizer.h" 43 #include "deoptimizer.h"
44 #include "execution.h" 44 #include "execution.h"
45 #include "global-handles.h" 45 #include "global-handles.h"
46 #include "heap-profiler.h" 46 #include "heap-profiler.h"
47 #include "heap-snapshot-generator-inl.h" 47 #include "heap-snapshot-generator-inl.h"
48 #include "icu_util.h" 48 #include "icu_util.h"
49 #include "json-parser.h" 49 #include "json-parser.h"
50 #ifdef V8_USE_DEFAULT_PLATFORM
51 #include "libplatform/default-platform.h"
52 #endif
50 #include "messages.h" 53 #include "messages.h"
51 #ifdef COMPRESS_STARTUP_DATA_BZ2 54 #ifdef COMPRESS_STARTUP_DATA_BZ2
52 #include "natives.h" 55 #include "natives.h"
53 #endif 56 #endif
54 #include "parser.h" 57 #include "parser.h"
55 #include "platform.h" 58 #include "platform.h"
56 #include "platform/time.h" 59 #include "platform/time.h"
57 #include "profile-generator-inl.h" 60 #include "profile-generator-inl.h"
58 #include "property-details.h" 61 #include "property-details.h"
59 #include "property.h" 62 #include "property.h"
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 old_gen_size, 626 old_gen_size,
624 max_executable_size); 627 max_executable_size);
625 if (!result) return false; 628 if (!result) return false;
626 } 629 }
627 if (constraints->stack_limit() != NULL) { 630 if (constraints->stack_limit() != NULL) {
628 uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit()); 631 uintptr_t limit = reinterpret_cast<uintptr_t>(constraints->stack_limit());
629 isolate->stack_guard()->SetStackLimit(limit); 632 isolate->stack_guard()->SetStackLimit(limit);
630 } 633 }
631 634
632 isolate->set_max_available_threads(constraints->max_available_threads()); 635 isolate->set_max_available_threads(constraints->max_available_threads());
636
637 #ifdef V8_USE_DEFAULT_PLATFORM
638 i::DefaultPlatform::SetThreadPoolSize(constraints->max_available_threads());
639 #endif
640
633 return true; 641 return true;
634 } 642 }
635 643
636 644
637 i::Object** V8::GlobalizeReference(i::Isolate* isolate, i::Object** obj) { 645 i::Object** V8::GlobalizeReference(i::Isolate* isolate, i::Object** obj) {
638 LOG_API(isolate, "Persistent::New"); 646 LOG_API(isolate, "Persistent::New");
639 i::Handle<i::Object> result = isolate->global_handles()->Create(*obj); 647 i::Handle<i::Object> result = isolate->global_handles()->Create(*obj);
640 #ifdef DEBUG 648 #ifdef DEBUG
641 (*obj)->Verify(); 649 (*obj)->Verify();
642 #endif // DEBUG 650 #endif // DEBUG
(...skipping 7137 matching lines...) Expand 10 before | Expand all | Expand 10 after
7780 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7788 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7781 Address callback_address = 7789 Address callback_address =
7782 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7790 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7783 VMState<EXTERNAL> state(isolate); 7791 VMState<EXTERNAL> state(isolate);
7784 ExternalCallbackScope call_scope(isolate, callback_address); 7792 ExternalCallbackScope call_scope(isolate, callback_address);
7785 callback(info); 7793 callback(info);
7786 } 7794 }
7787 7795
7788 7796
7789 } } // namespace v8::internal 7797 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/default-platform.h » ('j') | src/libplatform/default-platform.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698