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

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

Issue 1220193009: Migrate most uses of Isolate::current_zone to Thread::zone. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | « runtime/vm/object.cc ('k') | runtime/vm/os_linux.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/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_OS_ANDROID) 6 #if defined(TARGET_OS_ANDROID)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <android/log.h> // NOLINT 10 #include <android/log.h> // NOLINT
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 uword prologue_offset, 69 uword prologue_offset,
70 uword size, 70 uword size,
71 bool optimized) { 71 bool optimized) {
72 Dart_FileWriteCallback file_write = Isolate::file_write_callback(); 72 Dart_FileWriteCallback file_write = Isolate::file_write_callback();
73 if ((file_write == NULL) || (out_file_ == NULL)) { 73 if ((file_write == NULL) || (out_file_ == NULL)) {
74 return; 74 return;
75 } 75 }
76 const char* format = "%" Px " %" Px " %s%s\n"; 76 const char* format = "%" Px " %" Px " %s%s\n";
77 const char* marker = optimized ? "*" : ""; 77 const char* marker = optimized ? "*" : "";
78 intptr_t len = OS::SNPrint(NULL, 0, format, base, size, marker, name); 78 intptr_t len = OS::SNPrint(NULL, 0, format, base, size, marker, name);
79 char* buffer = Isolate::Current()->current_zone()->Alloc<char>(len + 1); 79 char* buffer = Thread::Current()->zone()->Alloc<char>(len + 1);
80 OS::SNPrint(buffer, len + 1, format, base, size, marker, name); 80 OS::SNPrint(buffer, len + 1, format, base, size, marker, name);
81 (*file_write)(buffer, len, out_file_); 81 (*file_write)(buffer, len, out_file_);
82 } 82 }
83 83
84 private: 84 private:
85 void* out_file_; 85 void* out_file_;
86 86
87 DISALLOW_COPY_AND_ASSIGN(PerfCodeObserver); 87 DISALLOW_COPY_AND_ASSIGN(PerfCodeObserver);
88 }; 88 };
89 89
(...skipping 12 matching lines...) Expand all
102 uword size, 102 uword size,
103 bool optimized) { 103 bool optimized) {
104 if (prologue_offset > 0) { 104 if (prologue_offset > 0) {
105 // In order to ensure that gdb sees the first instruction of a function 105 // In order to ensure that gdb sees the first instruction of a function
106 // as the prologue sequence we register two symbols for the cases when 106 // as the prologue sequence we register two symbols for the cases when
107 // the prologue sequence is not the first instruction: 107 // the prologue sequence is not the first instruction:
108 // <name>_entry is used for code preceding the prologue sequence. 108 // <name>_entry is used for code preceding the prologue sequence.
109 // <name> for rest of the code (first instruction is prologue sequence). 109 // <name> for rest of the code (first instruction is prologue sequence).
110 const char* kFormat = "%s_%s"; 110 const char* kFormat = "%s_%s";
111 intptr_t len = OS::SNPrint(NULL, 0, kFormat, name, "entry"); 111 intptr_t len = OS::SNPrint(NULL, 0, kFormat, name, "entry");
112 char* pname = Isolate::Current()->current_zone()->Alloc<char>(len + 1); 112 char* pname = Thread::Current()->zone()->Alloc<char>(len + 1);
113 OS::SNPrint(pname, (len + 1), kFormat, name, "entry"); 113 OS::SNPrint(pname, (len + 1), kFormat, name, "entry");
114 DebugInfo::RegisterSection(pname, base, size); 114 DebugInfo::RegisterSection(pname, base, size);
115 DebugInfo::RegisterSection(name, 115 DebugInfo::RegisterSection(name,
116 (base + prologue_offset), 116 (base + prologue_offset),
117 (size - prologue_offset)); 117 (size - prologue_offset));
118 } else { 118 } else {
119 DebugInfo::RegisterSection(name, base, size); 119 DebugInfo::RegisterSection(name, base, size);
120 } 120 }
121 } 121 }
122 122
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 } 415 }
416 416
417 417
418 void OS::Exit(int code) { 418 void OS::Exit(int code) {
419 exit(code); 419 exit(code);
420 } 420 }
421 421
422 } // namespace dart 422 } // namespace dart
423 423
424 #endif // defined(TARGET_OS_ANDROID) 424 #endif // defined(TARGET_OS_ANDROID)
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/os_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698