Move 'dart:profiler' contents into 'dart:developer' and remove 'dart:profiler'

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1139503002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45783 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
johnmccutchan@google.com
2015-05-13 23:48:04 +00:00
parent 28cfbd8f44
commit 95515238cc
32 changed files with 46 additions and 175 deletions
@@ -7,7 +7,7 @@
library engine.utilities.general;
import 'dart:profiler';
import 'dart:developer';
/**
* Jenkins hash function, optimized for small integers.
@@ -34,7 +34,7 @@ class JenkinsSmiHash {
/**
* Helper class for gathering performance statistics. This class is modeled on
* the UserTag class in dart:profiler so that it can interoperate easily with
* the UserTag class in dart:developer so that it can interoperate easily with
* it.
*/
abstract class PerformanceTag {
+1 -1
View File
@@ -6,7 +6,7 @@ library dart2js;
import 'dart:async';
import 'dart:collection' show Queue;
import 'dart:profiler' show
import 'dart:developer' show
UserTag;
import '../compiler.dart' as api;
@@ -8,7 +8,7 @@ import 'dart:async' show
EventSink,
Future;
import 'dart:profiler' show
import 'dart:developer' show
UserTag;
import 'package:compiler/src/apiimpl.dart' show
+2
View File
@@ -8,6 +8,8 @@
'sources': [
'developer.cc',
'developer.dart',
'profiler.cc',
'profiler.dart',
],
}
+1 -1
View File
@@ -15,7 +15,7 @@ namespace dart {
DECLARE_FLAG(bool, trace_intrinsified_natives);
// dart:profiler.
// Native implementations for the dart:developer library.
DEFINE_NATIVE_ENTRY(UserTag_new, 2) {
ASSERT(TypeArguments::CheckedHandle(arguments->NativeArgAt(0)).IsNull());
-13
View File
@@ -1,13 +0,0 @@
# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
# Sources visible via dart:profiler library.
{
'sources': [
'profiler.cc',
'profiler.dart',
],
}
@@ -7,7 +7,7 @@ import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
import 'test_helper.dart';
import 'dart:profiler';
import 'dart:developer';
void script() {
var counter = new Counter('a.b.c', 'description');
@@ -7,7 +7,7 @@ import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
import 'test_helper.dart';
import 'dart:profiler';
import 'dart:developer';
void script() {
var counter = new Counter('a.b.c', 'description');
+1 -1
View File
@@ -8,7 +8,7 @@ library manual_inspector_test;
import 'dart:isolate';
import 'dart:mirrors';
import 'dart:profiler';
import 'dart:developer';
import 'dart:typed_data';
class A <T> {}
-4
View File
@@ -67,10 +67,6 @@ static bootstrap_lib_props bootstrap_libraries[] = {
mirrors,
Bootstrap::mirrors_source_paths_,
Bootstrap::mirrors_patch_paths_),
INIT_LIBRARY(ObjectStore::kProfiler,
profiler,
Bootstrap::profiler_source_paths_,
Bootstrap::profiler_patch_paths_),
INIT_LIBRARY(ObjectStore::kTypedData,
typed_data,
Bootstrap::typed_data_source_paths_,
-2
View File
@@ -30,7 +30,6 @@ class Bootstrap : public AllStatic {
static const char* json_source_paths_[];
static const char* math_source_paths_[];
static const char* mirrors_source_paths_[];
static const char* profiler_source_paths_[];
static const char* typed_data_source_paths_[];
static const char* utf_source_paths_[];
@@ -44,7 +43,6 @@ class Bootstrap : public AllStatic {
static const char* isolate_patch_paths_[];
static const char* math_patch_paths_[];
static const char* mirrors_patch_paths_[];
static const char* profiler_patch_paths_[];
static const char* typed_data_patch_paths_[];
};
-5
View File
@@ -120,11 +120,6 @@ void Bootstrap::SetupNativeResolver() {
library.set_native_entry_resolver(resolver);
library.set_native_entry_symbol_resolver(symbol_resolver);
library = Library::ProfilerLibrary();
ASSERT(!library.IsNull());
library.set_native_entry_resolver(resolver);
library.set_native_entry_symbol_resolver(symbol_resolver);
library = Library::TypedDataLibrary();
ASSERT(!library.IsNull());
library.set_native_entry_resolver(resolver);
+3 -3
View File
@@ -84,10 +84,10 @@ void Intrinsifier::InitializeState() {
TYPED_DATA_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
GRAPH_TYPED_DATA_INTRINSICS_LIST(SETUP_FUNCTION);
// Setup all dart:profiler lib functions that can be intrinsified.
lib = Library::ProfilerLibrary();
// Setup all dart:developer lib functions that can be intrinsified.
lib = Library::DeveloperLibrary();
ASSERT(!lib.IsNull());
PROFILER_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
DEVELOPER_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
#undef SETUP_FUNCTION
}
+1 -1
View File
@@ -47,7 +47,7 @@ void MethodRecognizer::InitializeState() {
libs.Add(&Library::ZoneHandle(Library::MathLibrary()));
libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary()));
libs.Add(&Library::ZoneHandle(Library::InternalLibrary()));
libs.Add(&Library::ZoneHandle(Library::ProfilerLibrary()));
libs.Add(&Library::ZoneHandle(Library::DeveloperLibrary()));
Function& func = Function::Handle();
#define SET_RECOGNIZED_KIND(class_name, function_name, enum_name, fp) \
+6 -5
View File
@@ -293,16 +293,17 @@ namespace dart {
GRAPH_CORE_INTRINSICS_LIST(V) \
GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \
#define PROFILER_LIB_INTRINSIC_LIST(V) \
V(_UserTag, makeCurrent, UserTag_makeCurrent, 370414636) \
V(::, _getDefaultTag, UserTag_defaultTag, 1159885970) \
V(::, _getCurrentTag, Profiler_getCurrentTag, 1182126114) \
#define DEVELOPER_LIB_INTRINSIC_LIST(V) \
V(_UserTag, makeCurrent, UserTag_makeCurrent, 788201614) \
V(::, _getDefaultTag, UserTag_defaultTag, 1080704381) \
V(::, _getCurrentTag, Profiler_getCurrentTag, 2048029229) \
#define ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \
CORE_LIB_INTRINSIC_LIST(V) \
DEVELOPER_LIB_INTRINSIC_LIST(V) \
MATH_LIB_INTRINSIC_LIST(V) \
TYPED_DATA_LIB_INTRINSIC_LIST(V) \
PROFILER_LIB_INTRINSIC_LIST(V)
#define ALL_INTRINSICS_LIST(V) \
ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \
+10 -15
View File
@@ -1211,19 +1211,19 @@ RawError* Object::Init(Isolate* isolate) {
RegisterPrivateClass(cls, Symbols::_LinkedHashMap(), lib);
pending_classes.Add(cls);
// Pre-register the profiler library so we can place the vm class
// Pre-register the developer library so we can place the vm class
// UserTag there rather than the core library.
lib = Library::LookupLibrary(Symbols::DartProfiler());
lib = Library::LookupLibrary(Symbols::DartDeveloper());
if (lib.IsNull()) {
lib = Library::NewLibraryHelper(Symbols::DartProfiler(), true);
lib = Library::NewLibraryHelper(Symbols::DartDeveloper(), true);
lib.SetLoadRequested();
lib.Register();
object_store->set_bootstrap_library(ObjectStore::kProfiler, lib);
object_store->set_bootstrap_library(ObjectStore::kDeveloper, lib);
}
ASSERT(!lib.IsNull());
ASSERT(lib.raw() == Library::ProfilerLibrary());
ASSERT(lib.raw() == Library::DeveloperLibrary());
lib = Library::LookupLibrary(Symbols::DartProfiler());
lib = Library::LookupLibrary(Symbols::DartDeveloper());
ASSERT(!lib.IsNull());
cls = Class::New<UserTag>();
RegisterPrivateClass(cls, Symbols::_UserTag(), lib);
@@ -9863,11 +9863,6 @@ RawLibrary* Library::NativeWrappersLibrary() {
}
RawLibrary* Library::ProfilerLibrary() {
return Isolate::Current()->object_store()->profiler_library();
}
RawLibrary* Library::TypedDataLibrary() {
return Isolate::Current()->object_store()->typed_data_library();
}
@@ -10481,12 +10476,12 @@ void Library::CheckFunctionFingerprints() {
POLYMORPHIC_TARGET_LIST(CHECK_FINGERPRINTS);
all_libs.Clear();
all_libs.Add(&Library::ZoneHandle(Library::MathLibrary()));
MATH_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
all_libs.Add(&Library::ZoneHandle(Library::DeveloperLibrary()));
DEVELOPER_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
all_libs.Clear();
all_libs.Add(&Library::ZoneHandle(Library::ProfilerLibrary()));
PROFILER_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
all_libs.Add(&Library::ZoneHandle(Library::MathLibrary()));
MATH_LIB_INTRINSIC_LIST(CHECK_FINGERPRINTS);
all_libs.Clear();
all_libs.Add(&Library::ZoneHandle(Library::TypedDataLibrary()));
-1
View File
@@ -3051,7 +3051,6 @@ class Library : public Object {
static RawLibrary* MathLibrary();
static RawLibrary* MirrorsLibrary();
static RawLibrary* NativeWrappersLibrary();
static RawLibrary* ProfilerLibrary();
static RawLibrary* TypedDataLibrary();
// Eagerly compile all classes and functions in the library.
-1
View File
@@ -68,7 +68,6 @@ ObjectStore::ObjectStore()
math_library_(Library::null()),
mirrors_library_(Library::null()),
native_wrappers_library_(Library::null()),
profiler_library_(Library::null()),
root_library_(Library::null()),
typed_data_library_(Library::null()),
libraries_(GrowableObjectArray::null()),
-6
View File
@@ -30,7 +30,6 @@ class ObjectStore {
kIsolate,
kMath,
kMirrors,
kProfiler,
kTypedData,
};
@@ -263,7 +262,6 @@ class ObjectStore {
RawLibrary* isolate_library() const { return isolate_library_; }
RawLibrary* math_library() const { return math_library_; }
RawLibrary* mirrors_library() const { return mirrors_library_; }
RawLibrary* profiler_library() const { return profiler_library_; }
RawLibrary* typed_data_library() const { return typed_data_library_; }
void set_bootstrap_library(BootstrapLibraryId index, const Library& value) {
@@ -295,9 +293,6 @@ class ObjectStore {
case kMirrors:
mirrors_library_ = value.raw();
break;
case kProfiler:
profiler_library_ = value.raw();
break;
case kTypedData:
typed_data_library_ = value.raw();
break;
@@ -495,7 +490,6 @@ class ObjectStore {
RawLibrary* math_library_;
RawLibrary* mirrors_library_;
RawLibrary* native_wrappers_library_;
RawLibrary* profiler_library_;
RawLibrary* root_library_;
RawLibrary* typed_data_library_;
RawGrowableObjectArray* libraries_;
+1 -1
View File
@@ -1927,7 +1927,7 @@ static bool RemoveBreakpoint(Isolate* isolate, JSONStream* js) {
static RawClass* GetMetricsClass(Isolate* isolate) {
const Library& prof_lib =
Library::Handle(isolate, Library::ProfilerLibrary());
Library::Handle(isolate, Library::DeveloperLibrary());
ASSERT(!prof_lib.IsNull());
const String& metrics_cls_name =
String::Handle(isolate, String::New("Metrics"));
+1 -1
View File
@@ -321,12 +321,12 @@ class ObjectPointerVisitor;
V(DartNativeWrappersLibName, "dart.nativewrappers") \
V(DartCore, "dart:core") \
V(DartCollection, "dart:collection") \
V(DartDeveloper, "dart:developer") \
V(DartInternal, "dart:_internal") \
V(DartIsolate, "dart:isolate") \
V(DartMirrors, "dart:mirrors") \
V(DartTypedData, "dart:typed_data") \
V(DartVMService, "dart:vmservice") \
V(DartProfiler, "dart:profiler") \
V(DartIOLibName, "dart.io") \
V(EvalSourceUri, "evaluate:source") \
V(_Random, "_Random") \
-88
View File
@@ -25,8 +25,6 @@
'math_patch_cc_file': '<(gen_source_dir)/math_patch_gen.cc',
'mirrors_cc_file': '<(gen_source_dir)/mirrors_gen.cc',
'mirrors_patch_cc_file': '<(gen_source_dir)/mirrors_patch_gen.cc',
'profiler_cc_file': '<(gen_source_dir)/profiler_gen.cc',
'profiler_patch_cc_file': '<(gen_source_dir)/profiler_patch_gen.cc',
'service_cc_file': '<(gen_source_dir)/service_gen.cc',
'snapshot_test_dat_file': '<(gen_source_dir)/snapshot_test.dat',
'snapshot_test_in_dat_file': 'snapshot_test_in.dat',
@@ -195,8 +193,6 @@
'generate_math_patch_cc_file#host',
'generate_mirrors_cc_file#host',
'generate_mirrors_patch_cc_file#host',
'generate_profiler_cc_file#host',
'generate_profiler_patch_cc_file#host',
'generate_typed_data_cc_file#host',
'generate_typed_data_patch_cc_file#host',
],
@@ -209,7 +205,6 @@
'../lib/isolate_sources.gypi',
'../lib/math_sources.gypi',
'../lib/mirrors_sources.gypi',
'../lib/profiler_sources.gypi',
'../lib/typed_data_sources.gypi',
],
'sources': [
@@ -233,8 +228,6 @@
'<(math_patch_cc_file)',
'<(mirrors_cc_file)',
'<(mirrors_patch_cc_file)',
'<(profiler_cc_file)',
'<(profiler_patch_cc_file)',
'<(typed_data_cc_file)',
'<(typed_data_patch_cc_file)',
],
@@ -255,7 +248,6 @@
'../lib/isolate_sources.gypi',
'../lib/math_sources.gypi',
'../lib/mirrors_sources.gypi',
'../lib/profiler_sources.gypi',
'../lib/typed_data_sources.gypi',
],
'sources': [
@@ -984,86 +976,6 @@
},
]
},
{
'target_name': 'generate_profiler_cc_file',
'type': 'none',
'toolsets':['host'],
'includes': [
# Load the shared library sources.
'../../sdk/lib/profiler/profiler_sources.gypi',
],
'sources/': [
# Exclude all .[cc|h] files.
# This is only here for reference. Excludes happen after
# variable expansion, so the script has to do its own
# exclude processing of the sources being passed.
['exclude', '\\.cc|h$'],
],
'actions': [
{
'action_name': 'generate_profiler_cc',
'inputs': [
'../tools/gen_library_src_paths.py',
'<(libgen_in_cc_file)',
'<@(_sources)',
],
'outputs': [
'<(profiler_cc_file)',
],
'action': [
'python',
'tools/gen_library_src_paths.py',
'--output', '<(profiler_cc_file)',
'--input_cc', '<(libgen_in_cc_file)',
'--include', 'vm/bootstrap.h',
'--var_name', 'dart::Bootstrap::profiler_source_paths_',
'--library_name', 'dart:profiler',
'<@(_sources)',
],
'message': 'Generating ''<(profiler_cc_file)'' file.'
},
]
},
{
'target_name': 'generate_profiler_patch_cc_file',
'type': 'none',
'toolsets':['host'],
'includes': [
# Load the runtime implementation sources.
'../lib/profiler_sources.gypi',
],
'sources/': [
# Exclude all .[cc|h] files.
# This is only here for reference. Excludes happen after
# variable expansion, so the script has to do its own
# exclude processing of the sources being passed.
['exclude', '\\.cc|h$'],
],
'actions': [
{
'action_name': 'generate_profiler_patch_cc',
'inputs': [
'../tools/gen_library_src_paths.py',
'<(libgen_in_cc_file)',
'<@(_sources)',
],
'outputs': [
'<(profiler_patch_cc_file)',
],
'action': [
'python',
'tools/gen_library_src_paths.py',
'--output', '<(profiler_patch_cc_file)',
'--input_cc', '<(libgen_in_cc_file)',
'--include', 'vm/bootstrap.h',
'--var_name', 'dart::Bootstrap::profiler_patch_paths_',
'--library_name', 'dart:profiler',
'<@(_sources)',
],
'message': 'Generating ''<(profiler_patch_cc_file)'' file.'
},
]
},
{
'target_name': 'generate_developer_cc_file',
'type': 'none',
+4
View File
@@ -11,6 +11,10 @@
///
library dart.developer;
import 'dart:convert';
part 'profiler.dart';
/// If [when] is true, stop the program as if a breakpoint where hit at the
/// following statement. Returns the value of [when]. Some debuggers may
/// display [msg].
+1
View File
@@ -5,6 +5,7 @@
{
'sources': [
'developer.dart',
'profiler.dart',
# The above file needs to be first if additional parts are added to the lib.
],
}
@@ -3,9 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
/// Instrument your code with counters, gauges, and more.
library dart.profiler;
import 'dart:convert';
part of dart.developer;
/// A UserTag can be used to group samples in the Observatory profiler.
abstract class UserTag {
-10
View File
@@ -1,10 +0,0 @@
# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
{
'sources': [
'profiler.dart',
# The above file needs to be first if additional parts are added to the lib.
],
}
@@ -9,7 +9,7 @@ import 'dart:async';
import 'dart:io';
import 'dart:profiler' show
import 'dart:developer' show
UserTag;
import 'package:dart2js_incremental/dart2js_incremental.dart' show
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
//
import 'dart:profiler';
import 'dart:developer';
import 'package:expect/expect.dart';
testGaugeDouble() {
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
//
import 'dart:profiler';
import 'dart:developer';
import 'package:expect/expect.dart';
testGauge1() {
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
//
import 'dart:profiler';
import 'dart:developer';
import 'package:expect/expect.dart';
// Test that the default tag is set.
+3 -3
View File
@@ -282,8 +282,8 @@ mirrors/deferred_type_test: StaticWarning, OK # Deliberately referes to a deferr
mirrors/deferred_mirrors_metadata_test: Fail # Issue 17522
profiler/metrics_test: Fail # Issue 20309
profiler/metrics_num_test: Fail # Issue 20309
developer/metrics_test: Fail # Issue 20309
developer/metrics_num_test: Fail # Issue 20309
async/future_test: StaticWarning, OK # Deliberately broken implementation.
@@ -305,7 +305,7 @@ convert/utf85_test: Skip # Pass, Slow Issue 12644.
mirrors/mirrors_reader_test: Pass, Slow
[ $compiler == dart2js ]
profiler/metrics_num_test: Skip # Because of a int / double type test.
developer/metrics_num_test: Skip # Because of a int / double type test.
[ $arch == simarm64 ]
convert/utf85_test: Skip # Pass, Slow Issue 20111.
+1 -1
View File
@@ -210,7 +210,7 @@ def Main():
join('html', 'dart2js'), join('html', 'dartium'),
join('html', 'html_common'),
join('indexed_db', 'dart2js'), join('indexed_db', 'dartium'),
'js', 'math', 'mirrors', 'profiler', 'typed_data',
'js', 'math', 'mirrors', 'typed_data',
join('svg', 'dart2js'), join('svg', 'dartium'),
join('web_audio', 'dart2js'), join('web_audio', 'dartium'),
join('web_gl', 'dart2js'), join('web_gl', 'dartium'),