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

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

Issue 1384403002: Preparation for moving reusable handles to thread and more cleanups: isolate -> thread based handle… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 88
89 bool StubCode::InJumpToExceptionHandlerStub(uword pc) { 89 bool StubCode::InJumpToExceptionHandlerStub(uword pc) {
90 uword entry = StubCode::JumpToExceptionHandler_entry()->EntryPoint(); 90 uword entry = StubCode::JumpToExceptionHandler_entry()->EntryPoint();
91 uword size = StubCode::JumpToExceptionHandlerSize(); 91 uword size = StubCode::JumpToExceptionHandlerSize();
92 return (pc >= entry) && (pc < (entry + size)); 92 return (pc >= entry) && (pc < (entry + size));
93 } 93 }
94 94
95 95
96 RawCode* StubCode::GetAllocationStubForClass(const Class& cls) { 96 RawCode* StubCode::GetAllocationStubForClass(const Class& cls) {
97 Isolate* isolate = Isolate::Current(); 97 Thread* thread = Thread::Current();
98 const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate)); 98 Isolate* isolate = thread->isolate();
99 const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(thread));
99 ASSERT(error.IsNull()); 100 ASSERT(error.IsNull());
100 if (cls.id() == kArrayCid) { 101 if (cls.id() == kArrayCid) {
101 return AllocateArray_entry()->code(); 102 return AllocateArray_entry()->code();
102 } 103 }
103 Code& stub = Code::Handle(isolate, cls.allocation_stub()); 104 Code& stub = Code::Handle(isolate, cls.allocation_stub());
104 if (stub.IsNull()) { 105 if (stub.IsNull()) {
105 Assembler assembler; 106 Assembler assembler;
106 const char* name = cls.ToCString(); 107 const char* name = cls.ToCString();
107 StubCode::GenerateAllocationStubForClass(&assembler, cls); 108 StubCode::GenerateAllocationStubForClass(&assembler, cls);
108 stub ^= Code::FinalizeCode(name, &assembler); 109 stub ^= Code::FinalizeCode(name, &assembler);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 if ((name##_entry() != NULL) && \ 162 if ((name##_entry() != NULL) && \
162 (entry_point == name##_entry()->EntryPoint())) { \ 163 (entry_point == name##_entry()->EntryPoint())) { \
163 return ""#name; \ 164 return ""#name; \
164 } 165 }
165 VM_STUB_CODE_LIST(VM_STUB_CODE_TESTER); 166 VM_STUB_CODE_LIST(VM_STUB_CODE_TESTER);
166 #undef VM_STUB_CODE_TESTER 167 #undef VM_STUB_CODE_TESTER
167 return NULL; 168 return NULL;
168 } 169 }
169 170
170 } // namespace dart 171 } // namespace dart
OLDNEW
« runtime/vm/gc_marker.h ('K') | « runtime/vm/stack_frame.cc ('k') | runtime/vm/zone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698