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

Unified Diff: runtime/vm/object.cc

Issue 10752017: Rename Script's source to Source. Trace parser (--trace-parser) only if source is available (thus s… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 9490)
+++ runtime/vm/object.cc (working copy)
@@ -4476,7 +4476,12 @@
}
-RawString* Script::source() const {
+bool Script::HasSource() const {
+ return raw_ptr()->source_ != String::null();
+}
+
+
+RawString* Script::Source() const {
String& source = String::Handle(raw_ptr()->source_);
if (source.IsNull()) {
const TokenStream& token_stream = TokenStream::Handle(tokens());
@@ -4516,7 +4521,7 @@
// Get the source, scan and allocate the token stream.
TimerScope timer(FLAG_compiler_stats, &CompilerStats::scanner_timer);
- const String& src = String::Handle(source());
+ const String& src = String::Handle(Source());
Scanner scanner(src, private_key);
set_tokens(TokenStream::Handle(TokenStream::New(scanner.GetStream())));
if (FLAG_compiler_stats) {
@@ -4528,7 +4533,7 @@
void Script::GetTokenLocation(intptr_t token_pos,
intptr_t* line,
intptr_t* column) const {
- const String& src = String::Handle(source());
+ const String& src = String::Handle(Source());
const String& dummy_key = String::Handle(String::New(""));
Scanner scanner(src, dummy_key);
scanner.ScanTo(token_pos);
@@ -4540,7 +4545,7 @@
void Script::TokenRangeAtLine(intptr_t line_number,
intptr_t* first_token_index,
intptr_t* last_token_index) const {
- const String& src = String::Handle(source());
+ const String& src = String::Handle(Source());
const String& dummy_key = String::Handle(String::New(""));
Scanner scanner(src, dummy_key);
scanner.TokenRangeAtLine(line_number, first_token_index, last_token_index);
@@ -4548,7 +4553,7 @@
RawString* Script::GetLine(intptr_t line_number) const {
- const String& src = String::Handle(source());
+ const String& src = String::Handle(Source());
intptr_t current_line = 1;
intptr_t line_start = -1;
intptr_t last_char = -1;
@@ -4581,7 +4586,7 @@
intptr_t from_column,
intptr_t to_line,
intptr_t to_column) const {
- const String& src = String::Handle(source());
+ const String& src = String::Handle(Source());
intptr_t length = src.Length();
intptr_t line = 1;
intptr_t column = 1;
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698