| 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_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 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/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_api_message.h" | 10 #include "vm/dart_api_message.h" |
| (...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1532 | 1532 |
| 1533 object.type = Dart_CObject::kArray; | 1533 object.type = Dart_CObject::kArray; |
| 1534 object.value.as_array.length = 0; | 1534 object.value.as_array.length = 0; |
| 1535 EXPECT(Dart_PostCObject(send_port_id, &object)); | 1535 EXPECT(Dart_PostCObject(send_port_id, &object)); |
| 1536 | 1536 |
| 1537 static const int kArrayLength = 10; | 1537 static const int kArrayLength = 10; |
| 1538 Dart_CObject* array = | 1538 Dart_CObject* array = |
| 1539 reinterpret_cast<Dart_CObject*>( | 1539 reinterpret_cast<Dart_CObject*>( |
| 1540 Dart_ScopeAllocate( | 1540 Dart_ScopeAllocate( |
| 1541 sizeof(Dart_CObject) + sizeof(Dart_CObject*) * kArrayLength)); //
NOLINT | 1541 sizeof(Dart_CObject) + sizeof(Dart_CObject*) * kArrayLength)); //
NOLINT |
| 1542 array->type = Dart_CObject::Dart_CObject::kArray; | 1542 array->type = Dart_CObject::kArray; |
| 1543 array->value.as_array.length = kArrayLength; | 1543 array->value.as_array.length = kArrayLength; |
| 1544 array->value.as_array.values = | 1544 array->value.as_array.values = |
| 1545 reinterpret_cast<Dart_CObject**>(array + 1); | 1545 reinterpret_cast<Dart_CObject**>(array + 1); |
| 1546 for (int i = 0; i < kArrayLength; i++) { | 1546 for (int i = 0; i < kArrayLength; i++) { |
| 1547 Dart_CObject* element = | 1547 Dart_CObject* element = |
| 1548 reinterpret_cast<Dart_CObject*>( | 1548 reinterpret_cast<Dart_CObject*>( |
| 1549 Dart_ScopeAllocate(sizeof(Dart_CObject))); | 1549 Dart_ScopeAllocate(sizeof(Dart_CObject))); |
| 1550 element->type = Dart_CObject::kInt32; | 1550 element->type = Dart_CObject::kInt32; |
| 1551 element->value.as_int32 = i; | 1551 element->value.as_int32 = i; |
| 1552 array->value.as_array.values[i] = element; | 1552 array->value.as_array.values[i] = element; |
| 1553 } | 1553 } |
| 1554 EXPECT(Dart_PostCObject(send_port_id, array)); | 1554 EXPECT(Dart_PostCObject(send_port_id, array)); |
| 1555 | 1555 |
| 1556 result = Dart_RunLoop(); | 1556 result = Dart_RunLoop(); |
| 1557 EXPECT(Dart_IsError(result)); | 1557 EXPECT(Dart_IsError(result)); |
| 1558 EXPECT(Dart_ErrorHasException(result)); | 1558 EXPECT(Dart_ErrorHasException(result)); |
| 1559 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", | 1559 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", |
| 1560 Dart_GetError(result)); | 1560 Dart_GetError(result)); |
| 1561 | 1561 |
| 1562 Dart_ExitScope(); | 1562 Dart_ExitScope(); |
| 1563 } | 1563 } |
| 1564 | 1564 |
| 1565 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 1565 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 1566 | 1566 |
| 1567 } // namespace dart | 1567 } // namespace dart |
| OLD | NEW |