| Index: runtime/vm/unit_test.cc
|
| diff --git a/runtime/vm/unit_test.cc b/runtime/vm/unit_test.cc
|
| index b507c0008f528d90c43a1b9c73e9a5bd00ebadc9..1c138e7495ccf10564a107b80959b0d2f927ce9e 100644
|
| --- a/runtime/vm/unit_test.cc
|
| +++ b/runtime/vm/unit_test.cc
|
| @@ -54,8 +54,8 @@ void TestCaseBase::RunAll() {
|
| Dart_Isolate TestCase::CreateIsolate(const uint8_t* buffer, const char* name) {
|
| bin::IsolateData* isolate_data = new bin::IsolateData(name, NULL, NULL);
|
| char* err;
|
| - Dart_Isolate isolate = Dart_CreateIsolate(
|
| - name, NULL, buffer, NULL, isolate_data, &err);
|
| + Dart_Isolate isolate =
|
| + Dart_CreateIsolate(name, NULL, buffer, NULL, isolate_data, &err);
|
| if (isolate == NULL) {
|
| OS::Print("Creation of isolate failed '%s'\n", err);
|
| free(err);
|
| @@ -118,8 +118,7 @@ static bool IsIsolateReloadTestLib(const char* url_name) {
|
| const char* kIsolateReloadTestLibUri = "test:isolate_reload_helper";
|
| static const intptr_t kIsolateReloadTestLibUriLen =
|
| strlen(kIsolateReloadTestLibUri);
|
| - return (strncmp(url_name,
|
| - kIsolateReloadTestLibUri,
|
| + return (strncmp(url_name, kIsolateReloadTestLibUri,
|
| kIsolateReloadTestLibUriLen) == 0);
|
| }
|
|
|
| @@ -149,8 +148,7 @@ static Dart_Handle ResolvePackageUri(const char* uri_chars) {
|
| Dart_Handle dart_args[kNumArgs];
|
| dart_args[0] = DartUtils::NewString(uri_chars);
|
| return Dart_Invoke(DartUtils::BuiltinLib(),
|
| - DartUtils::NewString("_filePathFromUri"),
|
| - kNumArgs,
|
| + DartUtils::NewString("_filePathFromUri"), kNumArgs,
|
| dart_args);
|
| }
|
|
|
| @@ -170,16 +168,11 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
|
| if (tag == Dart_kScriptTag) {
|
| // Reload request.
|
| ASSERT(script_reload_key != kUnsetThreadLocalKey);
|
| - const char* script_source =
|
| - reinterpret_cast<const char*>(
|
| - OSThread::GetThreadLocal(script_reload_key));
|
| + const char* script_source = reinterpret_cast<const char*>(
|
| + OSThread::GetThreadLocal(script_reload_key));
|
| ASSERT(script_source != NULL);
|
| OSThread::SetThreadLocal(script_reload_key, 0);
|
| - return Dart_LoadScript(url,
|
| - Dart_Null(),
|
| - NewString(script_source),
|
| - 0,
|
| - 0);
|
| + return Dart_LoadScript(url, Dart_Null(), NewString(script_source), 0, 0);
|
| }
|
| if (!Dart_IsLibrary(library)) {
|
| return Dart_NewApiError("not a library");
|
| @@ -217,20 +210,19 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
|
| Dart_Handle source = Dart_NewStringFromCString(lib_source);
|
| return Dart_LoadLibrary(url, Dart_Null(), source, 0, 0);
|
| }
|
| - NOT_IN_PRODUCT(
|
| +#if !defined(PRODUCT)
|
| if (IsIsolateReloadTestLib(url_chars)) {
|
| Dart_Handle library =
|
| Dart_LoadLibrary(url, Dart_Null(), IsolateReloadTestLibSource(), 0, 0);
|
| DART_CHECK_VALID(library);
|
| Dart_SetNativeResolver(library, IsolateReloadTestNativeResolver, 0);
|
| return library;
|
| - })
|
| + }
|
| +#endif
|
| if (is_io_library) {
|
| ASSERT(tag == Dart_kSourceTag);
|
| - return Dart_LoadSource(library,
|
| - url, Dart_Null(),
|
| - Builtin::PartSource(Builtin::kIOLibrary,
|
| - url_chars),
|
| + return Dart_LoadSource(library, url, Dart_Null(),
|
| + Builtin::PartSource(Builtin::kIOLibrary, url_chars),
|
| 0, 0);
|
| }
|
| Dart_Handle resolved_url = url;
|
| @@ -378,27 +370,22 @@ char* TestCase::BigintToHexValue(Dart_CObject* bigint) {
|
|
|
|
|
| void AssemblerTest::Assemble() {
|
| - const String& function_name = String::ZoneHandle(
|
| - Symbols::New(Thread::Current(), name_));
|
| + const String& function_name =
|
| + String::ZoneHandle(Symbols::New(Thread::Current(), name_));
|
|
|
| // We make a dummy script so that exception objects can be composed for
|
| // assembler instructions that do runtime calls, in particular on DBC.
|
| const char* kDummyScript = "assembler_test_dummy_function() {}";
|
| - const Script& script = Script::Handle(Script::New(
|
| - function_name,
|
| - String::Handle(String::New(kDummyScript)),
|
| - RawScript::kSourceTag));
|
| + const Script& script = Script::Handle(
|
| + Script::New(function_name, String::Handle(String::New(kDummyScript)),
|
| + RawScript::kSourceTag));
|
| script.Tokenize(String::Handle());
|
| const Library& lib = Library::Handle(Library::CoreLibrary());
|
| const Class& cls = Class::ZoneHandle(
|
| - Class::New(lib,
|
| - function_name,
|
| - script,
|
| - TokenPosition::kMinSource));
|
| + Class::New(lib, function_name, script, TokenPosition::kMinSource));
|
| Function& function = Function::ZoneHandle(
|
| - Function::New(function_name, RawFunction::kRegularFunction,
|
| - true, false, false, false, false, cls,
|
| - TokenPosition::kMinSource));
|
| + Function::New(function_name, RawFunction::kRegularFunction, true, false,
|
| + false, false, false, cls, TokenPosition::kMinSource));
|
| code_ = Code::FinalizeCode(function, assembler_);
|
| code_.set_owner(function);
|
| code_.set_exception_handlers(Object::empty_exception_handlers());
|
| @@ -416,22 +403,21 @@ void AssemblerTest::Assemble() {
|
|
|
|
|
| CodeGenTest::CodeGenTest(const char* name)
|
| - : function_(Function::ZoneHandle()),
|
| - node_sequence_(new SequenceNode(TokenPosition::kMinSource,
|
| - new LocalScope(NULL, 0, 0))),
|
| - default_parameter_values_(new ZoneGrowableArray<const Instance*> ()) {
|
| + : function_(Function::ZoneHandle()),
|
| + node_sequence_(new SequenceNode(TokenPosition::kMinSource,
|
| + new LocalScope(NULL, 0, 0))),
|
| + default_parameter_values_(new ZoneGrowableArray<const Instance*>()) {
|
| ASSERT(name != NULL);
|
| - const String& function_name = String::ZoneHandle(
|
| - Symbols::New(Thread::Current(), name));
|
| + const String& function_name =
|
| + String::ZoneHandle(Symbols::New(Thread::Current(), name));
|
| // Add function to a class and that class to the class dictionary so that
|
| // frame walking can be used.
|
| Library& lib = Library::Handle(Library::CoreLibrary());
|
| - const Class& cls = Class::ZoneHandle(
|
| - Class::New(lib, function_name, Script::Handle(),
|
| - TokenPosition::kMinSource));
|
| - function_ = Function::New(
|
| - function_name, RawFunction::kRegularFunction,
|
| - true, false, false, false, false, cls, TokenPosition::kMinSource);
|
| + const Class& cls = Class::ZoneHandle(Class::New(
|
| + lib, function_name, Script::Handle(), TokenPosition::kMinSource));
|
| + function_ =
|
| + Function::New(function_name, RawFunction::kRegularFunction, true, false,
|
| + false, false, false, cls, TokenPosition::kMinSource);
|
| function_.set_result_type(Type::Handle(Type::DynamicType()));
|
| const Array& functions = Array::Handle(Array::New(1));
|
| functions.SetAt(0, function_);
|
| @@ -447,8 +433,7 @@ void CodeGenTest::Compile() {
|
| parsed_function->SetNodeSequence(node_sequence_);
|
| parsed_function->set_instantiator(NULL);
|
| parsed_function->set_default_parameter_values(default_parameter_values_);
|
| - node_sequence_->scope()->AddVariable(
|
| - parsed_function->current_context_var());
|
| + node_sequence_->scope()->AddVariable(parsed_function->current_context_var());
|
| parsed_function->EnsureExpressionTemp();
|
| node_sequence_->scope()->AddVariable(parsed_function->expression_temp_var());
|
| parsed_function->AllocateVariables();
|
| @@ -464,8 +449,7 @@ bool CompilerTest::TestCompileScript(const Library& library,
|
| ASSERT(isolate != NULL);
|
| const Error& error = Error::Handle(Compiler::Compile(library, script));
|
| if (!error.IsNull()) {
|
| - OS::Print("Error compiling test script:\n%s\n",
|
| - error.ToErrorCString());
|
| + OS::Print("Error compiling test script:\n%s\n", error.ToErrorCString());
|
| }
|
| return error.IsNull();
|
| }
|
| @@ -475,8 +459,8 @@ bool CompilerTest::TestCompileFunction(const Function& function) {
|
| Thread* thread = Thread::Current();
|
| ASSERT(thread != NULL);
|
| ASSERT(ClassFinalizer::AllClassesFinalized());
|
| - const Error& error = Error::Handle(Compiler::CompileFunction(thread,
|
| - function));
|
| + const Error& error =
|
| + Error::Handle(Compiler::CompileFunction(thread, function));
|
| return error.IsNull();
|
| }
|
|
|
|
|