Skip to content

Instantly share code, notes, and snippets.

View mraleph's full-sized avatar
🐌

Slava Egorov mraleph

🐌
View GitHub Profile
#include <stdio.h> // for fprintf()
#include <fcntl.h>
#include <unistd.h> // for close(), read()
#include <sys/epoll.h> // for epoll_create1(), epoll_ctl(), struct epoll_event
#include <string.h> // for strncmp
#include <errno.h>
const int kMaxEvents = 5;
const int kReadSize = 5;
  1. Make a folder somewhere that will contain engine and framework checkouts. The rest of instructions assumes that $flt points to that folder.
  2. Into $flt/flutter get flutter by
    $ cd $flt
    $ git clone https://github.com/flutter/flutter
  3. Add $flt/flutter/bin to your path, run flutter doctor and fix issues if any are reported.
  4. Into $flt/engine get engine checkout following these instructions. Make sure to run dependency installation scripts as described there.
  5. In $flt/engine/src/third_party/dart switch to master and pull upto HEAD
Future<void> f() async {
print("f invoked");
await Future.value(10);
print("f continued");
}
Future<void> g() async {
print("g invoked");
await Future.value(10);
print("g continued");
diff --git a/runtime/tests/vm/dart/regress_33999_test.dart b/runtime/tests/vm/dart/regress_33999_test.dart
index 933d2e0bef..21c3930afd 100644
--- a/runtime/tests/vm/dart/regress_33999_test.dart
+++ b/runtime/tests/vm/dart/regress_33999_test.dart
@@ -8,12 +8,14 @@
// Class with two type parameters.
class A<U, T> {
- T field;
+ T field1;
@mraleph
mraleph / ffi.md
Last active November 11, 2023 14:44

Dart VM FFI Vision

Background

The aim of Dart FFI project (tracked as Issue #34452) is to provide a low boilerplate, low ceremony & low overhead way of interoperating with native C/C++ code.

The motivation behind this project is twofold:

function createSlowObject() {
let obj = {};
for (let i = 0; i < 100; i++) {
obj['f' + i] = i;
}
return obj;
}
diff --git a/third_party/gtest/BUILD.gn b/third_party/gtest/BUILD.gn
index db5f4a56..f47d0437 100644
--- a/third_party/gtest/BUILD.gn
+++ b/third_party/gtest/BUILD.gn
@@ -41,7 +41,7 @@ if (crashpad_is_in_chromium) {
"//third_party/googletest:gmock",
]
}
-} else if (crashpad_is_standalone) {
+} else if (crashpad_is_external || crashpad_is_standalone) {
  1. Make a folder somewhere that will contain engine and framework checkouts. The rest of instructions assumes that $flt points to that folder.
  2. Into $flt/flutter get flutter by
    $ cd $flt
    $ git clone https://github.com/flutter/flutter
  3. Add $flt/flutter/bin to your path, run flutter doctor and fix issues if any are reported.
  4. Into $flt/engine get engine checkout following these instructions. Make sure to run dependency installation scripts as described there.
  5. In $flt/engine/src/third_party/dart switch to master and pull upto HEAD

Background: How we handle mismatched closure invocations

Closures (unlike other methods) can be invoked with mismatched arguments, which then should result in Object.noSuchMethod invocation.

We implement it by tail-calling to the CallClosureNoSuchMethod stub if we discover an arity mismatch or a unmatched named argument. The stub gets original arguments and original argument descriptor and simply redirects to runtime function InvokeClosureNoSuchMethod which does all the heavy lifting related to

@mraleph
mraleph / code.asm
Created February 18, 2018 17:10
charCodeAt lowering
--- Raw source ---
(str, i) {
return str.charCodeAt(i);
}
--- Optimized code ---
optimization_id = 0
source_position = 14
kind = OPTIMIZED_FUNCTION