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

Side by Side Diff: samples/shell.cc

Issue 6452006: [Isolates] Increase the isolate thread's stack size for tests. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/isolates
Patch Set: Created 9 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 } 103 }
104 } 104 }
105 105
106 #ifdef WIN32 106 #ifdef WIN32
107 void StartExecuteInThread() { ExecuteInThread(); } 107 void StartExecuteInThread() { ExecuteInThread(); }
108 void WaitForThread() {} 108 void WaitForThread() {}
109 109
110 #else 110 #else
111 void StartExecuteInThread() { 111 void StartExecuteInThread() {
112 pthread_create(&thread_, NULL, &IsolateThreadEntry, this); 112 pthread_attr_t attr;
113 // On some systems (OSX 10.6) the stack size default is 0.5Mb or less
114 // which is not enough to parse the big literal expressions used in tests.
115 // The stack size should be at least StackGuard::kLimitSize + some
116 // OS-specific padding for thread startup code.
117 size_t stacksize = 1024 * 1024; // 1 Mb seems to be enough
118 pthread_attr_init(&attr);
119 pthread_attr_setstacksize (&attr, stacksize);
120 int error = pthread_create(&thread_, &attr, &IsolateThreadEntry, this);
121 if (error) {
122 printf("Error creating isolate thread.\n");
123 exit(1);
124 }
113 } 125 }
114 126
115 void WaitForThread() { 127 void WaitForThread() {
116 if (thread_ == 0) return; 128 if (thread_ == 0) return;
117 pthread_join(thread_, NULL); 129 pthread_join(thread_, NULL);
118 thread_ = 0; 130 thread_ = 0;
119 } 131 }
120 #endif // WIN32 132 #endif // WIN32
121 133
122 private: 134 private:
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 printf("^"); 420 printf("^");
409 } 421 }
410 printf("\n"); 422 printf("\n");
411 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); 423 v8::String::Utf8Value stack_trace(try_catch->StackTrace());
412 if (stack_trace.length() > 0) { 424 if (stack_trace.length() > 0) {
413 const char* stack_trace_string = ToCString(stack_trace); 425 const char* stack_trace_string = ToCString(stack_trace);
414 printf("%s\n", stack_trace_string); 426 printf("%s\n", stack_trace_string);
415 } 427 }
416 } 428 }
417 } 429 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698