| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #include <fstream> // NOLINT(readability/streams) | 7 #include <fstream> // NOLINT(readability/streams) |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/v8.h" | 10 #include "src/v8.h" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 incomplete_message_->OutputToStdOut(); | 273 incomplete_message_->OutputToStdOut(); |
| 274 return factory()->empty_string(); | 274 return factory()->empty_string(); |
| 275 } else { | 275 } else { |
| 276 base::OS::Abort(); | 276 base::OS::Abort(); |
| 277 // Unreachable | 277 // Unreachable |
| 278 return factory()->empty_string(); | 278 return factory()->empty_string(); |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 | 281 |
| 282 | 282 |
| 283 void Isolate::PushStackTraceAndDie(unsigned int magic, | 283 void Isolate::PushStackTraceAndDie(unsigned int magic, void* ptr1, void* ptr2, |
| 284 Object* object, | |
| 285 Map* map, | |
| 286 unsigned int magic2) { | 284 unsigned int magic2) { |
| 287 const int kMaxStackTraceSize = 32 * KB; | 285 const int kMaxStackTraceSize = 32 * KB; |
| 288 Handle<String> trace = StackTraceString(); | 286 Handle<String> trace = StackTraceString(); |
| 289 uint8_t buffer[kMaxStackTraceSize]; | 287 uint8_t buffer[kMaxStackTraceSize]; |
| 290 int length = Min(kMaxStackTraceSize - 1, trace->length()); | 288 int length = Min(kMaxStackTraceSize - 1, trace->length()); |
| 291 String::WriteToFlat(*trace, buffer, 0, length); | 289 String::WriteToFlat(*trace, buffer, 0, length); |
| 292 buffer[length] = '\0'; | 290 buffer[length] = '\0'; |
| 293 // TODO(dcarney): convert buffer to utf8? | 291 // TODO(dcarney): convert buffer to utf8? |
| 294 base::OS::PrintError("Stacktrace (%x-%x) %p %p: %s\n", magic, magic2, | 292 base::OS::PrintError("Stacktrace (%x-%x) %p %p: %s\n", magic, magic2, ptr1, |
| 295 static_cast<void*>(object), static_cast<void*>(map), | 293 ptr2, reinterpret_cast<char*>(buffer)); |
| 296 reinterpret_cast<char*>(buffer)); | |
| 297 base::OS::Abort(); | 294 base::OS::Abort(); |
| 298 } | 295 } |
| 299 | 296 |
| 300 | 297 |
| 301 // Determines whether the given stack frame should be displayed in | 298 // Determines whether the given stack frame should be displayed in |
| 302 // a stack trace. The caller is the error constructor that asked | 299 // a stack trace. The caller is the error constructor that asked |
| 303 // for the stack trace to be collected. The first time a construct | 300 // for the stack trace to be collected. The first time a construct |
| 304 // call to this function is encountered it is skipped. The seen_caller | 301 // call to this function is encountered it is skipped. The seen_caller |
| 305 // in/out parameter is used to remember if the caller has been seen | 302 // in/out parameter is used to remember if the caller has been seen |
| 306 // yet. | 303 // yet. |
| (...skipping 2474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2781 if (prev_ && prev_->Intercept(flag)) return true; | 2778 if (prev_ && prev_->Intercept(flag)) return true; |
| 2782 // Then check whether this scope intercepts. | 2779 // Then check whether this scope intercepts. |
| 2783 if ((flag & intercept_mask_)) { | 2780 if ((flag & intercept_mask_)) { |
| 2784 intercepted_flags_ |= flag; | 2781 intercepted_flags_ |= flag; |
| 2785 return true; | 2782 return true; |
| 2786 } | 2783 } |
| 2787 return false; | 2784 return false; |
| 2788 } | 2785 } |
| 2789 | 2786 |
| 2790 } } // namespace v8::internal | 2787 } } // namespace v8::internal |
| OLD | NEW |