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

Side by Side Diff: bin/builtin_natives.cc

Issue 10911135: Simplify the builtin functions and get rid of unused code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 3 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 | « bin/builtin.cc ('k') | bin/builtin_nolib.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "bin/builtin.h" 5 #include "bin/builtin.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "bin/dartutils.h" 10 #include "bin/dartutils.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 fflush(out); 117 fflush(out);
118 } 118 }
119 119
120 120
121 void FUNCTION_NAME(Logger_PrintString)(Dart_NativeArguments args) { 121 void FUNCTION_NAME(Logger_PrintString)(Dart_NativeArguments args) {
122 Dart_EnterScope(); 122 Dart_EnterScope();
123 Builtin::PrintString(stdout, Dart_GetNativeArgument(args, 0)); 123 Builtin::PrintString(stdout, Dart_GetNativeArgument(args, 0));
124 Dart_ExitScope(); 124 Dart_ExitScope();
125 } 125 }
126 126
127
127 void FUNCTION_NAME(Exit)(Dart_NativeArguments args) { 128 void FUNCTION_NAME(Exit)(Dart_NativeArguments args) {
128 Dart_EnterScope(); 129 Dart_EnterScope();
129 int64_t status = 0; 130 int64_t status = 0;
130 // Ignore result if passing invalid argument and just exit 0. 131 // Ignore result if passing invalid argument and just exit 0.
131 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status); 132 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status);
132 Dart_ExitScope(); 133 Dart_ExitScope();
133 exit(status); 134 exit(status);
134 } 135 }
135
136
137 void Builtin::SetupIOLibrary(Dart_Handle io_lib) {
138 Dart_Handle url = Dart_NewString(DartUtils::kIsolateLibURL);
139 DART_CHECK_VALID(url);
140 Dart_Handle isolate_lib = Dart_LookupLibrary(url);
141 DART_CHECK_VALID(isolate_lib);
142 Dart_Handle timer_closure =
143 Dart_Invoke(io_lib, Dart_NewString("_getTimerFactoryClosure"), 0, NULL);
144 Dart_Handle args[1];
145 args[0] = timer_closure;
146 DART_CHECK_VALID(Dart_Invoke(isolate_lib,
147 Dart_NewString("_setTimerFactoryClosure"),
148 1, args));
149 }
OLDNEW
« no previous file with comments | « bin/builtin.cc ('k') | bin/builtin_nolib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698