| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 Handle<Smi> offset(Smi::FromInt(frames[i].offset())); | 628 Handle<Smi> offset(Smi::FromInt(frames[i].offset())); |
| 629 elements->set(cursor++, *recv); | 629 elements->set(cursor++, *recv); |
| 630 elements->set(cursor++, *fun); | 630 elements->set(cursor++, *fun); |
| 631 elements->set(cursor++, *code); | 631 elements->set(cursor++, *code); |
| 632 elements->set(cursor++, *offset); | 632 elements->set(cursor++, *offset); |
| 633 } | 633 } |
| 634 } | 634 } |
| 635 } | 635 } |
| 636 Handle<JSArray> result = factory()->NewJSArrayWithElements(elements); | 636 Handle<JSArray> result = factory()->NewJSArrayWithElements(elements); |
| 637 result->set_length(Smi::FromInt(cursor)); | 637 result->set_length(Smi::FromInt(cursor)); |
| 638 heap()->error_object_list()->Add(*error_object); | |
| 639 return result; | 638 return result; |
| 640 } | 639 } |
| 641 | 640 |
| 642 | 641 |
| 643 void Isolate::CaptureAndSetDetailedStackTrace(Handle<JSObject> error_object) { | 642 void Isolate::CaptureAndSetDetailedStackTrace(Handle<JSObject> error_object) { |
| 644 if (capture_stack_trace_for_uncaught_exceptions_) { | 643 if (capture_stack_trace_for_uncaught_exceptions_) { |
| 645 // Capture stack trace for a detailed exception message. | 644 // Capture stack trace for a detailed exception message. |
| 646 Handle<String> key = factory()->hidden_stack_trace_symbol(); | 645 Handle<String> key = factory()->hidden_stack_trace_symbol(); |
| 647 Handle<JSArray> stack_trace = CaptureCurrentStackTrace( | 646 Handle<JSArray> stack_trace = CaptureCurrentStackTrace( |
| 648 stack_trace_for_uncaught_exceptions_frame_limit_, | 647 stack_trace_for_uncaught_exceptions_frame_limit_, |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 Handle<Object> error = GetProperty(js_builtins_object(), "$Error"); | 1019 Handle<Object> error = GetProperty(js_builtins_object(), "$Error"); |
| 1021 if (!error->IsJSObject()) return Failure::Exception(); | 1020 if (!error->IsJSObject()) return Failure::Exception(); |
| 1022 Handle<Object> stack_trace_limit = | 1021 Handle<Object> stack_trace_limit = |
| 1023 GetProperty(Handle<JSObject>::cast(error), "stackTraceLimit"); | 1022 GetProperty(Handle<JSObject>::cast(error), "stackTraceLimit"); |
| 1024 if (!stack_trace_limit->IsNumber()) return Failure::Exception(); | 1023 if (!stack_trace_limit->IsNumber()) return Failure::Exception(); |
| 1025 int limit = static_cast<int>(stack_trace_limit->Number()); | 1024 int limit = static_cast<int>(stack_trace_limit->Number()); |
| 1026 | 1025 |
| 1027 Handle<JSArray> stack_trace = CaptureSimpleStackTrace( | 1026 Handle<JSArray> stack_trace = CaptureSimpleStackTrace( |
| 1028 exception, factory()->undefined_value(), limit); | 1027 exception, factory()->undefined_value(), limit); |
| 1029 JSObject::SetHiddenProperty(exception, | 1028 JSObject::SetHiddenProperty(exception, |
| 1030 factory()->hidden_stack_trace_symbol(), | 1029 factory()->overflow_stack_trace_symbol(), |
| 1031 stack_trace); | 1030 stack_trace); |
| 1032 return Failure::Exception(); | 1031 return Failure::Exception(); |
| 1033 } | 1032 } |
| 1034 | 1033 |
| 1035 | 1034 |
| 1036 Failure* Isolate::TerminateExecution() { | 1035 Failure* Isolate::TerminateExecution() { |
| 1037 DoThrow(heap_.termination_exception(), NULL); | 1036 DoThrow(heap_.termination_exception(), NULL); |
| 1038 return Failure::Exception(); | 1037 return Failure::Exception(); |
| 1039 } | 1038 } |
| 1040 | 1039 |
| (...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2216 | 2215 |
| 2217 #ifdef DEBUG | 2216 #ifdef DEBUG |
| 2218 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2217 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2219 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2218 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2220 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2219 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2221 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2220 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2222 #undef ISOLATE_FIELD_OFFSET | 2221 #undef ISOLATE_FIELD_OFFSET |
| 2223 #endif | 2222 #endif |
| 2224 | 2223 |
| 2225 } } // namespace v8::internal | 2224 } } // namespace v8::internal |
| OLD | NEW |