| 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 2410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2421 } | 2421 } |
| 2422 dart_arguments.Add(&arg); | 2422 dart_arguments.Add(&arg); |
| 2423 } | 2423 } |
| 2424 const Array& kNoArgumentNames = Array::Handle(isolate); | 2424 const Array& kNoArgumentNames = Array::Handle(isolate); |
| 2425 return Api::NewHandle( | 2425 return Api::NewHandle( |
| 2426 isolate, | 2426 isolate, |
| 2427 DartEntry::InvokeClosure(closure_obj, dart_arguments, kNoArgumentNames)); | 2427 DartEntry::InvokeClosure(closure_obj, dart_arguments, kNoArgumentNames)); |
| 2428 } | 2428 } |
| 2429 | 2429 |
| 2430 | 2430 |
| 2431 DART_EXPORT int64_t Dart_ClosureSmrck(Dart_Handle object) { | |
| 2432 Isolate* isolate = Isolate::Current(); | |
| 2433 DARTSCOPE(isolate); | |
| 2434 const Closure& obj = | |
| 2435 Closure::CheckedHandle(isolate, Api::UnwrapHandle(object)); | |
| 2436 const Integer& smrck = Integer::Handle(isolate, obj.smrck()); | |
| 2437 return smrck.IsNull() ? 0 : smrck.AsInt64Value(); | |
| 2438 } | |
| 2439 | |
| 2440 | |
| 2441 DART_EXPORT void Dart_ClosureSetSmrck(Dart_Handle object, int64_t value) { | |
| 2442 Isolate* isolate = Isolate::Current(); | |
| 2443 DARTSCOPE(isolate); | |
| 2444 const Closure& obj = | |
| 2445 Closure::CheckedHandle(isolate, Api::UnwrapHandle(object)); | |
| 2446 const Integer& smrck = Integer::Handle(isolate, Integer::New(value)); | |
| 2447 obj.set_smrck(smrck); | |
| 2448 } | |
| 2449 | |
| 2450 | |
| 2451 // --- Classes and Interfaces --- | 2431 // --- Classes and Interfaces --- |
| 2452 | 2432 |
| 2453 | 2433 |
| 2454 DART_EXPORT bool Dart_IsClass(Dart_Handle handle) { | 2434 DART_EXPORT bool Dart_IsClass(Dart_Handle handle) { |
| 2455 Isolate* isolate = Isolate::Current(); | 2435 Isolate* isolate = Isolate::Current(); |
| 2456 DARTSCOPE(isolate); | 2436 DARTSCOPE(isolate); |
| 2457 const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(handle)); | 2437 const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(handle)); |
| 2458 if (obj.IsClass()) { | 2438 if (obj.IsClass()) { |
| 2459 return !Class::Cast(obj).is_interface(); | 2439 return !Class::Cast(obj).is_interface(); |
| 2460 } | 2440 } |
| (...skipping 2030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4491 } | 4471 } |
| 4492 { | 4472 { |
| 4493 NoGCScope no_gc; | 4473 NoGCScope no_gc; |
| 4494 RawObject* raw_obj = obj.raw(); | 4474 RawObject* raw_obj = obj.raw(); |
| 4495 isolate->heap()->SetPeer(raw_obj, peer); | 4475 isolate->heap()->SetPeer(raw_obj, peer); |
| 4496 } | 4476 } |
| 4497 return Api::Success(isolate); | 4477 return Api::Success(isolate); |
| 4498 } | 4478 } |
| 4499 | 4479 |
| 4500 } // namespace dart | 4480 } // namespace dart |
| OLD | NEW |