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

Unified Diff: vm/dart_api_message.cc

Issue 10807078: Address review comments from a previous CL. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | vm/heap_profiler.cc » ('j') | vm/object.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/dart_api_message.cc
===================================================================
--- vm/dart_api_message.cc (revision 9828)
+++ vm/dart_api_message.cc (working copy)
@@ -191,8 +191,7 @@
ASSERT((class_header & kSmiTagMask) != 0);
class_id = LookupInternalClass(class_header);
- if (class_id == ObjectStore::kArrayClass ||
- class_id == ObjectStore::kImmutableArrayClass) {
+ if (class_id == kArray || class_id == kImmutableArray) {
regis 2012/07/24 13:49:25 Not your cl, but parentheses are missing here and
siva 2012/08/13 20:38:25 Done.
intptr_t len = ReadSmiValue();
Dart_CObject* value = GetBackRef(object_id);
if (value == NULL) {
@@ -245,8 +244,7 @@
ASSERT((class_header & kSmiTagMask) != 0);
intptr_t object_id = header_value;
intptr_t class_id = LookupInternalClass(class_header);
- if (class_id == ObjectStore::kArrayClass ||
- class_id == ObjectStore::kImmutableArrayClass) {
+ if (class_id == kArray || class_id == kImmutableArray) {
ASSERT(GetBackRef(object_id) == NULL);
intptr_t len = ReadSmiValue();
Dart_CObject* value = AllocateDartCObjectArray(len);
@@ -263,10 +261,10 @@
Dart_CObject* ApiMessageReader::ReadInternalVMObject(intptr_t class_id,
intptr_t object_id) {
switch (class_id) {
- case Object::kClassClass: {
+ case kClass: {
return AllocateDartCObjectUnsupported();
}
- case Object::kTypeArgumentsClass: {
+ case kTypeArguments: {
// TODO(sjesse): Remove this when message serialization format is
// updated (currently length is leaked).
Dart_CObject* value = &type_arguments_marker;
@@ -281,7 +279,7 @@
}
return value;
}
- case Object::kTypeParameterClass: {
+ case kTypeParameter: {
// TODO(sgjesse): Fix this workaround ignoring the type parameter.
Dart_CObject* value = &dynamic_type_marker;
AddBackRef(object_id, value, kIsDeserialized);
@@ -298,7 +296,7 @@
ASSERT(name->type == Dart_CObject::kString);
return value;
}
- case ObjectStore::kMintClass: {
+ case kMint: {
int64_t value = Read<int64_t>();
Dart_CObject* object;
if (kMinInt32 <= value && value <= kMaxInt32) {
@@ -309,7 +307,7 @@
AddBackRef(object_id, object, kIsDeserialized);
return object;
}
- case ObjectStore::kBigintClass: {
+ case kBigint: {
// Read in the hex string representation of the bigint.
intptr_t len = ReadIntptrValue();
Dart_CObject* object = AllocateDartCObjectBigint(len);
@@ -321,13 +319,13 @@
p[len] = '\0';
return object;
}
- case ObjectStore::kDoubleClass: {
+ case kDouble: {
// Read the double value for the object.
Dart_CObject* object = AllocateDartCObjectDouble(Read<double>());
AddBackRef(object_id, object, kIsDeserialized);
return object;
}
- case ObjectStore::kOneByteStringClass: {
+ case kOneByteString: {
intptr_t len = ReadSmiValue();
intptr_t hash = ReadSmiValue();
USE(hash);
@@ -340,13 +338,13 @@
p[len] = '\0';
return object;
}
- case ObjectStore::kTwoByteStringClass:
+ case kTwoByteString:
// Two byte strings not supported.
return AllocateDartCObjectUnsupported();
- case ObjectStore::kFourByteStringClass:
+ case kFourByteString:
// Four byte strings not supported.
return AllocateDartCObjectUnsupported();
- case ObjectStore::kUint8ArrayClass: {
+ case kUint8Array: {
intptr_t len = ReadSmiValue();
Dart_CObject* object = AllocateDartCObjectUint8Array(len);
AddBackRef(object_id, object, kIsDeserialized);
@@ -450,7 +448,7 @@
WriteSerializationMarker(kInlined, kMaxPredefinedObjectIds);
// Write out the class and tags information.
- WriteObjectHeader(ObjectStore::kArrayClass, 0);
+ WriteObjectHeader(kArray, 0);
// Write out the length field.
Write<RawObject*>(Smi::New(field_count));
@@ -540,7 +538,7 @@
// Write out the serialization header value for mint object.
WriteInlinedHeader(object);
// Write out the class and tags information.
- WriteObjectHeader(ObjectStore::kMintClass, 0);
+ WriteObjectHeader(kMint, 0);
// Write the 64-bit value.
Write<int64_t>(value);
}
@@ -588,7 +586,7 @@
// Write out the serialization header value for this object.
WriteInlinedHeader(object);
// Write out the class and tags information.
- WriteObjectHeader(ObjectStore::kArrayClass, 0);
+ WriteObjectHeader(kArray, 0);
WriteSmi(object->value.as_array.length);
// Write out the type arguments.
WriteIndexedObject(Object::kNullObject);
@@ -614,7 +612,7 @@
// Write out the serialization header value for this object.
WriteInlinedHeader(object);
// Write out the class information.
- WriteIndexedObject(ObjectStore::kArrayClass);
+ WriteIndexedObject(kArray);
// Write out the length information.
WriteSmi(object->value.as_array.length);
// Add object to forward list so that this object is serialized later.
@@ -635,7 +633,7 @@
intptr_t object_id = GetMarkedCObjectMark(object);
WriteSerializationMarker(kInlined, kMaxPredefinedObjectIds + object_id);
// Write out the class and tags information.
- WriteObjectHeader(ObjectStore::kArrayClass, 0);
+ WriteObjectHeader(kArray, 0);
WriteSmi(object->value.as_array.length);
// Write out the type arguments.
WriteIndexedObject(Object::kNullObject);
@@ -669,7 +667,7 @@
// Write out the serialization header value for this object.
WriteInlinedHeader(object);
// Write out the class and tags information.
- WriteObjectHeader(ObjectStore::kBigintClass, 0);
+ WriteObjectHeader(kBigint, 0);
// Write hex string length and content
char* hex_string = object->value.as_bigint;
intptr_t len = strlen(hex_string);
@@ -683,7 +681,7 @@
// Write out the serialization header value for this object.
WriteInlinedHeader(object);
// Write out the class and tags information.
- WriteObjectHeader(ObjectStore::kDoubleClass, 0);
+ WriteObjectHeader(kDouble, 0);
// Write double value.
Write<double>(object->value.as_double);
break;
@@ -691,7 +689,7 @@
// Write out the serialization header value for this object.
WriteInlinedHeader(object);
// Write out the class and tags information.
- WriteObjectHeader(ObjectStore::kOneByteStringClass, 0);
+ WriteObjectHeader(kOneByteString, 0);
// Write string length, hash and content
char* str = object->value.as_string;
intptr_t len = strlen(str);
@@ -706,7 +704,7 @@
// Write out the serialization header value for this object.
WriteInlinedHeader(object);
// Write out the class and tags information.
- WriteObjectHeader(ObjectStore::kUint8ArrayClass, 0);
+ WriteObjectHeader(kUint8Array, 0);
uint8_t* bytes = object->value.as_byte_array.values;
intptr_t len = object->value.as_byte_array.length;
WriteSmi(len);
@@ -724,7 +722,7 @@
// Write out serialization header value for this object.
WriteInlinedHeader(object);
// Write out the class and tag information.
- WriteObjectHeader(ObjectStore::kExternalUint8ArrayClass, 0);
+ WriteObjectHeader(kExternalUint8Array, 0);
int length = object->value.as_external_byte_array.length;
uint8_t* data = object->value.as_external_byte_array.data;
void* peer = object->value.as_external_byte_array.peer;
« no previous file with comments | « no previous file | vm/heap_profiler.cc » ('j') | vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698