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

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

Issue 10839002: Better breakpoint management (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
« runtime/vm/debugger.cc ('K') | « runtime/vm/debugger.cc ('k') | no next file » | 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/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/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 5082 matching lines...) Expand 10 before | Expand all | Expand 10 after
5093 intptr_t src_pos = tkns.ComputeSourcePosition(token_pos); 5093 intptr_t src_pos = tkns.ComputeSourcePosition(token_pos);
5094 Scanner scanner(src, dummy_key); 5094 Scanner scanner(src, dummy_key);
5095 scanner.ScanTo(src_pos); 5095 scanner.ScanTo(src_pos);
5096 *line = scanner.CurrentPosition().line; 5096 *line = scanner.CurrentPosition().line;
5097 *column = scanner.CurrentPosition().column; 5097 *column = scanner.CurrentPosition().column;
5098 } 5098 }
5099 5099
5100 5100
5101 void Script::TokenRangeAtLine(intptr_t line_number, 5101 void Script::TokenRangeAtLine(intptr_t line_number,
5102 intptr_t* first_token_index, 5102 intptr_t* first_token_index,
5103 intptr_t* last_token_index) const { 5103 intptr_t* last_token_index) const {
siva 2012/07/30 22:17:15 Something to consider for later, not this CL: we
hausner 2012/07/30 22:36:57 I agree. I was confused too and didn't realize tha
5104 intptr_t first_src_pos;
5105 intptr_t last_src_pos;
5106 const String& src = String::Handle(Source()); 5104 const String& src = String::Handle(Source());
5107 const String& dummy_key = String::Handle(Symbols::Empty()); 5105 const String& dummy_key = String::Handle(Symbols::Empty());
5108 const TokenStream& tkns = TokenStream::Handle(tokens()); 5106 const TokenStream& tkns = TokenStream::Handle(tokens());
5109 Scanner scanner(src, dummy_key); 5107 Scanner scanner(src, dummy_key);
5110 scanner.TokenRangeAtLine(line_number, &first_src_pos, &last_src_pos); 5108 scanner.TokenRangeAtLine(line_number, first_token_index, last_token_index);
5111 *first_token_index = tkns.ComputeTokenPosition(first_src_pos); 5109 if (*first_token_index >= 0) {
5112 *last_token_index = tkns.ComputeTokenPosition(last_src_pos); 5110 *first_token_index = tkns.ComputeTokenPosition(*first_token_index);
5111 }
5112 if (*last_token_index >= 0) {
5113 *last_token_index = tkns.ComputeTokenPosition(*last_token_index);
5114 }
5113 } 5115 }
5114 5116
5115 5117
5116 RawString* Script::GetLine(intptr_t line_number) const { 5118 RawString* Script::GetLine(intptr_t line_number) const {
5117 const String& src = String::Handle(Source()); 5119 const String& src = String::Handle(Source());
5118 intptr_t current_line = 1; 5120 intptr_t current_line = 1;
5119 intptr_t line_start = -1; 5121 intptr_t line_start = -1;
5120 intptr_t last_char = -1; 5122 intptr_t last_char = -1;
5121 for (intptr_t ix = 0; 5123 for (intptr_t ix = 0;
5122 (ix < src.Length()) && (current_line <= line_number); 5124 (ix < src.Length()) && (current_line <= line_number);
(...skipping 5728 matching lines...) Expand 10 before | Expand all | Expand 10 after
10851 const String& str = String::Handle(pattern()); 10853 const String& str = String::Handle(pattern());
10852 const char* format = "JSRegExp: pattern=%s flags=%s"; 10854 const char* format = "JSRegExp: pattern=%s flags=%s";
10853 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); 10855 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags());
10854 char* chars = reinterpret_cast<char*>( 10856 char* chars = reinterpret_cast<char*>(
10855 Isolate::Current()->current_zone()->Allocate(len + 1)); 10857 Isolate::Current()->current_zone()->Allocate(len + 1));
10856 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); 10858 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags());
10857 return chars; 10859 return chars;
10858 } 10860 }
10859 10861
10860 } // namespace dart 10862 } // namespace dart
OLDNEW
« runtime/vm/debugger.cc ('K') | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698