Version 0.2.9.4
Cherrypick the following changes from bleeding_edge into trunk:
16107 16112 16114 16120 16134 16137
git-svn-id: http://dart.googlecode.com/svn/trunk@16138 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/runtime/lib/identical_patch.dart b/runtime/lib/identical_patch.dart
index 218b3c8..3ea32de 100644
--- a/runtime/lib/identical_patch.dart
+++ b/runtime/lib/identical_patch.dart
@@ -2,6 +2,4 @@
// 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.
-patch bool identical(Object a, Object b) {
- throw new Error('Should not reach the body of identical');
-}
+patch bool identical(Object a, Object b) => a === b;
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index 68a0530..7e41881 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -220,7 +220,10 @@
result = page->object_start();
// Enqueue the remainder in the free list.
uword free_start = result + size;
- freelist_[type].Free(free_start, page->object_end() - free_start);
+ intptr_t free_size = page->object_end() - free_start;
+ if (free_size > 0) {
+ freelist_[type].Free(free_start, free_size);
+ }
}
} else {
// Large page allocation.
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
index e0d1fba..6810dac 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart
@@ -21,6 +21,7 @@
return """
function(cls, constructor, prototype) {
constructor.prototype = prototype;
+ constructor.builtin\$cls = cls;
return constructor;
}""";
}
diff --git a/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
index b375a97..e7054ce 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/core_patch.dart
@@ -213,6 +213,6 @@
}
// Patch for 'identical' function.
-patch bool identical(Object a, Object b) {
- throw new Error('Should not reach the body of identical');
-}
+// This is very magical: the compiler knows how to optimize a call to
+// identical, so we can just express identical in terms of itself.
+patch bool identical(Object a, Object b) => identical(a, b);
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index ebbec8c..d3dfdbc 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -3413,7 +3413,7 @@
return;
}
- if (identical(element, compiler.identicalFunction)) {
+ if (element.declaration == compiler.identicalFunction) {
pushWithPosition(new HIdentity(target, inputs[1], inputs[2]), node);
return;
}
diff --git a/tests/language/identical_closure_test.dart b/tests/language/identical_closure_test.dart
new file mode 100644
index 0000000..d4d9088
--- /dev/null
+++ b/tests/language/identical_closure_test.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2012, 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.
+
+var myIdentical = identical;
+
+main() {
+ Expect.isTrue(myIdentical(42, 42));
+}
diff --git a/tools/VERSION b/tools/VERSION
index 9f96371..690c093 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -1,4 +1,4 @@
MAJOR 0
MINOR 2
BUILD 9
-PATCH 3
+PATCH 4
diff --git a/utils/pub/command_lish.dart b/utils/pub/command_lish.dart
index 01c03bc..df0f21d 100644
--- a/utils/pub/command_lish.dart
+++ b/utils/pub/command_lish.dart
@@ -149,9 +149,10 @@
git.isInstalled
]).chain((results) {
if (results[0] && results[1]) {
- // List all files that aren't gitignored, including those not checked in
- // to Git.
- return git.run(["ls-files", "--cached", "--others"]);
+ // List all files that aren't gitignored, including those not checked
+ // in to Git.
+ return git.run(["ls-files", "--cached", "--others",
+ "--exclude-standard"]);
}
return listDir(rootDir, recursive: true).chain((entries) {