| 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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 Handle<Object> fun_name(fun->shared()->name(), this); | 811 Handle<Object> fun_name(fun->shared()->name(), this); |
| 812 if (!fun_name->BooleanValue()) { | 812 if (!fun_name->BooleanValue()) { |
| 813 fun_name = Handle<Object>(fun->shared()->inferred_name(), this); | 813 fun_name = Handle<Object>(fun->shared()->inferred_name(), this); |
| 814 } | 814 } |
| 815 CHECK_NOT_EMPTY_HANDLE(this, | 815 CHECK_NOT_EMPTY_HANDLE(this, |
| 816 JSObject::SetLocalPropertyIgnoreAttributes( | 816 JSObject::SetLocalPropertyIgnoreAttributes( |
| 817 stack_frame, function_key, fun_name, NONE)); | 817 stack_frame, function_key, fun_name, NONE)); |
| 818 } | 818 } |
| 819 | 819 |
| 820 if (options & StackTrace::kIsEval) { | 820 if (options & StackTrace::kIsEval) { |
| 821 int type = Smi::cast(script->compilation_type())->value(); | 821 Handle<Object> is_eval = |
| 822 Handle<Object> is_eval = (type == Script::COMPILATION_TYPE_EVAL) ? | 822 script->compilation_type() == Script::COMPILATION_TYPE_EVAL ? |
| 823 factory()->true_value() : factory()->false_value(); | 823 factory()->true_value() : factory()->false_value(); |
| 824 CHECK_NOT_EMPTY_HANDLE(this, | 824 CHECK_NOT_EMPTY_HANDLE(this, |
| 825 JSObject::SetLocalPropertyIgnoreAttributes( | 825 JSObject::SetLocalPropertyIgnoreAttributes( |
| 826 stack_frame, eval_key, is_eval, NONE)); | 826 stack_frame, eval_key, is_eval, NONE)); |
| 827 } | 827 } |
| 828 | 828 |
| 829 if (options & StackTrace::kIsConstructor) { | 829 if (options & StackTrace::kIsConstructor) { |
| 830 Handle<Object> is_constructor = (frames[i].is_constructor()) ? | 830 Handle<Object> is_constructor = (frames[i].is_constructor()) ? |
| 831 factory()->true_value() : factory()->false_value(); | 831 factory()->true_value() : factory()->false_value(); |
| 832 CHECK_NOT_EMPTY_HANDLE(this, | 832 CHECK_NOT_EMPTY_HANDLE(this, |
| 833 JSObject::SetLocalPropertyIgnoreAttributes( | 833 JSObject::SetLocalPropertyIgnoreAttributes( |
| 834 stack_frame, constructor_key, | 834 stack_frame, constructor_key, |
| 835 is_constructor, NONE)); | 835 is_constructor, NONE)); |
| 836 } | 836 } |
| 837 | 837 |
| 838 FixedArray::cast(stack_trace->elements())->set(frames_seen, *stack_frame); | 838 FixedArray::cast(stack_trace->elements())->set(frames_seen, *stack_frame); |
| 839 frames_seen++; | 839 frames_seen++; |
| 840 } | 840 } |
| 841 it.Advance(); | 841 it.Advance(); |
| 842 } | 842 } |
| 843 | 843 |
| 844 stack_trace->set_length(Smi::FromInt(frames_seen)); | 844 stack_trace->set_length(Smi::FromInt(frames_seen)); |
| 845 return stack_trace; | 845 return stack_trace; |
| 846 } | 846 } |
| 847 | 847 |
| 848 | 848 |
| 849 void Isolate::PrintStack() { |
| 850 PrintStack(stdout); |
| 851 } |
| 852 |
| 853 |
| 849 void Isolate::PrintStack(FILE* out) { | 854 void Isolate::PrintStack(FILE* out) { |
| 850 if (stack_trace_nesting_level_ == 0) { | 855 if (stack_trace_nesting_level_ == 0) { |
| 851 stack_trace_nesting_level_++; | 856 stack_trace_nesting_level_++; |
| 852 | 857 |
| 853 StringAllocator* allocator; | 858 StringAllocator* allocator; |
| 854 if (preallocated_message_space_ == NULL) { | 859 if (preallocated_message_space_ == NULL) { |
| 855 allocator = new HeapStringAllocator(); | 860 allocator = new HeapStringAllocator(); |
| 856 } else { | 861 } else { |
| 857 allocator = preallocated_message_space_; | 862 allocator = preallocated_message_space_; |
| 858 } | 863 } |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1774 write_iterator_(NULL), | 1779 write_iterator_(NULL), |
| 1775 global_handles_(NULL), | 1780 global_handles_(NULL), |
| 1776 context_switcher_(NULL), | 1781 context_switcher_(NULL), |
| 1777 thread_manager_(NULL), | 1782 thread_manager_(NULL), |
| 1778 fp_stubs_generated_(false), | 1783 fp_stubs_generated_(false), |
| 1779 has_installed_extensions_(false), | 1784 has_installed_extensions_(false), |
| 1780 string_tracker_(NULL), | 1785 string_tracker_(NULL), |
| 1781 regexp_stack_(NULL), | 1786 regexp_stack_(NULL), |
| 1782 date_cache_(NULL), | 1787 date_cache_(NULL), |
| 1783 code_stub_interface_descriptors_(NULL), | 1788 code_stub_interface_descriptors_(NULL), |
| 1789 context_exit_happened_(false), |
| 1784 initialized_from_snapshot_(false), | 1790 initialized_from_snapshot_(false), |
| 1785 cpu_profiler_(NULL), | 1791 cpu_profiler_(NULL), |
| 1786 heap_profiler_(NULL), | 1792 heap_profiler_(NULL), |
| 1787 function_entry_hook_(NULL), | 1793 function_entry_hook_(NULL), |
| 1788 deferred_handles_head_(NULL), | 1794 deferred_handles_head_(NULL), |
| 1789 optimizing_compiler_thread_(this), | 1795 optimizing_compiler_thread_(this), |
| 1790 marking_thread_(NULL), | 1796 marking_thread_(NULL), |
| 1791 sweeper_thread_(NULL), | 1797 sweeper_thread_(NULL), |
| 1792 callback_table_(NULL), | 1798 callback_table_(NULL), |
| 1793 stress_deopt_count_(0) { | 1799 stress_deopt_count_(0) { |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2521 | 2527 |
| 2522 #ifdef DEBUG | 2528 #ifdef DEBUG |
| 2523 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2529 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2524 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2530 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2525 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2531 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2526 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2532 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2527 #undef ISOLATE_FIELD_OFFSET | 2533 #undef ISOLATE_FIELD_OFFSET |
| 2528 #endif | 2534 #endif |
| 2529 | 2535 |
| 2530 } } // namespace v8::internal | 2536 } } // namespace v8::internal |
| OLD | NEW |