| OLD | NEW |
| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // which is not enough to parse the big literal expressions used in tests. | 150 // which is not enough to parse the big literal expressions used in tests. |
| 151 // The stack size should be at least StackGuard::kLimitSize + some | 151 // The stack size should be at least StackGuard::kLimitSize + some |
| 152 // OS-specific padding for thread startup code. | 152 // OS-specific padding for thread startup code. |
| 153 options.stack_size = 2 << 20; // 2 Mb seems to be enough | 153 options.stack_size = 2 << 20; // 2 Mb seems to be enough |
| 154 return options; | 154 return options; |
| 155 } | 155 } |
| 156 | 156 |
| 157 class IsolateThread : public v8::internal::Thread { | 157 class IsolateThread : public v8::internal::Thread { |
| 158 public: | 158 public: |
| 159 explicit IsolateThread(SourceGroup* group) | 159 explicit IsolateThread(SourceGroup* group) |
| 160 : group_(group), v8::internal::Thread(NULL, GetThreadOptions()) {} | 160 : v8::internal::Thread(NULL, GetThreadOptions()), group_(group) {} |
| 161 | 161 |
| 162 virtual void Run() { | 162 virtual void Run() { |
| 163 group_->ExecuteInThread(); | 163 group_->ExecuteInThread(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 private: | 166 private: |
| 167 SourceGroup* group_; | 167 SourceGroup* group_; |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 void ExecuteInThread() { | 170 void ExecuteInThread() { |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 printf("^"); | 525 printf("^"); |
| 526 } | 526 } |
| 527 printf("\n"); | 527 printf("\n"); |
| 528 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); | 528 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); |
| 529 if (stack_trace.length() > 0) { | 529 if (stack_trace.length() > 0) { |
| 530 const char* stack_trace_string = ToCString(stack_trace); | 530 const char* stack_trace_string = ToCString(stack_trace); |
| 531 printf("%s\n", stack_trace_string); | 531 printf("%s\n", stack_trace_string); |
| 532 } | 532 } |
| 533 } | 533 } |
| 534 } | 534 } |
| OLD | NEW |