Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: src/isolate.cc

Issue 21173004: Version 3.20.11.1 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/isolate.h ('k') | src/liveedit.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 Handle<Object> fun_name(fun->shared()->name(), this); 809 Handle<Object> fun_name(fun->shared()->name(), this);
810 if (!fun_name->BooleanValue()) { 810 if (!fun_name->BooleanValue()) {
811 fun_name = Handle<Object>(fun->shared()->inferred_name(), this); 811 fun_name = Handle<Object>(fun->shared()->inferred_name(), this);
812 } 812 }
813 CHECK_NOT_EMPTY_HANDLE(this, 813 CHECK_NOT_EMPTY_HANDLE(this,
814 JSObject::SetLocalPropertyIgnoreAttributes( 814 JSObject::SetLocalPropertyIgnoreAttributes(
815 stack_frame, function_key, fun_name, NONE)); 815 stack_frame, function_key, fun_name, NONE));
816 } 816 }
817 817
818 if (options & StackTrace::kIsEval) { 818 if (options & StackTrace::kIsEval) {
819 Handle<Object> is_eval = 819 int type = Smi::cast(script->compilation_type())->value();
820 script->compilation_type() == Script::COMPILATION_TYPE_EVAL ? 820 Handle<Object> is_eval = (type == Script::COMPILATION_TYPE_EVAL) ?
821 factory()->true_value() : factory()->false_value(); 821 factory()->true_value() : factory()->false_value();
822 CHECK_NOT_EMPTY_HANDLE(this, 822 CHECK_NOT_EMPTY_HANDLE(this,
823 JSObject::SetLocalPropertyIgnoreAttributes( 823 JSObject::SetLocalPropertyIgnoreAttributes(
824 stack_frame, eval_key, is_eval, NONE)); 824 stack_frame, eval_key, is_eval, NONE));
825 } 825 }
826 826
827 if (options & StackTrace::kIsConstructor) { 827 if (options & StackTrace::kIsConstructor) {
828 Handle<Object> is_constructor = (frames[i].is_constructor()) ? 828 Handle<Object> is_constructor = (frames[i].is_constructor()) ?
829 factory()->true_value() : factory()->false_value(); 829 factory()->true_value() : factory()->false_value();
830 CHECK_NOT_EMPTY_HANDLE(this, 830 CHECK_NOT_EMPTY_HANDLE(this,
831 JSObject::SetLocalPropertyIgnoreAttributes( 831 JSObject::SetLocalPropertyIgnoreAttributes(
832 stack_frame, constructor_key, 832 stack_frame, constructor_key,
833 is_constructor, NONE)); 833 is_constructor, NONE));
834 } 834 }
835 835
836 FixedArray::cast(stack_trace->elements())->set(frames_seen, *stack_frame); 836 FixedArray::cast(stack_trace->elements())->set(frames_seen, *stack_frame);
837 frames_seen++; 837 frames_seen++;
838 } 838 }
839 it.Advance(); 839 it.Advance();
840 } 840 }
841 841
842 stack_trace->set_length(Smi::FromInt(frames_seen)); 842 stack_trace->set_length(Smi::FromInt(frames_seen));
843 return stack_trace; 843 return stack_trace;
844 } 844 }
845 845
846 846
847 void Isolate::PrintStack() {
848 PrintStack(stdout);
849 }
850
851
852 void Isolate::PrintStack(FILE* out) { 847 void Isolate::PrintStack(FILE* out) {
853 if (stack_trace_nesting_level_ == 0) { 848 if (stack_trace_nesting_level_ == 0) {
854 stack_trace_nesting_level_++; 849 stack_trace_nesting_level_++;
855 850
856 StringAllocator* allocator; 851 StringAllocator* allocator;
857 if (preallocated_message_space_ == NULL) { 852 if (preallocated_message_space_ == NULL) {
858 allocator = new HeapStringAllocator(); 853 allocator = new HeapStringAllocator();
859 } else { 854 } else {
860 allocator = preallocated_message_space_; 855 allocator = preallocated_message_space_;
861 } 856 }
(...skipping 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after
2522 2517
2523 #ifdef DEBUG 2518 #ifdef DEBUG
2524 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2519 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2525 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2520 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2526 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2521 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2527 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2522 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2528 #undef ISOLATE_FIELD_OFFSET 2523 #undef ISOLATE_FIELD_OFFSET
2529 #endif 2524 #endif
2530 2525
2531 } } // namespace v8::internal 2526 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/liveedit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698