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

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

Issue 9475031: Cleaned up usage of Function::code, since it may be misunderstood that it points to the only Code o… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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/runtime_entry_test.cc ('k') | runtime/vm/unit_test.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "vm/code_index_table.h" 7 #include "vm/code_index_table.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/object_store.h" 10 #include "vm/object_store.h"
(...skipping 30 matching lines...) Expand all
41 visitor->VisitPointers(reinterpret_cast<RawObject**>(sp()), 41 visitor->VisitPointers(reinterpret_cast<RawObject**>(sp()),
42 reinterpret_cast<RawObject**>(fp() - kWordSize)); 42 reinterpret_cast<RawObject**>(fp() - kWordSize));
43 } 43 }
44 44
45 45
46 RawFunction* DartFrame::LookupDartFunction() const { 46 RawFunction* DartFrame::LookupDartFunction() const {
47 // Get access to the code index table. 47 // Get access to the code index table.
48 ASSERT(Isolate::Current() != NULL); 48 ASSERT(Isolate::Current() != NULL);
49 CodeIndexTable* code_index_table = Isolate::Current()->code_index_table(); 49 CodeIndexTable* code_index_table = Isolate::Current()->code_index_table();
50 ASSERT(code_index_table != NULL); 50 ASSERT(code_index_table != NULL);
51 return code_index_table->LookupFunction(pc()); 51 return Code::Handle(code_index_table->LookupCode(pc())).function();
52 } 52 }
53 53
54 54
55 RawCode* DartFrame::LookupDartCode() const { 55 RawCode* DartFrame::LookupDartCode() const {
56 // Get access to the code index table. 56 // Get access to the code index table.
57 ASSERT(Isolate::Current() != NULL); 57 ASSERT(Isolate::Current() != NULL);
58 CodeIndexTable* code_index_table = Isolate::Current()->code_index_table(); 58 CodeIndexTable* code_index_table = Isolate::Current()->code_index_table();
59 ASSERT(code_index_table != NULL); 59 ASSERT(code_index_table != NULL);
60 return code_index_table->LookupCode(pc()); 60 return code_index_table->LookupCode(pc());
61 } 61 }
(...skipping 28 matching lines...) Expand all
90 } 90 }
91 return false; 91 return false;
92 } 92 }
93 93
94 94
95 bool StubFrame::IsValid() const { 95 bool StubFrame::IsValid() const {
96 // Get access to the code index table. 96 // Get access to the code index table.
97 ASSERT(Isolate::Current() != NULL); 97 ASSERT(Isolate::Current() != NULL);
98 CodeIndexTable* code_index_table = Isolate::Current()->code_index_table(); 98 CodeIndexTable* code_index_table = Isolate::Current()->code_index_table();
99 ASSERT(code_index_table != NULL); 99 ASSERT(code_index_table != NULL);
100 return code_index_table->LookupFunction(pc()) == Function::null(); 100 return Code::Handle(code_index_table->LookupCode(pc())).IsNull();
101 } 101 }
102 102
103 103
104 void StubFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { 104 void StubFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) {
105 // Visit objects between SP and FP. 105 // Visit objects between SP and FP.
106 ASSERT(visitor != NULL); 106 ASSERT(visitor != NULL);
107 visitor->VisitPointers(reinterpret_cast<RawObject**>(sp()), 107 visitor->VisitPointers(reinterpret_cast<RawObject**>(sp()),
108 reinterpret_cast<RawObject**>(fp() - kWordSize)); 108 reinterpret_cast<RawObject**>(fp() - kWordSize));
109 } 109 }
110 110
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 EntryFrame* StackFrameIterator::NextEntryFrame() { 187 EntryFrame* StackFrameIterator::NextEntryFrame() {
188 ASSERT(!frames_.HasNext()); 188 ASSERT(!frames_.HasNext());
189 entry_.sp_ = frames_.sp_; 189 entry_.sp_ = frames_.sp_;
190 entry_.fp_ = frames_.fp_; 190 entry_.fp_ = frames_.fp_;
191 SetupNextExitFrameData(); // Setup data for next exit frame in chain. 191 SetupNextExitFrameData(); // Setup data for next exit frame in chain.
192 ASSERT(entry_.IsValid()); 192 ASSERT(entry_.IsValid());
193 return &entry_; 193 return &entry_;
194 } 194 }
195 195
196 } // namespace dart 196 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/runtime_entry_test.cc ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698