OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "include/dart_api.h" | 5 #include "include/dart_api.h" |
6 | 6 |
7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
(...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1965 instance, function, args, kNoArgumentNames)); | 1965 instance, function, args, kNoArgumentNames)); |
1966 } | 1966 } |
1967 } | 1967 } |
1968 return Api::NewError("Object does not implement the 'List' interface"); | 1968 return Api::NewError("Object does not implement the 'List' interface"); |
1969 } | 1969 } |
1970 } | 1970 } |
1971 | 1971 |
1972 | 1972 |
1973 // TODO(hpayer): value should always be smaller then 0xff. Add error handling. | 1973 // TODO(hpayer): value should always be smaller then 0xff. Add error handling. |
1974 #define GET_LIST_ELEMENT_AS_BYTES(isolate, type, obj, native_array, offset, \ | 1974 #define GET_LIST_ELEMENT_AS_BYTES(isolate, type, obj, native_array, offset, \ |
1975 length) \ | 1975 length) \ |
1976 const type& array = type::Cast(obj); \ | 1976 const type& array = type::Cast(obj); \ |
1977 if (Utils::RangeCheck(offset, length, array.Length())) { \ | 1977 if (Utils::RangeCheck(offset, length, array.Length())) { \ |
1978 Object& element = Object::Handle(isolate); \ | 1978 Object& element = Object::Handle(isolate); \ |
1979 for (int i = 0; i < length; i++) { \ | 1979 for (int i = 0; i < length; i++) { \ |
1980 element = array.At(offset + i); \ | 1980 element = array.At(offset + i); \ |
1981 if (!element.IsInteger()) { \ | 1981 if (!element.IsInteger()) { \ |
1982 return Api::NewError("%s expects the argument 'list' to be " \ | 1982 return Api::NewError("%s expects the argument 'list' to be " \ |
1983 "a List of int", CURRENT_FUNC); \ | 1983 "a List of int", CURRENT_FUNC); \ |
1984 } \ | 1984 } \ |
1985 const Integer& integer = Integer::Cast(element); \ | 1985 const Integer& integer = Integer::Cast(element); \ |
(...skipping 2505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4491 } | 4491 } |
4492 { | 4492 { |
4493 NoGCScope no_gc; | 4493 NoGCScope no_gc; |
4494 RawObject* raw_obj = obj.raw(); | 4494 RawObject* raw_obj = obj.raw(); |
4495 isolate->heap()->SetPeer(raw_obj, peer); | 4495 isolate->heap()->SetPeer(raw_obj, peer); |
4496 } | 4496 } |
4497 return Api::Success(isolate); | 4497 return Api::Success(isolate); |
4498 } | 4498 } |
4499 | 4499 |
4500 } // namespace dart | 4500 } // namespace dart |
OLD | NEW |