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

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

Issue 1541073002: Implement safepointing of threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: self-review-comments Created 4 years, 11 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
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_api.h" 5 #include "include/dart_api.h"
6 #include "platform/assert.h" 6 #include "platform/assert.h"
7 #include "vm/dart_api_impl.h" 7 #include "vm/dart_api_impl.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 int argument_count_; 72 int argument_count_;
73 } BuiltinEntries[] = { 73 } BuiltinEntries[] = {
74 UNHANDLED_NATIVE_LIST(REGISTER_FUNCTION) 74 UNHANDLED_NATIVE_LIST(REGISTER_FUNCTION)
75 }; 75 };
76 76
77 77
78 static Dart_NativeFunction native_lookup(Dart_Handle name, 78 static Dart_NativeFunction native_lookup(Dart_Handle name,
79 int argument_count, 79 int argument_count,
80 bool* auto_setup_scope) { 80 bool* auto_setup_scope) {
81 ASSERT(auto_setup_scope != NULL); 81 ASSERT(auto_setup_scope != NULL);
82 *auto_setup_scope = false; 82 *auto_setup_scope = true;
83 const Object& obj = Object::Handle(Api::UnwrapHandle(name)); 83 const Object& obj = Object::Handle(Api::UnwrapHandle(name));
84 ASSERT(obj.IsString()); 84 ASSERT(obj.IsString());
85 const char* function_name = obj.ToCString(); 85 const char* function_name = obj.ToCString();
86 ASSERT(function_name != NULL); 86 ASSERT(function_name != NULL);
87 int num_entries = sizeof(BuiltinEntries) / sizeof(struct NativeEntries); 87 int num_entries = sizeof(BuiltinEntries) / sizeof(struct NativeEntries);
88 for (int i = 0; i < num_entries; i++) { 88 for (int i = 0; i < num_entries; i++) {
89 struct NativeEntries* entry = &(BuiltinEntries[i]); 89 struct NativeEntries* entry = &(BuiltinEntries[i]);
90 if (!strcmp(function_name, entry->name_) && 90 if (!strcmp(function_name, entry->name_) &&
91 (argument_count == entry->argument_count_)) { 91 (argument_count == entry->argument_count_)) {
92 return reinterpret_cast<Dart_NativeFunction>(entry->function_); 92 return reinterpret_cast<Dart_NativeFunction>(entry->function_);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 " UnhandledExceptions.equals(2, Second.method1(1));\n" 126 " UnhandledExceptions.equals(2, Second.method1(1));\n"
127 " UnhandledExceptions.equals(3, Second.method3(1));\n" 127 " UnhandledExceptions.equals(3, Second.method3(1));\n"
128 "}"; 128 "}";
129 Dart_Handle lib = TestCase::LoadTestScript( 129 Dart_Handle lib = TestCase::LoadTestScript(
130 kScriptChars, 130 kScriptChars,
131 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); 131 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
132 EXPECT_VALID(Dart_Invoke(lib, NewString("testMain"), 0, NULL)); 132 EXPECT_VALID(Dart_Invoke(lib, NewString("testMain"), 0, NULL));
133 } 133 }
134 134
135 } // namespace dart 135 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698