[vm] Spot fixes for Fuchsia
Change-Id: I4714f92cd2732875df584fc816228fb4b88f5828
Reviewed-on: https://dart-review.googlesource.com/c/88285
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
diff --git a/runtime/vm/compiler/assembler/assembler_arm64.cc b/runtime/vm/compiler/assembler/assembler_arm64.cc
index 7ca178c..4fb6ef4 100644
--- a/runtime/vm/compiler/assembler/assembler_arm64.cc
+++ b/runtime/vm/compiler/assembler/assembler_arm64.cc
@@ -1206,7 +1206,7 @@
#if defined(TARGET_OS_FUCHSIA)
// Make any future signal handlers fail fast. Verifies our assumption in
// EnterFrame.
- LoadImmediate(CSP, 0);
+ orri(CSP, ZR, Immediate(16));
#endif
}
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 1c828d1..7d9b8f5 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -2342,7 +2342,7 @@
DART_EXPORT Dart_Handle Dart_StringLength(Dart_Handle str, intptr_t* len) {
Thread* thread = Thread::Current();
- CHECK_ISOLATE(thread->isolate());
+ DARTSCOPE(thread);
ReusableObjectHandleScope reused_obj_handle(thread);
const String& str_obj = Api::UnwrapStringHandle(reused_obj_handle, str);
if (str_obj.IsNull()) {
diff --git a/runtime/vm/flag_list.h b/runtime/vm/flag_list.h
index 1228d17..d11e203 100644
--- a/runtime/vm/flag_list.h
+++ b/runtime/vm/flag_list.h
@@ -188,7 +188,7 @@
D(trace_zones, bool, false, "Traces allocation sizes in the zone.") \
P(truncating_left_shift, bool, true, \
"Optimize left shift to truncate if possible") \
- C(use_bytecode_compiler, false, false, bool, false, "Compile from bytecode") \
+ P(use_bytecode_compiler, bool, false, "Compile from bytecode") \
P(use_compactor, bool, false, "Compact the heap during old-space GC.") \
P(use_cha_deopt, bool, true, \
"Use class hierarchy analysis even if it can cause deoptimization.") \
diff --git a/runtime/vm/object_id_ring_test.cc b/runtime/vm/object_id_ring_test.cc
index 92d3400..23593a7 100644
--- a/runtime/vm/object_id_ring_test.cc
+++ b/runtime/vm/object_id_ring_test.cc
@@ -201,18 +201,12 @@
intptr_t raw_obj_id1 = -1;
intptr_t raw_obj_id2 = -1;
{
- Api::Scope api_scope(thread);
- Dart_Handle result;
- // Create a string in the old heap.
- result = Api::NewHandle(thread, String::New("old", Heap::kOld));
- EXPECT_VALID(result);
- intptr_t string_length = 0;
- // Inspect string.
- EXPECT(!Dart_IsNull(result));
- EXPECT(Dart_IsString(result));
- EXPECT_VALID(Dart_StringLength(result, &string_length));
- EXPECT_EQ(3, string_length);
- RawObject* raw_obj = Api::UnwrapHandle(result);
+ HandleScope handle_scope(thread);
+ const String& str = String::Handle(String::New("old", Heap::kOld));
+ EXPECT(!str.IsNull());
+ EXPECT_EQ(3, str.Length());
+
+ RawObject* raw_obj = Object::RawCast(str.raw());
// Verify that it is located in old heap.
EXPECT(raw_obj->IsOldObject());
EXPECT_NE(Object::null(), raw_obj);
@@ -228,7 +222,7 @@
EXPECT_NE(Object::null(), raw_obj2);
EXPECT_EQ(RawObject::ToAddr(raw_obj), RawObject::ToAddr(raw_obj1));
EXPECT_EQ(RawObject::ToAddr(raw_obj), RawObject::ToAddr(raw_obj2));
- // Exit scope. Freeing result handle.
+ // Exit scope. Freeing String handle.
}
// Force a GC. No reference exist to the old string anymore. It should be
// collected and the object id ring will now return the null object for
diff --git a/sdk/lib/io/embedder_config.dart b/sdk/lib/io/embedder_config.dart
index 89265cf..cbc94f7 100644
--- a/sdk/lib/io/embedder_config.dart
+++ b/sdk/lib/io/embedder_config.dart
@@ -11,6 +11,7 @@
/// permitted to use (e.g. exit()). By default, the whole dart:io API is
/// enabled. When a disallowed operation is attempted, an `UnsupportedError` is
/// thrown.
+@pragma('vm:entry-point')
abstract class _EmbedderConfig {
/// The Isolate may set Directory.current.
static bool _mayChdir = true;
@@ -20,12 +21,15 @@
static bool _mayExit = true;
// The Isolate may set Stdin.echoMode.
+ @pragma('vm:entry-point')
static bool _maySetEchoMode = true;
// The Isolate may set Stdin.lineMode.
+ @pragma('vm:entry-point')
static bool _maySetLineMode = true;
/// The Isolate may call sleep().
+ @pragma('vm:entry-point')
static bool _maySleep = true;
// TODO(zra): Consider adding: