|
|
Final version, this cl splits the Foreign interface into a set of new classes:
ForeignLibrary:
Holds a pointer to an open library. The existing solution did not allow opening
libraries not linked into the main program. We still allow using directly
linked in libraries by using ForeignLibrary.main.lookup
ForeignPointer:
Holds a foreign pointer
ForeignFunction:
Hold a pointer to a foreign function, this is a subclass of ForeignPointer,
and has all the functionality for calling functions.
We still need a more generic solution for calling functions with arbritary
arguments.
ForeignMemory:
Holds a pointer to a piece of memory, and the lenght of the data. This is
a subclass of ForeignPointer. This can also be instantiated from dart using
the allocate and allocateFinalized.
This also adds some more testing, by adding a new c library that we compile and
use for validation of the functionality. This gives us the flexibility of
being more thorough in testing all our call and memory setting/getting functions.
Original working description for completeness.
Work in progres, please take a look and give early feedback if this is the way we want to structure this.
This is splitting the Foreign interface into several classes (maybe we should combine ForeignPointer and ForeignMemory).
It also adds some tests using a compiled c library that is part of this cl. We do this to actually test that we can use libraries not linked in and to better contoll what we get from there.
I still miss:
Moving dart initiated allocation logic
Remove old Foreign, and move the native functions up (but leaving them there for now allowed me to experiment with this before changing the IO logic)
I have some more testing in mind.
BUG=
R=kasperl@google.com
Committed: https://github.com/dart-lang/fletch/commit/97002260e4d6cfcb4d0e0d82d4ae3ade07defb96
Total comments: 4
Total comments: 77
Total comments: 2
Total comments: 38
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+992 lines, -2292 lines) |
Patch |
 |
M |
fletch.gyp
|
View
|
1
2
3
|
1 chunk |
+0 lines, -58 lines |
0 comments
|
Download
|
 |
M |
lib/ffi/ffi.dart
|
View
|
1
2
3
4
5
|
7 chunks |
+177 lines, -131 lines |
0 comments
|
Download
|
 |
M |
lib/io/system.dart
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
lib/io/system_linux.dart
|
View
|
1
2
3
4
5
|
5 chunks |
+13 lines, -9 lines |
0 comments
|
Download
|
 |
M |
lib/io/system_macos.dart
|
View
|
1
2
3
4
5
|
4 chunks |
+11 lines, -11 lines |
0 comments
|
Download
|
 |
M |
lib/io/system_posix.dart
|
View
|
1
2
3
4
5
|
11 chunks |
+65 lines, -44 lines |
0 comments
|
Download
|
 |
M |
lib/typed_data/typed_data_patch.dart
|
View
|
1
2
3
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
pkg/fletchc/lib/src/fletch_backend.dart
|
View
|
1
2
3
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
pkg/service/lib/struct.dart
|
View
|
1
2
3
|
10 chunks |
+15 lines, -15 lines |
0 comments
|
Download
|
 |
M |
samples/buildbot/dart/buildbot_service.dart
|
View
|
1
2
3
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
D |
samples/myapi/generated/cc/myapi_service.h
|
View
|
1
2
3
|
1 chunk |
+0 lines, -27 lines |
0 comments
|
Download
|
 |
D |
samples/myapi/generated/cc/myapi_service.cc
|
View
|
1
2
3
|
1 chunk |
+0 lines, -136 lines |
0 comments
|
Download
|
 |
D |
samples/myapi/generated/cc/struct.h
|
View
|
1
2
3
|
1 chunk |
+0 lines, -298 lines |
0 comments
|
Download
|
 |
D |
samples/myapi/generated/cc/struct.cc
|
View
|
1
2
3
|
1 chunk |
+0 lines, -298 lines |
0 comments
|
Download
|
 |
D |
samples/myapi/generated/cc/unicode.h
|
View
|
1
2
3
|
1 chunk |
+0 lines, -143 lines |
0 comments
|
Download
|
 |
