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

Side by Side Diff: runtime/bin/common.cc

Issue 18115002: Make writes consistent across socket and file synchronous/asynchronus writes in terms of truncation… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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
« no previous file with comments | « no previous file | runtime/bin/common_patch.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 #include "bin/builtin.h"
6 #include "bin/isolate_data.h"
7 #include "include/dart_api.h"
8
9 namespace dart {
10 namespace bin {
11
12 void FUNCTION_NAME(Common_IsBuiltinList)(Dart_NativeArguments args) {
13 Dart_EnterScope();
14 Dart_Handle list = Dart_GetNativeArgument(args, 0);
15 Dart_Handle list_class = Dart_InstanceGetClass(list);
16 ASSERT(!Dart_IsError(list_class));
17
18 // Fetch the cached builtin array types for this isolate.
19 IsolateData* isolate_data =
20 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData());
21
22 // If we have not cached the class pointers in the isolate data,
23 // look them up and cache them now.
24 if (isolate_data->object_array_class == NULL) {
25 Dart_Handle core_lib =
26 Dart_LookupLibrary(Dart_NewStringFromCString("dart:core"));
27 ASSERT(!Dart_IsError(core_lib));
28
29 Dart_Handle cls =
30 Dart_GetClass(core_lib, Dart_NewStringFromCString("_ObjectArray"));
31 ASSERT(!Dart_IsError(cls));
32 isolate_data->object_array_class = Dart_NewPersistentHandle(cls);
33 ASSERT(isolate_data->object_array_class != NULL);
34
35 cls = Dart_GetClass(core_lib, Dart_NewStringFromCString("_ImmutableArray"));
36 ASSERT(!Dart_IsError(cls));
37 isolate_data->immutable_array_class = Dart_NewPersistentHandle(cls);
38 ASSERT(isolate_data->immutable_array_class != NULL);
39
40 cls = Dart_GetClass(
41 core_lib, Dart_NewStringFromCString("_GrowableObjectArray"));
42 ASSERT(!Dart_IsError(cls));
43 isolate_data->growable_object_array_class = Dart_NewPersistentHandle(cls);
44 ASSERT(isolate_data->growable_object_array_class != NULL);
45 }
46
47 Dart_Handle object_array_class =
48 Dart_HandleFromPersistent(isolate_data->object_array_class);
49 Dart_Handle growable_object_array_class =
50 Dart_HandleFromPersistent(isolate_data->growable_object_array_class);
51 Dart_Handle immutable_array_class =
52 Dart_HandleFromPersistent(isolate_data->immutable_array_class);
53 bool builtin_array =
54 (Dart_IdentityEquals(list_class, growable_object_array_class) ||
55 Dart_IdentityEquals(list_class, object_array_class) ||
56 Dart_IdentityEquals(list_class, immutable_array_class));
57 Dart_SetReturnValue(args, Dart_NewBoolean(builtin_array));
58 Dart_ExitScope();
59 }
60
61 } // namespace bin
62 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/common_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698