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

Side by Side Diff: src/vm/ffi.cc

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/vm/ffi.h ('k') | src/vm/ffi_disabled.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 #include "src/vm/ffi.h" 5 #include "src/vm/ffi.h"
6 6
7 #include "src/shared/asan_helper.h" 7 #include "src/shared/asan_helper.h"
8 #include "src/vm/natives.h" 8 #include "src/vm/natives.h"
9 #include "src/vm/object.h" 9 #include "src/vm/object.h"
10 #include "src/vm/port.h" 10 #include "src/vm/port.h"
11 #include "src/vm/process.h" 11 #include "src/vm/process.h"
12 12
13 namespace fletch { 13 namespace dartino {
14 14
15 BEGIN_NATIVE(ForeignAllocate) { 15 BEGIN_NATIVE(ForeignAllocate) {
16 if (!arguments[0]->IsSmi() && !arguments[0]->IsLargeInteger()) { 16 if (!arguments[0]->IsSmi() && !arguments[0]->IsLargeInteger()) {
17 return Failure::wrong_argument_type(); 17 return Failure::wrong_argument_type();
18 } 18 }
19 word size = AsForeignWord(arguments[0]); 19 word size = AsForeignWord(arguments[0]);
20 Object* result = process->NewInteger(0); 20 Object* result = process->NewInteger(0);
21 if (result->IsRetryAfterGCFailure()) return result; 21 if (result->IsRetryAfterGCFailure()) return result;
22 void* calloc_value = calloc(1, size); 22 void* calloc_value = calloc(1, size);
23 uint64 value = reinterpret_cast<uint64>(calloc_value); 23 uint64 value = reinterpret_cast<uint64>(calloc_value);
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 *address = Double::cast(value)->value(); \ 413 *address = Double::cast(value)->value(); \
414 return value; \ 414 return value; \
415 } \ 415 } \
416 END_NATIVE() 416 END_NATIVE()
417 417
418 DEFINE_FOREIGN_ACCESSORS_DOUBLE(Float32, float) 418 DEFINE_FOREIGN_ACCESSORS_DOUBLE(Float32, float)
419 DEFINE_FOREIGN_ACCESSORS_DOUBLE(Float64, double) 419 DEFINE_FOREIGN_ACCESSORS_DOUBLE(Float64, double)
420 420
421 #undef DEFINE_FOREIGN_ACCESSORS 421 #undef DEFINE_FOREIGN_ACCESSORS
422 422
423 } // namespace fletch 423 } // namespace dartino
OLDNEW
« no previous file with comments | « src/vm/ffi.h ('k') | src/vm/ffi_disabled.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698