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

Unified Diff: runtime/lib/mirrors.cc

Issue 1952023002: Minor cleanup based on profiler output of CompileParseFunction. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | runtime/vm/compiler_stats.cc » ('j') | runtime/vm/raw_object.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index 33b61c644668b1355ac7d0836c27c89b270c5869..1478f0467c0db0298d217ff95b3024cbfd76619d 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -1980,7 +1980,7 @@ static RawInstance* CreateSourceLocation(const String& uri,
DEFINE_NATIVE_ENTRY(DeclarationMirror_location, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(Instance, reflectee, arguments->NativeArgAt(0));
- Object& decl = Object::Handle();
+ Object& decl = Object::Handle(zone);
if (reflectee.IsMirrorReference()) {
const MirrorReference& decl_ref = MirrorReference::Cast(reflectee);
decl = decl_ref.referent();
@@ -1990,7 +1990,7 @@ DEFINE_NATIVE_ENTRY(DeclarationMirror_location, 1) {
UNREACHABLE();
}
- Script& script = Script::Handle();
+ Script& script = Script::Handle(zone);
TokenPosition token_pos = TokenPosition::kNoSource;
if (decl.IsFunction()) {
@@ -2018,7 +2018,7 @@ DEFINE_NATIVE_ENTRY(DeclarationMirror_location, 1) {
token_pos = field.token_pos();
} else if (decl.IsTypeParameter()) {
const TypeParameter& type_var = TypeParameter::Cast(decl);
- const Class& owner = Class::Handle(type_var.parameterized_class());
+ const Class& owner = Class::Handle(zone, type_var.parameterized_class());
script = owner.script();
token_pos = type_var.token_pos();
} else if (decl.IsLibrary()) {
@@ -2026,20 +2026,20 @@ DEFINE_NATIVE_ENTRY(DeclarationMirror_location, 1) {
if (lib.raw() == Library::NativeWrappersLibrary()) {
return Instance::null(); // No source.
}
- const Array& scripts = Array::Handle(lib.LoadedScripts());
+ const Array& scripts = Array::Handle(zone, lib.LoadedScripts());
for (intptr_t i = 0; i < scripts.Length(); i++) {
script ^= scripts.At(i);
if (script.kind() == RawScript::kLibraryTag) break;
}
ASSERT(!script.IsNull());
- const String& libname = String::Handle(lib.name());
+ const String& libname = String::Handle(zone, lib.name());
if (libname.Length() == 0) {
// No library declaration.
- const String& uri = String::Handle(script.url());
+ const String& uri = String::Handle(zone, script.url());
return CreateSourceLocation(uri, 1, 1);
}
- const TokenStream& stream = TokenStream::Handle(script.tokens());
- TokenStream::Iterator tkit(stream, TokenPosition::kMinSource);
+ const TokenStream& stream = TokenStream::Handle(zone, script.tokens());
+ TokenStream::Iterator tkit(zone, stream, TokenPosition::kMinSource);
if (tkit.CurrentTokenKind() == Token::kSCRIPTTAG) tkit.Advance();
token_pos = tkit.CurrentPosition();
}
@@ -2047,7 +2047,7 @@ DEFINE_NATIVE_ENTRY(DeclarationMirror_location, 1) {
ASSERT(!script.IsNull());
ASSERT(token_pos != TokenPosition::kNoSource);
- const String& uri = String::Handle(script.url());
+ const String& uri = String::Handle(zone, script.url());
intptr_t from_line = 0;
intptr_t from_col = 0;
if (script.HasSource()) {
« no previous file with comments | « no previous file | runtime/vm/compiler_stats.cc » ('j') | runtime/vm/raw_object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698