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

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

Issue 2861023002: Remove the Kernel setup_builtin_library transformation (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « pkg/kernel/lib/target/vm.dart ('k') | no next file » | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 "vm/kernel_reader.h" 5 #include "vm/kernel_reader.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/kernel_binary.h" 10 #include "vm/kernel_binary.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 Object& main_obj = Object::Handle( 201 Object& main_obj = Object::Handle(
202 Z, library.LookupObjectAllowPrivate(H.DartSymbol("main"))); 202 Z, library.LookupObjectAllowPrivate(H.DartSymbol("main")));
203 ASSERT(!main_obj.IsNull()); 203 ASSERT(!main_obj.IsNull());
204 204
205 Function& to_patch = Function::Handle( 205 Function& to_patch = Function::Handle(
206 Z, builtin_library.LookupFunctionAllowPrivate( 206 Z, builtin_library.LookupFunctionAllowPrivate(
207 dart::String::Handle(dart::String::New("_getMainClosure")))); 207 dart::String::Handle(dart::String::New("_getMainClosure"))));
208 208
209 Procedure* procedure = 209 Procedure* procedure =
210 reinterpret_cast<Procedure*>(to_patch.kernel_function()); 210 reinterpret_cast<Procedure*>(to_patch.kernel_function());
211 // If dart:_builtin was not compiled from Kernel at all or if it was 211 // If dart:_builtin was not compiled from Kernel at all it does not need
212 // linked with a script, it does not need to be patched. 212 // to be patched.
213 if ((procedure != NULL) && (procedure->function()->body() == NULL)) { 213 if (procedure != NULL) {
214 // We will handle the StaticGet specially and will not use the name. 214 // We will handle the StaticGet specially and will not use the name.
215 // 215 //
216 // TODO(kmillikin): we are leaking the function body. Find a way to 216 // TODO(kmillikin): we are leaking the function body. Find a way to
217 // deallocate it. 217 // deallocate it.
218 procedure->function()->set_body( 218 procedure->function()->set_body(
219 new ReturnStatement(new StaticGet(NameIndex()))); 219 new ReturnStatement(new StaticGet(NameIndex())));
220 } 220 }
221 return library; 221 return library;
222 } 222 }
223 } 223 }
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 initializer_fun.set_is_debuggable(false); 940 initializer_fun.set_is_debuggable(false);
941 initializer_fun.set_is_reflectable(false); 941 initializer_fun.set_is_reflectable(false);
942 initializer_fun.set_is_inlinable(false); 942 initializer_fun.set_is_inlinable(false);
943 return new (zone) ParsedFunction(thread, initializer_fun); 943 return new (zone) ParsedFunction(thread, initializer_fun);
944 } 944 }
945 945
946 946
947 } // namespace kernel 947 } // namespace kernel
948 } // namespace dart 948 } // namespace dart
949 #endif // !defined(DART_PRECOMPILED_RUNTIME) 949 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW
« no previous file with comments | « pkg/kernel/lib/target/vm.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698