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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 static uint8_t* malloc_allocator( | 43 static uint8_t* malloc_allocator( |
44 uint8_t* ptr, intptr_t old_size, intptr_t new_size) { | 44 uint8_t* ptr, intptr_t old_size, intptr_t new_size) { |
45 return reinterpret_cast<uint8_t*>(realloc(ptr, new_size)); | 45 return reinterpret_cast<uint8_t*>(realloc(ptr, new_size)); |
46 } | 46 } |
47 | 47 |
48 | 48 |
49 static uint8_t* zone_allocator( | 49 static uint8_t* zone_allocator( |
50 uint8_t* ptr, intptr_t old_size, intptr_t new_size) { | 50 uint8_t* ptr, intptr_t old_size, intptr_t new_size) { |
51 Zone* zone = Isolate::Current()->current_zone(); | 51 Zone* zone = Isolate::Current()->current_zone(); |
52 return reinterpret_cast<uint8_t*>( | 52 return zone->Realloc<uint8_t>(ptr, old_size, new_size); |
53 zone->Reallocate(reinterpret_cast<uword>(ptr), old_size, new_size)); | |
54 } | 53 } |
55 | 54 |
56 | 55 |
57 static Dart_CObject* DecodeMessage(uint8_t* message, | 56 static Dart_CObject* DecodeMessage(uint8_t* message, |
58 intptr_t length, | 57 intptr_t length, |
59 ReAlloc allocator) { | 58 ReAlloc allocator) { |
60 ApiMessageReader message_reader(message, length, allocator); | 59 ApiMessageReader message_reader(message, length, allocator); |
61 return message_reader.ReadMessage(); | 60 return message_reader.ReadMessage(); |
62 } | 61 } |
63 | 62 |
(...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1563 EXPECT(Dart_ErrorHasException(result)); | 1562 EXPECT(Dart_ErrorHasException(result)); |
1564 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", | 1563 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", |
1565 Dart_GetError(result)); | 1564 Dart_GetError(result)); |
1566 | 1565 |
1567 Dart_ExitScope(); | 1566 Dart_ExitScope(); |
1568 } | 1567 } |
1569 | 1568 |
1570 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 1569 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
1571 | 1570 |
1572 } // namespace dart | 1571 } // namespace dart |
OLD | NEW |