D |
samples/myapi/generated/cc/unicode.cc
|
View
|
1
2
3
|
1 chunk |
+0 lines, -234 lines |
0 comments
|
Download
|
 |
D |
samples/myapi/generated/dart/myapi_service.dart
|
View
|
1
2
3
|
1 chunk |
+0 lines, -73 lines |
0 comments
|
Download
|
 |
D |
samples/myapi/generated/dart/struct.dart
|
View
|
1
2
3
|
1 chunk |
+0 lines, -395 lines |
0 comments
|
Download
|
 |
D |
samples/myapi/generated/myapi.h
|
View
|
1
2
3
|
1 chunk |
+0 lines, -54 lines |
0 comments
|
Download
|
 |
D |
samples/myapi/generated/myapi_service.idl
|
View
|
1
2
3
|
1 chunk |
+0 lines, -14 lines |
0 comments
|
Download
|
 |
D |
samples/myapi/generated/myapi_service_impl.dart
|
View
|
1
2
3
|
1 chunk |
+0 lines, -49 lines |
0 comments
|
Download
|
 |
D |
samples/myapi/myapi.gyp
|
View
|
1
2
3
|
1 chunk |
+0 lines, -30 lines |
0 comments
|
Download
|
 |
D |
samples/myapi/myapi_client.cc
|
View
|
1
2
3
|
1 chunk |
+0 lines, -83 lines |
0 comments
|
Download
|
 |
D |
samples/myapi/myapi_impl.dart
|
View
|
1
2
3
|
1 chunk |
+0 lines, -38 lines |
0 comments
|
Download
|
 |
M |
samples/todomvc/dart/todomvc_service.dart
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/shared/names.h
|
View
|
1
2
3
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/shared/natives.h
|
View
|
1
2
3
|
1 chunk |
+52 lines, -47 lines |
0 comments
|
Download
|
 |
M |
src/vm/ffi.h
|
View
|
1
2
3
4
5
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/vm/ffi.cc
|
View
|
1
2
3
|
3 chunks |
+62 lines, -1 line |
0 comments
|
Download
|
 |
A + |
src/vm/ffi_linux.cc
|
View
|
1
2
3
|
1 chunk |
+4 lines, -7 lines |
0 comments
|
Download
|
 |
A + |
src/vm/ffi_macos.cc
|
View
|
1
2
|
1 chunk |
+3 lines, -5 lines |
0 comments
|
Download
|
 |
A + |
src/vm/ffi_posix.cc
|
View
|
1
2
3
|
1 chunk |
+6 lines, -6 lines |
0 comments
|
Download
|
 |
A |
src/vm/ffi_test_library.c
|
View
|
1
2
3
|
1 chunk |
+206 lines, -0 lines |
0 comments
|
Download
|
 |
M |
src/vm/list.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
src/vm/object.h
|
View
|
1
2
3
4
5
|
3 chunks |
+30 lines, -22 lines |
0 comments
|
Download
|
 |
M |
src/vm/platform_linux.cc
|
View
|
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
 |
M |
src/vm/process.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
src/vm/program.h
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
src/vm/program.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+10 lines, -3 lines |
0 comments
|
Download
|
 |
M |
src/vm/session.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
src/vm/vm.gyp
|
View
|
|
3 chunks |
+24 lines, -0 lines |
0 comments
|
Download
|
 |
M |
tests/ffi/ffi_test.dart
|
View
|
1
2
3
4
5
|
1 chunk |
+272 lines, -36 lines |
0 comments
|
Download
|
 |
M |
tests/ffi/ffi_timeofday_test.dart
|
View
|
1
2
3
4
5
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
tests/io/file_test.dart
|
View
|
1
2
3
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
tests/service_tests/conformance/dart/conformance_service.dart
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
tests/service_tests/performance/dart/performance_service.dart
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
Total messages: 16 (2 generated)
|