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

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

Issue 1016503005: Rename NoGCScope -> NoSafepointScope. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 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 | « runtime/vm/snapshot.cc ('k') | runtime/vm/verifier.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 (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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 void StackFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { 75 void StackFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) {
76 // NOTE: This code runs while GC is in progress and runs within 76 // NOTE: This code runs while GC is in progress and runs within
77 // a NoHandleScope block. Hence it is not ok to use regular Zone or 77 // a NoHandleScope block. Hence it is not ok to use regular Zone or
78 // Scope handles. We use direct stack handles, the raw pointers in 78 // Scope handles. We use direct stack handles, the raw pointers in
79 // these handles are not traversed. The use of handles is mainly to 79 // these handles are not traversed. The use of handles is mainly to
80 // be able to reuse the handle based code and avoid having to add 80 // be able to reuse the handle based code and avoid having to add
81 // helper functions to the raw object interface. 81 // helper functions to the raw object interface.
82 ASSERT(isolate_ == Isolate::Current()); 82 ASSERT(isolate_ == Isolate::Current());
83 ASSERT(visitor != NULL); 83 ASSERT(visitor != NULL);
84 NoGCScope no_gc; 84 NoSafepointScope no_safepoint;
85 Code code; 85 Code code;
86 code = LookupDartCode(); 86 code = LookupDartCode();
87 if (!code.IsNull()) { 87 if (!code.IsNull()) {
88 // Visit the code object. 88 // Visit the code object.
89 RawObject* raw_code = code.raw(); 89 RawObject* raw_code = code.raw();
90 visitor->VisitPointer(&raw_code); 90 visitor->VisitPointer(&raw_code);
91 91
92 // Optimized frames have a stack map. We need to visit the frame based 92 // Optimized frames have a stack map. We need to visit the frame based
93 // on the stack map. 93 // on the stack map.
94 Array maps; 94 Array maps;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } 166 }
167 return Function::null(); 167 return Function::null();
168 } 168 }
169 169
170 170
171 RawCode* StackFrame::LookupDartCode() const { 171 RawCode* StackFrame::LookupDartCode() const {
172 ASSERT(isolate_ == Isolate::Current()); 172 ASSERT(isolate_ == Isolate::Current());
173 // We add a no gc scope to ensure that the code below does not trigger 173 // We add a no gc scope to ensure that the code below does not trigger
174 // a GC as we are handling raw object references here. It is possible 174 // a GC as we are handling raw object references here. It is possible
175 // that the code is called while a GC is in progress, that is ok. 175 // that the code is called while a GC is in progress, that is ok.
176 NoGCScope no_gc; 176 NoSafepointScope no_safepoint;
177 RawCode* code = GetCodeObject(); 177 RawCode* code = GetCodeObject();
178 ASSERT(code == Code::null() || code->ptr()->owner_ != Function::null()); 178 ASSERT(code == Code::null() || code->ptr()->owner_ != Function::null());
179 return code; 179 return code;
180 } 180 }
181 181
182 182
183 RawCode* StackFrame::GetCodeObject() const { 183 RawCode* StackFrame::GetCodeObject() const {
184 // We add a no gc scope to ensure that the code below does not trigger 184 // We add a no gc scope to ensure that the code below does not trigger
185 // a GC as we are handling raw object references here. It is possible 185 // a GC as we are handling raw object references here. It is possible
186 // that the code is called while a GC is in progress, that is ok. 186 // that the code is called while a GC is in progress, that is ok.
187 NoGCScope no_gc; 187 NoSafepointScope no_safepoint;
188 const uword pc_marker = 188 const uword pc_marker =
189 *(reinterpret_cast<uword*>(fp() + (kPcMarkerSlotFromFp * kWordSize))); 189 *(reinterpret_cast<uword*>(fp() + (kPcMarkerSlotFromFp * kWordSize)));
190 if (pc_marker != 0) { 190 if (pc_marker != 0) {
191 const uword entry_point = 191 const uword entry_point =
192 (pc_marker - Assembler::EntryPointToPcMarkerOffset()); 192 (pc_marker - Assembler::EntryPointToPcMarkerOffset());
193 RawInstructions* instr = Instructions::FromEntryPoint(entry_point); 193 RawInstructions* instr = Instructions::FromEntryPoint(entry_point);
194 if (instr != Instructions::null()) { 194 if (instr != Instructions::null()) {
195 return instr->ptr()->code_; 195 return instr->ptr()->code_;
196 } 196 }
197 } 197 }
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { 492 if (deopt_instr->kind() == DeoptInstr::kCallerFp) {
493 return (index - num_materializations_); 493 return (index - num_materializations_);
494 } 494 }
495 } 495 }
496 UNREACHABLE(); 496 UNREACHABLE();
497 return 0; 497 return 0;
498 } 498 }
499 499
500 500
501 } // namespace dart 501 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | runtime/vm/verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698