OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 11597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11608 // If the caller parameter is a function we skip frames until we're | 11608 // If the caller parameter is a function we skip frames until we're |
11609 // under it before starting to collect. | 11609 // under it before starting to collect. |
11610 bool seen_caller = !caller->IsJSFunction(); | 11610 bool seen_caller = !caller->IsJSFunction(); |
11611 int cursor = 0; | 11611 int cursor = 0; |
11612 int frames_seen = 0; | 11612 int frames_seen = 0; |
11613 while (!iter.done() && frames_seen < limit) { | 11613 while (!iter.done() && frames_seen < limit) { |
11614 StackFrame* raw_frame = iter.frame(); | 11614 StackFrame* raw_frame = iter.frame(); |
11615 if (ShowFrameInStackTrace(raw_frame, *caller, &seen_caller)) { | 11615 if (ShowFrameInStackTrace(raw_frame, *caller, &seen_caller)) { |
11616 frames_seen++; | 11616 frames_seen++; |
11617 JavaScriptFrame* frame = JavaScriptFrame::cast(raw_frame); | 11617 JavaScriptFrame* frame = JavaScriptFrame::cast(raw_frame); |
11618 List<FrameSummary> frames(3); // Max 2 levels of inlining. | 11618 // Set initial size to the maximum inlining level + 1 for the outermost |
| 11619 // function. |
| 11620 List<FrameSummary> frames(Compiler::kMaxInliningLevels + 1); |
11619 frame->Summarize(&frames); | 11621 frame->Summarize(&frames); |
11620 for (int i = frames.length() - 1; i >= 0; i--) { | 11622 for (int i = frames.length() - 1; i >= 0; i--) { |
11621 if (cursor + 4 > elements->length()) { | 11623 if (cursor + 4 > elements->length()) { |
11622 int new_capacity = JSObject::NewElementsCapacity(elements->length()); | 11624 int new_capacity = JSObject::NewElementsCapacity(elements->length()); |
11623 Handle<FixedArray> new_elements = | 11625 Handle<FixedArray> new_elements = |
11624 factory->NewFixedArrayWithHoles(new_capacity); | 11626 factory->NewFixedArrayWithHoles(new_capacity); |
11625 for (int i = 0; i < cursor; i++) { | 11627 for (int i = 0; i < cursor; i++) { |
11626 new_elements->set(i, elements->get(i)); | 11628 new_elements->set(i, elements->get(i)); |
11627 } | 11629 } |
11628 elements = new_elements; | 11630 elements = new_elements; |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11938 } else { | 11940 } else { |
11939 // Handle last resort GC and make sure to allow future allocations | 11941 // Handle last resort GC and make sure to allow future allocations |
11940 // to grow the heap without causing GCs (if possible). | 11942 // to grow the heap without causing GCs (if possible). |
11941 isolate->counters()->gc_last_resort_from_js()->Increment(); | 11943 isolate->counters()->gc_last_resort_from_js()->Increment(); |
11942 isolate->heap()->CollectAllGarbage(false); | 11944 isolate->heap()->CollectAllGarbage(false); |
11943 } | 11945 } |
11944 } | 11946 } |
11945 | 11947 |
11946 | 11948 |
11947 } } // namespace v8::internal | 11949 } } // namespace v8::internal |
OLD | NEW |