Version 1.6.0-dev.9.1
svn merge -c 39206 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 39209 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 39210 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 39212 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
svn merge -c 39219 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
git-svn-id: http://dart.googlecode.com/svn/trunk@39242 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/runtime/bin/vmservice/observatory/test/packages b/runtime/bin/vmservice/observatory/test/packages
deleted file mode 120000
index a16c405..0000000
--- a/runtime/bin/vmservice/observatory/test/packages
+++ /dev/null
@@ -1 +0,0 @@
-../packages
\ No newline at end of file
diff --git a/runtime/platform/signal_blocker.h b/runtime/platform/signal_blocker.h
index f05e134..45d09aa 100644
--- a/runtime/platform/signal_blocker.h
+++ b/runtime/platform/signal_blocker.h
@@ -12,6 +12,7 @@
#error Do not include this file on Windows.
#endif
+#include <pthread.h>
#include <signal.h> // NOLINT
namespace dart {
diff --git a/runtime/vm/ast.h b/runtime/vm/ast.h
index 113009f..26a6be2 100644
--- a/runtime/vm/ast.h
+++ b/runtime/vm/ast.h
@@ -524,7 +524,6 @@
: AstNode(token_pos),
value_(new LiteralNode(token_pos, Instance::ZoneHandle())),
inlined_finally_list_(),
- saved_return_value_var_(NULL),
is_regular_return_(true) { }
// Return from a non-void function.
ReturnNode(intptr_t token_pos,
@@ -532,7 +531,6 @@
: AstNode(token_pos),
value_(value),
inlined_finally_list_(),
- saved_return_value_var_(NULL),
is_regular_return_(true) {
ASSERT(value_ != NULL);
}
@@ -549,13 +547,6 @@
inlined_finally_list_.Add(finally_node);
}
- LocalVariable* saved_return_value_var() const {
- return saved_return_value_var_;
- }
- void set_saved_return_value_var(LocalVariable* var) {
- saved_return_value_var_ = var;
- }
-
virtual void VisitChildren(AstNodeVisitor* visitor) const {
if (value() != NULL) {
value()->Visit(visitor);
@@ -573,7 +564,6 @@
private:
AstNode* value_;
GrowableArray<InlinedFinallyNode*> inlined_finally_list_;
- LocalVariable* saved_return_value_var_;
LocalScope* scope_;
bool is_regular_return_;
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 2927213..ded5990 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -992,7 +992,8 @@
Value* return_value = for_value.value();
if (node->inlined_finally_list_length() > 0) {
- LocalVariable* temp = node->saved_return_value_var();
+ LocalVariable* temp = owner()->parsed_function()->finally_return_temp_var();
+ ASSERT(temp != NULL);
Do(BuildStoreLocal(*temp, return_value));
for (intptr_t i = 0; i < node->inlined_finally_list_length(); i++) {
InlineBailout("EffectGraphVisitor::VisitReturnNode (exception)");
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index e1794f1..f87763f 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -115,9 +115,9 @@
LocalVariable* ParsedFunction::EnsureExpressionTemp() {
if (!has_expression_temp_var()) {
LocalVariable* temp =
- new LocalVariable(function_.token_pos(),
- Symbols::ExprTemp(),
- Type::ZoneHandle(Type::DynamicType()));
+ new (I) LocalVariable(function_.token_pos(),
+ Symbols::ExprTemp(),
+ Type::ZoneHandle(Type::DynamicType()));
ASSERT(temp != NULL);
set_expression_temp_var(temp);
}
@@ -126,6 +126,20 @@
}
+void ParsedFunction::EnsureFinallyReturnTemp() {
+ if (!has_finally_return_temp_var()) {
+ LocalVariable* temp = new(I) LocalVariable(
+ function_.token_pos(),
+ String::ZoneHandle(I, Symbols::New(":finally_ret_val")),
+ Type::ZoneHandle(I, Type::DynamicType()));
+ ASSERT(temp != NULL);
+ temp->set_is_final();
+ set_finally_return_temp_var(temp);
+ }
+ ASSERT(has_finally_return_temp_var());
+}
+
+
void ParsedFunction::SetNodeSequence(SequenceNode* node_sequence) {
ASSERT(node_sequence_ == NULL);
ASSERT(node_sequence != NULL);
@@ -843,6 +857,10 @@
node_sequence->scope()->AddVariable(
parsed_function->saved_current_context_var());
}
+ if (parsed_function->has_finally_return_temp_var()) {
+ node_sequence->scope()->AddVariable(
+ parsed_function->finally_return_temp_var());
+ }
parsed_function->SetNodeSequence(node_sequence);
// The instantiator may be required at run time for generic type checks or
@@ -1114,15 +1132,16 @@
LocalVariable* context_var =
current_block_->scope->LocalLookupVariable(Symbols::SavedTryContextVar());
if (context_var == NULL) {
- context_var = new LocalVariable(token_pos,
- Symbols::SavedTryContextVar(),
- Type::ZoneHandle(I, Type::DynamicType()));
+ context_var = new(I) LocalVariable(
+ token_pos,
+ Symbols::SavedTryContextVar(),
+ Type::ZoneHandle(I, Type::DynamicType()));
current_block_->scope->AddVariable(context_var);
}
LocalVariable* catch_excp_var =
current_block_->scope->LocalLookupVariable(Symbols::ExceptionVar());
if (catch_excp_var == NULL) {
- catch_excp_var = new LocalVariable(
+ catch_excp_var = new (I) LocalVariable(
token_pos,
Symbols::ExceptionVar(),
Type::ZoneHandle(I, Type::DynamicType()));
@@ -1131,7 +1150,7 @@
LocalVariable* catch_trace_var =
current_block_->scope->LocalLookupVariable(Symbols::StackTraceVar());
if (catch_trace_var == NULL) {
- catch_trace_var = new LocalVariable(
+ catch_trace_var = new (I) LocalVariable(
token_pos,
Symbols::StackTraceVar(),
Type::ZoneHandle(I, Type::DynamicType()));
@@ -6076,8 +6095,8 @@
// Add the function variable to the scope before parsing the function in
// order to allow self reference from inside the function.
function_variable = new(I) LocalVariable(function_pos,
- *variable_name,
- function_type);
+ *variable_name,
+ function_type);
function_variable->set_is_final();
ASSERT(current_block_ != NULL);
ASSERT(current_block_->scope != NULL);
@@ -7247,12 +7266,8 @@
InlinedFinallyNode* finally_node) {
ReturnNode* return_node = node->AsReturnNode();
if (return_node != NULL) {
+ parsed_function()->EnsureFinallyReturnTemp();
return_node->AddInlinedFinallyNode(finally_node);
- if (return_node->saved_return_value_var() == NULL) {
- LocalVariable* temp =
- CreateTempConstVariable(node->token_pos(), "finally_ret_val");
- return_node->set_saved_return_value_var(temp);
- }
return;
}
JumpNode* jump_node = node->AsJumpNode();
@@ -7533,9 +7548,9 @@
while (node_to_inline != NULL) {
finally_block = ParseFinallyBlock();
InlinedFinallyNode* node = new(I) InlinedFinallyNode(finally_pos,
- finally_block,
- context_var,
- outer_try_index);
+ finally_block,
+ context_var,
+ outer_try_index);
AddFinallyBlockToNode(node_to_inline, node);
node_index += 1;
node_to_inline = inner_try_block->GetNodeToInlineFinally(node_index);
diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
index b2fbfe6..2c5acf3 100644
--- a/runtime/vm/parser.h
+++ b/runtime/vm/parser.h
@@ -47,6 +47,7 @@
saved_current_context_var_(NULL),
saved_entry_context_var_(NULL),
expression_temp_var_(NULL),
+ finally_return_temp_var_(NULL),
deferred_prefixes_(new ZoneGrowableArray<const LibraryPrefix*>()),
first_parameter_index_(0),
first_stack_local_index_(0),
@@ -107,6 +108,20 @@
bool has_expression_temp_var() const {
return expression_temp_var_ != NULL;
}
+
+ LocalVariable* finally_return_temp_var() const {
+ ASSERT(has_finally_return_temp_var());
+ return finally_return_temp_var_;
+ }
+ void set_finally_return_temp_var(LocalVariable* value) {
+ ASSERT(!has_finally_return_temp_var());
+ finally_return_temp_var_ = value;
+ }
+ bool has_finally_return_temp_var() const {
+ return finally_return_temp_var_ != NULL;
+ }
+ void EnsureFinallyReturnTemp();
+
static LocalVariable* CreateExpressionTempVar(intptr_t token_pos);
LocalVariable* EnsureExpressionTemp();
@@ -134,6 +149,7 @@
LocalVariable* saved_current_context_var_;
LocalVariable* saved_entry_context_var_;
LocalVariable* expression_temp_var_;
+ LocalVariable* finally_return_temp_var_;
ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_;
int first_parameter_index_;
diff --git a/sdk/lib/_internal/pub/lib/src/global_packages.dart b/sdk/lib/_internal/pub/lib/src/global_packages.dart
index c47e979..0baa650 100644
--- a/sdk/lib/_internal/pub/lib/src/global_packages.dart
+++ b/sdk/lib/_internal/pub/lib/src/global_packages.dart
@@ -63,27 +63,24 @@
/// Finds the latest version of the hosted package with [name] that matches
/// [constraint] and makes it the active global version.
Future activateHosted(String name, VersionConstraint constraint) {
- // See if we already have it activated.
- var lockFile = _describeActive(name);
- var currentVersion;
- if (lockFile != null) {
- var id = lockFile.packages[name];
+ _describeActive(name);
- // Try to preserve the current version if we've already activated the
- // hosted package.
- if (id.source == "hosted") currentVersion = id.version;
+ var source = cache.sources["hosted"];
+ return source.getVersions(name, name).then((versions) {
+ versions = versions.where(constraint.allows).toList();
- // Pull the root package out of the lock file so the solver doesn't see
- // it.
- lockFile.packages.remove(name);
- } else {
- lockFile = new LockFile.empty();
- }
+ if (versions.isEmpty) {
+ // TODO(rnystrom): Show most recent unmatching version?
+ dataError("Package ${log.bold(name)} has no versions that match "
+ "$constraint.");
+ }
- return _selectVersion(name, currentVersion, constraint).then((version) {
+ // Pick the best matching version.
+ versions.sort(Version.prioritize);
+
// Make sure it's in the cache.
- var id = new PackageId(name, "hosted", version, name);
- return _installInCache(id, lockFile);
+ var id = new PackageId(name, "hosted", versions.last, name);
+ return _installInCache(id);
});
}
@@ -106,9 +103,8 @@
});
}
- /// Installs the package [id] with [lockFile] into the system cache along
- /// with its dependencies.
- Future _installInCache(PackageId id, LockFile lockFile) {
+ /// Installs the package [id] and its dependencies into the system cache.
+ Future _installInCache(PackageId id) {
var source = cache.sources[id.source];
// Put the main package in the cache.
@@ -123,8 +119,7 @@
id = id_;
// Resolve it and download its dependencies.
- return resolveVersions(SolveType.GET, cache.sources, package,
- lockFile: lockFile);
+ return resolveVersions(SolveType.GET, cache.sources, package);
});
}).then((result) {
if (!result.succeeded) throw result.error;
@@ -172,11 +167,8 @@
// user can run.
}
- /// Gets the lock file for the currently active package with [name].
- ///
- /// Displays a message to the user about the current package, if any. Returns
- /// the [LockFile] for the active package or `null` otherwise.
- LockFile _describeActive(String package) {
+ /// Shows the user the currently active package with [name], if any.
+ void _describeActive(String package) {
try {
var lockFile = new LockFile.load(_getLockFilePath(package),
cache.sources);
@@ -190,8 +182,6 @@
log.message("Package ${log.bold(package)} is currently active at "
"version ${log.bold(id.version)}.");
}
-
- return lockFile;
} on IOException catch (error) {
// If we couldn't read the lock file, it's not activated.
return null;
@@ -261,35 +251,6 @@
});
}
- /// Picks the best hosted version of [package] to activate that meets
- /// [constraint].
- ///
- /// If [version] is not `null`, this tries to maintain that version if
- /// possible.
- Future<Version> _selectVersion(String package, Version version,
- VersionConstraint constraint) {
- // If we already have a valid active version, just use it.
- if (version != null && constraint.allows(version)) {
- return new Future.value(version);
- }
-
- // Otherwise, select the best version the matches the constraint.
- var source = cache.sources["hosted"];
- return source.getVersions(package, package).then((versions) {
- versions = versions.where(constraint.allows).toList();
-
- if (versions.isEmpty) {
- // TODO(rnystrom): Show most recent unmatching version?
- dataError("Package ${log.bold(package)} has no versions that match "
- "$constraint.");
- }
-
- // Pick the best matching version.
- versions.sort(Version.prioritize);
- return versions.last;
- });
- }
-
/// Gets the path to the lock file for an activated cached package with
/// [name].
String _getLockFilePath(name) => p.join(_directory, name + ".lock");
diff --git a/sdk/lib/_internal/pub/test/global/activate/same_version_test.dart b/sdk/lib/_internal/pub/test/global/activate/ignores_active_version_test.dart
similarity index 78%
rename from sdk/lib/_internal/pub/test/global/activate/same_version_test.dart
rename to sdk/lib/_internal/pub/test/global/activate/ignores_active_version_test.dart
index 3d02098..3650855 100644
--- a/sdk/lib/_internal/pub/test/global/activate/same_version_test.dart
+++ b/sdk/lib/_internal/pub/test/global/activate/ignores_active_version_test.dart
@@ -6,7 +6,7 @@
main() {
initConfig();
- integration('keeps previously activated version if it meets the constraint',
+ integration('ignores previously activated version',
() {
servePackages([
packageMap("foo", "1.2.3"),
@@ -16,10 +16,11 @@
// Activate 1.2.3.
schedulePub(args: ["global", "activate", "foo", "1.2.3"]);
- // Activating it again re-resolves but maintains the version.
+ // Activating it again resolves to the new best version.
schedulePub(args: ["global", "activate", "foo", ">1.0.0"], output: """
Package foo is currently active at version 1.2.3.
+Downloading foo 1.3.0...
Resolving dependencies...
-Activated foo 1.2.3.""");
+Activated foo 1.3.0.""");
});
}
diff --git a/tests/language/language.status b/tests/language/language.status
index c724758..c636a06 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -85,9 +85,6 @@
unicode_bom_test: Fail # Issue 16067
-[ ($compiler == none || $compiler == dart2dart) && $mode == debug ]
-issue20476_test: Crash # Issue 20476
-
[ $compiler == none && $checked ]
type_variable_bounds4_test/01: Fail # Issue 14006
diff --git a/tools/VERSION b/tools/VERSION
index 9f70d78..4d548ae 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -28,4 +28,4 @@
MINOR 6
PATCH 0
PRERELEASE 9
-PRERELEASE_PATCH 0
+PRERELEASE_PATCH 1