Chromium Code Reviews| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 SourceGroup() : | 88 SourceGroup() : |
| 89 #if !(defined(USING_V8_SHARED) || defined(V8_SHARED)) | 89 #if !(defined(USING_V8_SHARED) || defined(V8_SHARED)) |
| 90 next_semaphore_(v8::internal::OS::CreateSemaphore(0)), | 90 next_semaphore_(v8::internal::OS::CreateSemaphore(0)), |
| 91 done_semaphore_(v8::internal::OS::CreateSemaphore(0)), | 91 done_semaphore_(v8::internal::OS::CreateSemaphore(0)), |
| 92 thread_(NULL), | 92 thread_(NULL), |
| 93 #endif // USING_V8_SHARED | 93 #endif // USING_V8_SHARED |
| 94 argv_(NULL), | 94 argv_(NULL), |
| 95 begin_offset_(0), | 95 begin_offset_(0), |
| 96 end_offset_(0) { } | 96 end_offset_(0) { } |
| 97 | 97 |
| 98 #if !(defined(USING_V8_SHARED) || defined(V8_SHARED)) | |
|
Yang
2011/07/14 09:36:27
Those semaphores are not defined when USING_V8_SHA
| |
| 98 ~SourceGroup() { | 99 ~SourceGroup() { |
| 99 delete next_semaphore_; | 100 delete next_semaphore_; |
| 100 delete done_semaphore_; | 101 delete done_semaphore_; |
| 101 } | 102 } |
| 103 #endif // USING_V8_SHARED | |
| 102 | 104 |
| 103 void Begin(char** argv, int offset) { | 105 void Begin(char** argv, int offset) { |
| 104 argv_ = const_cast<const char**>(argv); | 106 argv_ = const_cast<const char**>(argv); |
| 105 begin_offset_ = offset; | 107 begin_offset_ = offset; |
| 106 } | 108 } |
| 107 | 109 |
| 108 void End(int offset) { end_offset_ = offset; } | 110 void End(int offset) { end_offset_ = offset; } |
| 109 | 111 |
| 110 void Execute() { | 112 void Execute() { |
| 111 for (int i = begin_offset_; i < end_offset_; ++i) { | 113 for (int i = begin_offset_; i < end_offset_; ++i) { |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 709 printf("^"); | 711 printf("^"); |
| 710 } | 712 } |
| 711 printf("\n"); | 713 printf("\n"); |
| 712 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); | 714 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); |
| 713 if (stack_trace.length() > 0) { | 715 if (stack_trace.length() > 0) { |
| 714 const char* stack_trace_string = ToCString(stack_trace); | 716 const char* stack_trace_string = ToCString(stack_trace); |
| 715 printf("%s\n", stack_trace_string); | 717 printf("%s\n", stack_trace_string); |
| 716 } | 718 } |
| 717 } | 719 } |
| 718 } | 720 } |
| OLD | NEW |