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

Side by Side Diff: runtime/vm/snapshot_test.cc

Issue 9325022: Decode the Dart message into a Dart_CMessage structure before calling the native port callback (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Undo unneeded changes Created 8 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 | Annotate | Revision Log
OLDNEW
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_state.h" 11 #include "vm/dart_api_state.h"
11 #include "vm/snapshot.h" 12 #include "vm/snapshot.h"
12 #include "vm/unit_test.h" 13 #include "vm/unit_test.h"
13 14
14 namespace dart { 15 namespace dart {
15 16
16 // Check if serialized and deserialized objects are equal. 17 // Check if serialized and deserialized objects are equal.
17 static bool Equals(const Object& expected, const Object& actual) { 18 static bool Equals(const Object& expected, const Object& actual) {
18 if (expected.IsNull()) { 19 if (expected.IsNull()) {
19 return actual.IsNull(); 20 return actual.IsNull();
(...skipping 28 matching lines...) Expand all
48 uint8_t* ptr, intptr_t old_size, intptr_t new_size) { 49 uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
49 Zone* zone = Isolate::Current()->current_zone(); 50 Zone* zone = Isolate::Current()->current_zone();
50 return reinterpret_cast<uint8_t*>( 51 return reinterpret_cast<uint8_t*>(
51 zone->Reallocate(reinterpret_cast<uword>(ptr), old_size, new_size)); 52 zone->Reallocate(reinterpret_cast<uword>(ptr), old_size, new_size));
52 } 53 }
53 54
54 55
55 static Dart_CObject* DecodeMessage(uint8_t* message, 56 static Dart_CObject* DecodeMessage(uint8_t* message,
56 intptr_t length, 57 intptr_t length,
57 ReAlloc allocator) { 58 ReAlloc allocator) {
58 CMessageReader message_reader(message, length, allocator); 59 ApiMessageReader message_reader(message, length, allocator);
59 return message_reader.ReadMessage(); 60 return message_reader.ReadMessage();
60 } 61 }
61 62
62 63
63 // Compare two Dart_CObject object graphs rooted in first and 64 // Compare two Dart_CObject object graphs rooted in first and
64 // second. The second graph will be destroyed by this operation no matter 65 // second. The second graph will be destroyed by this operation no matter
65 // whether the graphs are equal or not. 66 // whether the graphs are equal or not.
66 static void CompareDartCObjects(Dart_CObject* first, Dart_CObject* second) { 67 static void CompareDartCObjects(Dart_CObject* first, Dart_CObject* second) {
67 // Return immediately if entering a cycle. 68 // Return immediately if entering a cycle.
68 if (second->type == Dart_CObject::kNumberOfTypes) return; 69 if (second->type == Dart_CObject::kNumberOfTypes) return;
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 EXPECT(Dart_ErrorHasException(result)); 1206 EXPECT(Dart_ErrorHasException(result));
1206 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]\n", 1207 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]\n",
1207 Dart_GetError(result)); 1208 Dart_GetError(result));
1208 1209
1209 Dart_ExitScope(); 1210 Dart_ExitScope();
1210 } 1211 }
1211 1212
1212 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). 1213 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
1213 1214
1214 } // namespace dart 1215 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698