Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/become.h" | 10 #include "vm/become.h" |
| (...skipping 9206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9217 } else { | 9217 } else { |
| 9218 min = midpoint; | 9218 min = midpoint; |
| 9219 } | 9219 } |
| 9220 } | 9220 } |
| 9221 *line = min + 1; // Line numbers start at 1. | 9221 *line = min + 1; // Line numbers start at 1. |
| 9222 smi ^= line_starts_array.At(min); | 9222 smi ^= line_starts_array.At(min); |
| 9223 if (column != NULL) { | 9223 if (column != NULL) { |
| 9224 *column = offset - smi.Value() + 1; | 9224 *column = offset - smi.Value() + 1; |
| 9225 } | 9225 } |
| 9226 if (token_len != NULL) { | 9226 if (token_len != NULL) { |
| 9227 // We don't explicitly save this data. | 9227 // We don't explicitly save this data: Load the source |
| 9228 // TODO(jensj): Load the source and attempt to find it from there. | 9228 // and find it from there. |
| 9229 const String& source = String::Handle(zone, Source()); | |
| 9230 ASSERT(source.Length() >= offset); | |
| 9229 *token_len = 1; | 9231 *token_len = 1; |
| 9232 if (Scanner::IsIdentStartChar(source.CharAt(offset))) { | |
| 9233 for (intptr_t i = offset + 1; i < source.Length(); ++i, ++*token_len) { | |
|
hausner
2017/03/06 16:58:55
I find this hard to read, since the for loop more
jensj
2017/03/07 08:43:40
Done.
| |
| 9234 if (!Scanner::IsIdentChar(source.CharAt(i))) { | |
| 9235 break; | |
| 9236 } | |
| 9237 } | |
| 9238 } | |
| 9230 } | 9239 } |
| 9231 return; | 9240 return; |
| 9232 } | 9241 } |
| 9233 | 9242 |
| 9234 const TokenStream& tkns = TokenStream::Handle(zone, tokens()); | 9243 const TokenStream& tkns = TokenStream::Handle(zone, tokens()); |
| 9235 if (tkns.IsNull()) { | 9244 if (tkns.IsNull()) { |
| 9236 ASSERT((Dart::vm_snapshot_kind() == Snapshot::kAppAOT)); | 9245 ASSERT((Dart::vm_snapshot_kind() == Snapshot::kAppAOT)); |
| 9237 *line = -1; | 9246 *line = -1; |
| 9238 if (column != NULL) { | 9247 if (column != NULL) { |
| 9239 *column = -1; | 9248 *column = -1; |
| (...skipping 13652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 22892 return UserTag::null(); | 22901 return UserTag::null(); |
| 22893 } | 22902 } |
| 22894 | 22903 |
| 22895 | 22904 |
| 22896 const char* UserTag::ToCString() const { | 22905 const char* UserTag::ToCString() const { |
| 22897 const String& tag_label = String::Handle(label()); | 22906 const String& tag_label = String::Handle(label()); |
| 22898 return tag_label.ToCString(); | 22907 return tag_label.ToCString(); |
| 22899 } | 22908 } |
| 22900 | 22909 |
| 22901 } // namespace dart | 22910 } // namespace dart |
| OLD | NEW |