Revision: 21424
Author: [email protected]
Date: Thu May 22 08:11:10 2014 UTC
Log: Remove usage of Locker/Unlocker where possible.
This is possible because we removed DebuggerAgent.
[email protected]
Review URL: https://codereview.chromium.org/286903004
http://code.google.com/p/v8/source/detail?r=21424
Modified:
/branches/bleeding_edge/samples/lineprocessor.cc
/branches/bleeding_edge/src/d8-readline.cc
/branches/bleeding_edge/src/d8.cc
=======================================
--- /branches/bleeding_edge/samples/lineprocessor.cc Wed May 14 16:28:46
2014 UTC
+++ /branches/bleeding_edge/samples/lineprocessor.cc Thu May 22 08:11:10
2014 UTC
@@ -69,25 +69,6 @@
var res = line + " | " + line;
print(res);
}
-
- *
- * When run with "-p" argument, the program starts V8 Debugger Agent and
- * allows remote debugger to attach and debug JavaScript code.
- *
- * Interesting aspects:
- * 1. Wait for remote debugger to attach
- * Normally the program compiles custom script and immediately runs it.
- * If programmer needs to debug script from the very beginning, he should
- * run this sample program with "--wait-for-connection" command line
parameter.
- * This way V8 will suspend on the first statement and wait for
- * debugger to attach.
- *
- * 2. Unresponsive V8
- * V8 Debugger Agent holds a connection with remote debugger, but it does
- * respond only when V8 is running some script. In particular, when this
program
- * is waiting for input, all requests from debugger get deferred until V8
- * is called again. See how "--callback" command-line parameter in this
sample
- * fixes this issue.
*/
enum MainCycleType {
@@ -113,7 +94,6 @@
v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
v8::Isolate* isolate = v8::Isolate::New();
v8::Isolate::Scope isolate_scope(isolate);
- v8::Locker locker(isolate);
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::String> script_source;
@@ -224,7 +204,6 @@
v8::Local<v8::Context> context,
bool report_exceptions) {
v8::Isolate* isolate = context->GetIsolate();
- v8::Locker lock(isolate);
v8::Handle<v8::String> fun_name =
v8::String::NewFromUtf8(isolate, "ProcessLine");
@@ -382,7 +361,6 @@
char* res;
{
- v8::Unlocker unlocker(v8::Isolate::GetCurrent());
res = fgets(buffer, kBufferSize, stdin);
}
v8::Isolate* isolate = v8::Isolate::GetCurrent();
=======================================
--- /branches/bleeding_edge/src/d8-readline.cc Wed May 14 16:28:46 2014 UTC
+++ /branches/bleeding_edge/src/d8-readline.cc Thu May 22 08:11:10 2014 UTC
@@ -82,10 +82,7 @@
Handle<String> ReadLineEditor::Prompt(const char* prompt) {
char* result = NULL;
- { // Release lock for blocking input.
- Unlocker unlock(isolate_);
- result = readline(prompt);
- }
+ result = readline(prompt);
if (result == NULL) return Handle<String>();
AddHistory(result);
return String::NewFromUtf8(isolate_, result);
@@ -123,7 +120,6 @@
static unsigned current_index;
static Persistent<Array> current_completions;
Isolate* isolate = read_line_editor.isolate_;
- Locker lock(isolate);
HandleScope scope(isolate);
Handle<Array> completions;
if (state == 0) {
=======================================
--- /branches/bleeding_edge/src/d8.cc Tue May 20 08:52:42 2014 UTC
+++ /branches/bleeding_edge/src/d8.cc Thu May 22 08:11:10 2014 UTC
@@ -472,10 +472,7 @@
// not been fully read into the buffer yet (does not end with '\n').
// If fgets gets an error, just give up.
char* input = NULL;
- { // Release lock for blocking input.
- Unlocker unlock(isolate);
- input = fgets(buffer, kBufferSize, stdin);
- }
+ input = fgets(buffer, kBufferSize, stdin);
if (input == NULL) return Handle<String>();
length = static_cast<int>(strlen(buffer));
if (length == 0) {
@@ -737,7 +734,6 @@
void Shell::InstallUtilityScript(Isolate* isolate) {
- Locker lock(isolate);
HandleScope scope(isolate);
// If we use the utility context, we have to set the security tokens so
that
// utility, evaluation and debug context can all access each other.
@@ -904,7 +900,6 @@
void Shell::InitializeDebugger(Isolate* isolate) {
if (options.test_shell) return;
#ifndef V8_SHARED
- Locker lock(isolate);
HandleScope scope(isolate);
Handle<ObjectTemplate> global_template = CreateGlobalTemplate(isolate);
utility_context_.Reset(isolate,
@@ -1031,8 +1026,6 @@
static char* ReadChars(Isolate* isolate, const char* name, int* size_out) {
- // Release the V8 lock while reading files.
- v8::Unlocker unlocker(isolate);
FILE* file = FOpen(name, "rb");
if (file == NULL) return NULL;
@@ -1112,7 +1105,6 @@
void Shell::RunShell(Isolate* isolate) {
- Locker locker(isolate);
HandleScope outer_scope(isolate);
v8::Local<v8::Context> context =
v8::Local<v8::Context>::New(isolate, evaluation_context_);
@@ -1204,7 +1196,6 @@
next_semaphore_.Wait();
{
Isolate::Scope iscope(isolate);
- Locker lock(isolate);
{
HandleScope scope(isolate);
PerIsolateData data(isolate);
@@ -1351,34 +1342,31 @@
options.isolate_sources[i].StartExecuteInThread();
}
#endif // !V8_SHARED
- { // NOLINT
- Locker lock(isolate);
- {
- HandleScope scope(isolate);
- Local<Context> context = CreateEvaluationContext(isolate);
- if (options.last_run) {
- // Keep using the same context in the interactive shell.
- evaluation_context_.Reset(isolate, context);
+ {
+ HandleScope scope(isolate);
+ Local<Context> context = CreateEvaluationContext(isolate);
+ if (options.last_run) {
+ // Keep using the same context in the interactive shell.
+ evaluation_context_.Reset(isolate, context);
#ifndef V8_SHARED
- // If the interactive debugger is enabled make sure to activate
- // it before running the files passed on the command line.
- if (i::FLAG_debugger) {
- InstallUtilityScript(isolate);
- }
+ // If the interactive debugger is enabled make sure to activate
+ // it before running the files passed on the command line.
+ if (i::FLAG_debugger) {
+ InstallUtilityScript(isolate);
+ }
#endif // !V8_SHARED
- }
- {
- Context::Scope cscope(context);
- PerIsolateData::RealmScope
realm_scope(PerIsolateData::Get(isolate));
- options.isolate_sources[0].Execute(isolate);
- }
+ }
+ {
+ Context::Scope cscope(context);
+ PerIsolateData::RealmScope realm_scope(PerIsolateData::Get(isolate));
+ options.isolate_sources[0].Execute(isolate);
}
- if (!options.last_run) {
- if (options.send_idle_notification) {
- const int kLongIdlePauseInMs = 1000;
- V8::ContextDisposedNotification();
- V8::IdleNotification(kLongIdlePauseInMs);
- }
+ }
+ if (!options.last_run) {
+ if (options.send_idle_notification) {
+ const int kLongIdlePauseInMs = 1000;
+ V8::ContextDisposedNotification();
+ V8::IdleNotification(kLongIdlePauseInMs);
}
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.