| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // which is not enough to parse the big literal expressions used in tests. | 163 // which is not enough to parse the big literal expressions used in tests. |
| 164 // The stack size should be at least StackGuard::kLimitSize + some | 164 // The stack size should be at least StackGuard::kLimitSize + some |
| 165 // OS-specific padding for thread startup code. | 165 // OS-specific padding for thread startup code. |
| 166 options.stack_size = 2 << 20; // 2 Mb seems to be enough | 166 options.stack_size = 2 << 20; // 2 Mb seems to be enough |
| 167 return options; | 167 return options; |
| 168 } | 168 } |
| 169 | 169 |
| 170 class IsolateThread : public v8::internal::Thread { | 170 class IsolateThread : public v8::internal::Thread { |
| 171 public: | 171 public: |
| 172 explicit IsolateThread(SourceGroup* group) | 172 explicit IsolateThread(SourceGroup* group) |
| 173 : v8::internal::Thread(NULL, GetThreadOptions()), group_(group) {} | 173 : v8::internal::Thread(GetThreadOptions()), group_(group) {} |
| 174 | 174 |
| 175 virtual void Run() { | 175 virtual void Run() { |
| 176 group_->ExecuteInThread(); | 176 group_->ExecuteInThread(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 private: | 179 private: |
| 180 SourceGroup* group_; | 180 SourceGroup* group_; |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 void ExecuteInThread() { | 183 void ExecuteInThread() { |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 printf("^"); | 676 printf("^"); |
| 677 } | 677 } |
| 678 printf("\n"); | 678 printf("\n"); |
| 679 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); | 679 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); |
| 680 if (stack_trace.length() > 0) { | 680 if (stack_trace.length() > 0) { |
| 681 const char* stack_trace_string = ToCString(stack_trace); | 681 const char* stack_trace_string = ToCString(stack_trace); |
| 682 printf("%s\n", stack_trace_string); | 682 printf("%s\n", stack_trace_string); |
| 683 } | 683 } |
| 684 } | 684 } |
| 685 } | 685 } |
| OLD | NEW |