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

Unified Diff: runtime/lib/isolate.cc

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge Created 3 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 | « runtime/lib/integers.cc ('k') | runtime/lib/linked_hash_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/isolate.cc
diff --git a/runtime/lib/isolate.cc b/runtime/lib/isolate.cc
index e9bc612f9a088c1ad6ee4748d9109d4951fc4f92..d9ea131e9423bd0790e036950f9b90737c5662e6 100644
--- a/runtime/lib/isolate.cc
+++ b/runtime/lib/isolate.cc
@@ -41,21 +41,18 @@ static void malloc_deallocator(uint8_t* ptr) {
free(reinterpret_cast<void*>(ptr));
}
-
DEFINE_NATIVE_ENTRY(CapabilityImpl_factory, 1) {
ASSERT(TypeArguments::CheckedHandle(arguments->NativeArgAt(0)).IsNull());
uint64_t id = isolate->random()->NextUInt64();
return Capability::New(id);
}
-
DEFINE_NATIVE_ENTRY(CapabilityImpl_equals, 2) {
GET_NON_NULL_NATIVE_ARGUMENT(Capability, recv, arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(Capability, other, arguments->NativeArgAt(1));
return (recv.Id() == other.Id()) ? Bool::True().raw() : Bool::False().raw();
}
-
DEFINE_NATIVE_ENTRY(CapabilityImpl_get_hashcode, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(Capability, cap, arguments->NativeArgAt(0));
int64_t id = cap.Id();
@@ -65,26 +62,22 @@ DEFINE_NATIVE_ENTRY(CapabilityImpl_get_hashcode, 1) {
return Smi::New(hash);
}
-
DEFINE_NATIVE_ENTRY(RawReceivePortImpl_factory, 1) {
ASSERT(TypeArguments::CheckedHandle(arguments->NativeArgAt(0)).IsNull());
Dart_Port port_id = PortMap::CreatePort(isolate->message_handler());
return ReceivePort::New(port_id, false /* not control port */);
}
-
DEFINE_NATIVE_ENTRY(RawReceivePortImpl_get_id, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(ReceivePort, port, arguments->NativeArgAt(0));
return Integer::NewFromUint64(port.Id());
}
-
DEFINE_NATIVE_ENTRY(RawReceivePortImpl_get_sendport, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(ReceivePort, port, arguments->NativeArgAt(0));
return port.send_port();
}
-
DEFINE_NATIVE_ENTRY(RawReceivePortImpl_closeInternal, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(ReceivePort, port, arguments->NativeArgAt(0));
Dart_Port id = port.Id();
@@ -92,13 +85,11 @@ DEFINE_NATIVE_ENTRY(RawReceivePortImpl_closeInternal, 1) {
return Integer::NewFromUint64(id);
}
-
DEFINE_NATIVE_ENTRY(SendPortImpl_get_id, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
return Integer::NewFromUint64(port.Id());
}
-
DEFINE_NATIVE_ENTRY(SendPortImpl_get_hashcode, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
int64_t id = port.Id();
@@ -108,7 +99,6 @@ DEFINE_NATIVE_ENTRY(SendPortImpl_get_hashcode, 1) {
return Smi::New(hash);
}
-
DEFINE_NATIVE_ENTRY(SendPortImpl_sendInternal_, 2) {
GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
// TODO(iposva): Allow for arbitrary messages to be sent.
@@ -134,14 +124,12 @@ DEFINE_NATIVE_ENTRY(SendPortImpl_sendInternal_, 2) {
return Object::null();
}
-
static void ThrowIsolateSpawnException(const String& message) {
const Array& args = Array::Handle(Array::New(1));
args.SetAt(0, message);
Exceptions::ThrowByType(Exceptions::kIsolateSpawn, args);
}
-
class SpawnIsolateTask : public ThreadPool::Task {
public:
explicit SpawnIsolateTask(IsolateSpawnState* state) : state_(state) {}
@@ -204,7 +192,6 @@ class SpawnIsolateTask : public ThreadPool::Task {
DISALLOW_COPY_AND_ASSIGN(SpawnIsolateTask);
};
-
static const char* String2UTF8(const String& str) {
intptr_t len = Utf8::Length(str);
char* result = new char[len + 1];
@@ -214,7 +201,6 @@ static const char* String2UTF8(const String& str) {
return result;
}
-
DEFINE_NATIVE_ENTRY(Isolate_spawnFunction, 10) {
GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(String, script_uri, arguments->NativeArgAt(1));
@@ -293,7 +279,6 @@ DEFINE_NATIVE_ENTRY(Isolate_spawnFunction, 10) {
return Object::null();
}
-
static const char* CanonicalizeUri(Thread* thread,
const Library& library,
const String& uri,
@@ -331,7 +316,6 @@ static const char* CanonicalizeUri(Thread* thread,
return result;
}
-
DEFINE_NATIVE_ENTRY(Isolate_spawnUri, 12) {
GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(String, uri, arguments->NativeArgAt(1));
@@ -434,7 +418,6 @@ DEFINE_NATIVE_ENTRY(Isolate_spawnUri, 12) {
return Object::null();
}
-
DEFINE_NATIVE_ENTRY(Isolate_getPortAndCapabilitiesOfCurrentIsolate, 0) {
const Array& result = Array::Handle(Array::New(3));
result.SetAt(0, SendPort::Handle(SendPort::New(isolate->main_port())));
@@ -445,14 +428,12 @@ DEFINE_NATIVE_ENTRY(Isolate_getPortAndCapabilitiesOfCurrentIsolate, 0) {
return result.raw();
}
-
DEFINE_NATIVE_ENTRY(Isolate_getCurrentRootUriStr, 0) {
const Library& root_lib =
Library::Handle(zone, isolate->object_store()->root_library());
return root_lib.url();
}
-
DEFINE_NATIVE_ENTRY(Isolate_sendOOB, 2) {
GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(Array, msg, arguments->NativeArgAt(1));
« no previous file with comments | « runtime/lib/integers.cc ('k') | runtime/lib/linked_hash_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698