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

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

Issue 1425093006: Revert "Switch profiler from isolates to threads" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « runtime/vm/stub_code.h ('k') | runtime/vm/thread.h » ('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/stub_code.h" 5 #include "vm/stub_code.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "platform/globals.h" 8 #include "platform/globals.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/disassembler.h" 10 #include "vm/disassembler.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 } 72 }
73 73
74 74
75 void StubCode::Init(Isolate* isolate) { } 75 void StubCode::Init(Isolate* isolate) { }
76 76
77 77
78 void StubCode::VisitObjectPointers(ObjectPointerVisitor* visitor) { 78 void StubCode::VisitObjectPointers(ObjectPointerVisitor* visitor) {
79 } 79 }
80 80
81 81
82 bool StubCode::HasBeenInitialized() {
83 // Use JumpToExceptionHandler and InvokeDart as canaries.
84 const StubEntry* entry_1 = StubCode::JumpToExceptionHandler_entry();
85 const StubEntry* entry_2 = StubCode::InvokeDartCode_entry();
86 return (entry_1 != NULL) && (entry_2 != NULL);
87 }
88
89
90 bool StubCode::InInvocationStub(uword pc) { 82 bool StubCode::InInvocationStub(uword pc) {
91 ASSERT(HasBeenInitialized());
92 uword entry = StubCode::InvokeDartCode_entry()->EntryPoint(); 83 uword entry = StubCode::InvokeDartCode_entry()->EntryPoint();
93 uword size = StubCode::InvokeDartCodeSize(); 84 uword size = StubCode::InvokeDartCodeSize();
94 return (pc >= entry) && (pc < (entry + size)); 85 return (pc >= entry) && (pc < (entry + size));
95 } 86 }
96 87
97 88
98 bool StubCode::InJumpToExceptionHandlerStub(uword pc) { 89 bool StubCode::InJumpToExceptionHandlerStub(uword pc) {
99 ASSERT(HasBeenInitialized());
100 uword entry = StubCode::JumpToExceptionHandler_entry()->EntryPoint(); 90 uword entry = StubCode::JumpToExceptionHandler_entry()->EntryPoint();
101 uword size = StubCode::JumpToExceptionHandlerSize(); 91 uword size = StubCode::JumpToExceptionHandlerSize();
102 return (pc >= entry) && (pc < (entry + size)); 92 return (pc >= entry) && (pc < (entry + size));
103 } 93 }
104 94
105 95
106 RawCode* StubCode::GetAllocationStubForClass(const Class& cls) { 96 RawCode* StubCode::GetAllocationStubForClass(const Class& cls) {
107 Thread* thread = Thread::Current(); 97 Thread* thread = Thread::Current();
108 Zone* zone = thread->zone(); 98 Zone* zone = thread->zone();
109 const Error& error = Error::Handle(zone, cls.EnsureIsFinalized(thread)); 99 const Error& error = Error::Handle(zone, cls.EnsureIsFinalized(thread));
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 if ((name##_entry() != NULL) && \ 162 if ((name##_entry() != NULL) && \
173 (entry_point == name##_entry()->EntryPoint())) { \ 163 (entry_point == name##_entry()->EntryPoint())) { \
174 return ""#name; \ 164 return ""#name; \
175 } 165 }
176 VM_STUB_CODE_LIST(VM_STUB_CODE_TESTER); 166 VM_STUB_CODE_LIST(VM_STUB_CODE_TESTER);
177 #undef VM_STUB_CODE_TESTER 167 #undef VM_STUB_CODE_TESTER
178 return NULL; 168 return NULL;
179 } 169 }
180 170
181 } // namespace dart 171 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/stub_code.h ('k') | runtime/vm/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698