Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Issue 1209033003: Work in progres, please take a look and give early feedback if this is the way we want to structure… (Closed)

Created:
5 years, 5 months ago by ricow1
Modified:
5 years, 5 months ago
Reviewers:
Anders Johnsen, kasperl
CC:
fletch+reviews_googlegroups.com
Base URL:
git@github.com:dart-lang/fletch.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

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

Patch Set 1 #

Patch Set 2 : remove accidentally added stuff #

Total comments: 4

Patch Set 3 : Mac lib prefix/postfix #

Total comments: 77

Patch Set 4 : changes #

Total comments: 2

Patch Set 5 : indentation #

Total comments: 38

Patch Set 6 : address comments #

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

Messages

Total messages: 16 (2 generated)
ricow1
https://codereview.chromium.org/1209033003/diff/20001/lib/ffi/ffi.dart File lib/ffi/ffi.dart (right): https://codereview.chromium.org/1209033003/diff/20001/lib/ffi/ffi.dart#newcode12 lib/ffi/ffi.dart:12: class Foreign1 { This will be renamed Foreign once ...
5 years, 5 months ago (2015-06-29 16:55:24 UTC) #2
ricow1
Mac lib prefix/postfix
5 years, 5 months ago (2015-06-30 06:13:26 UTC) #3
Anders Johnsen
DBC https://codereview.chromium.org/1209033003/diff/40001/lib/ffi/ffi.dart File lib/ffi/ffi.dart (right): https://codereview.chromium.org/1209033003/diff/40001/lib/ffi/ffi.dart#newcode20 lib/ffi/ffi.dart:20: static const int LINUX = 1; We should ...
5 years, 5 months ago (2015-06-30 06:30:17 UTC) #5
ricow1
https://codereview.chromium.org/1209033003/diff/40001/lib/ffi/ffi.dart File lib/ffi/ffi.dart (right): https://codereview.chromium.org/1209033003/diff/40001/lib/ffi/ffi.dart#newcode166 lib/ffi/ffi.dart:166: class ForeignMemory extends ForeignPointer { On 2015/06/30 06:30:17, Anders ...
5 years, 5 months ago (2015-06-30 06:52:07 UTC) #6
kasperl
First round of comments. I think you're on the right path! https://codereview.chromium.org/1209033003/diff/40001/lib/ffi/ffi.dart File lib/ffi/ffi.dart (right): ...
5 years, 5 months ago (2015-06-30 07:16:01 UTC) #7
ricow1
Thank you both for comments. I will incorporate them, refactor IO to use the new ...
5 years, 5 months ago (2015-06-30 07:34:23 UTC) #8
ahe
https://codereview.chromium.org/1209033003/diff/40001/lib/ffi/ffi.dart File lib/ffi/ffi.dart (right): https://codereview.chromium.org/1209033003/diff/40001/lib/ffi/ffi.dart#newcode12 lib/ffi/ffi.dart:12: class Foreign1 { Can I assume that you're planning ...
5 years, 5 months ago (2015-06-30 13:16:51 UTC) #9
ricow1
On 2015/06/30 13:16:51, ahe wrote: > https://codereview.chromium.org/1209033003/diff/40001/lib/ffi/ffi.dart > File lib/ffi/ffi.dart (right): > > https://codereview.chromium.org/1209033003/diff/40001/lib/ffi/ffi.dart#newcode12 > ...
5 years, 5 months ago (2015-06-30 19:26:27 UTC) #10
ahe
On 2015/06/30 19:26:27, ricow1 wrote: > On 2015/06/30 13:16:51, ahe wrote: > > https://codereview.chromium.org/1209033003/diff/40001/lib/ffi/ffi.dart > ...
5 years, 5 months ago (2015-06-30 19:56:59 UTC) #11
ricow1
On 2015/06/30 19:56:59, ahe wrote: > On 2015/06/30 19:26:27, ricow1 wrote: > > On 2015/06/30 ...
5 years, 5 months ago (2015-07-01 04:32:39 UTC) #12
ricow1
PTAL https://codereview.chromium.org/1209033003/diff/40001/lib/ffi/ffi.dart File lib/ffi/ffi.dart (right): https://codereview.chromium.org/1209033003/diff/40001/lib/ffi/ffi.dart#newcode12 lib/ffi/ffi.dart:12: class Foreign1 { On 2015/06/30 13:16:50, ahe wrote: ...
5 years, 5 months ago (2015-07-02 16:01:57 UTC) #13
kasperl
LGTM. Good stuff. https://codereview.chromium.org/1209033003/diff/80001/lib/ffi/ffi.dart File lib/ffi/ffi.dart (right): https://codereview.chromium.org/1209033003/diff/80001/lib/ffi/ffi.dart#newcode14 lib/ffi/ffi.dart:14: int get value => _value; I'd ...
5 years, 5 months ago (2015-07-03 07:49:55 UTC) #14
ricow1
https://codereview.chromium.org/1209033003/diff/80001/lib/ffi/ffi.dart File lib/ffi/ffi.dart (right): https://codereview.chromium.org/1209033003/diff/80001/lib/ffi/ffi.dart#newcode14 lib/ffi/ffi.dart:14: int get value => _value; On 2015/07/03 07:49:54, kasperl ...
5 years, 5 months ago (2015-07-03 08:57:25 UTC) #15
ricow1
5 years, 5 months ago (2015-07-03 11:04:45 UTC) #16
Message was sent while issue was closed.
Committed patchset #6 (id:100001) manually as
97002260e4d6cfcb4d0e0d82d4ae3ade07defb96 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698