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

Side by Side Diff: runtime/vm/stack_frame.cc

Issue 2804793003: Don't visit a frame's code object twice. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/stack_frame.h" 5 #include "vm/stack_frame.h"
6 6
7 #include "platform/memory_sanitizer.h" 7 #include "platform/memory_sanitizer.h"
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/deopt_instructions.h" 9 #include "vm/deopt_instructions.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // NOTE: This code runs while GC is in progress and runs within 90 // NOTE: This code runs while GC is in progress and runs within
91 // a NoHandleScope block. Hence it is not ok to use regular Zone or 91 // a NoHandleScope block. Hence it is not ok to use regular Zone or
92 // Scope handles. We use direct stack handles, the raw pointers in 92 // Scope handles. We use direct stack handles, the raw pointers in
93 // these handles are not traversed. The use of handles is mainly to 93 // these handles are not traversed. The use of handles is mainly to
94 // be able to reuse the handle based code and avoid having to add 94 // be able to reuse the handle based code and avoid having to add
95 // helper functions to the raw object interface. 95 // helper functions to the raw object interface.
96 NoSafepointScope no_safepoint; 96 NoSafepointScope no_safepoint;
97 Code code; 97 Code code;
98 code = GetCodeObject(); 98 code = GetCodeObject();
99 if (!code.IsNull()) { 99 if (!code.IsNull()) {
100 // Visit the code object.
101 RawObject* raw_code = code.raw();
102 visitor->VisitPointer(&raw_code);
103
104 // Optimized frames have a stack map. We need to visit the frame based 100 // Optimized frames have a stack map. We need to visit the frame based
105 // on the stack map. 101 // on the stack map.
106 Array maps; 102 Array maps;
107 maps = Array::null(); 103 maps = Array::null();
108 StackMap map; 104 StackMap map;
109 const uword start = Instructions::PayloadStart(code.instructions()); 105 const uword start = Instructions::PayloadStart(code.instructions());
110 map = code.GetStackMap(pc() - start, &maps, &map); 106 map = code.GetStackMap(pc() - start, &maps, &map);
111 if (!map.IsNull()) { 107 if (!map.IsNull()) {
112 #if !defined(TARGET_ARCH_DBC) 108 #if !defined(TARGET_ARCH_DBC)
113 RawObject** first = reinterpret_cast<RawObject**>(sp()); 109 RawObject** first = reinterpret_cast<RawObject**>(sp());
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 StackFrameIterator frames(StackFrameIterator::kValidateFrames); 579 StackFrameIterator frames(StackFrameIterator::kValidateFrames);
584 StackFrame* frame = frames.NextFrame(); 580 StackFrame* frame = frames.NextFrame();
585 while (frame != NULL) { 581 while (frame != NULL) {
586 frame = frames.NextFrame(); 582 frame = frames.NextFrame();
587 } 583 }
588 } 584 }
589 #endif 585 #endif
590 586
591 587
592 } // namespace dart 588 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698