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

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

Issue 184523002: Allocation sinking for contexts. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: added new test Created 6 years, 1 month 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/code_patcher.h" 9 #include "vm/code_patcher.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 258
259 259
260 // Make a copy of the given context, including the values of the captured 260 // Make a copy of the given context, including the values of the captured
261 // variables. 261 // variables.
262 // Arg0: the context to be cloned. 262 // Arg0: the context to be cloned.
263 // Return value: newly allocated context. 263 // Return value: newly allocated context.
264 DEFINE_RUNTIME_ENTRY(CloneContext, 1) { 264 DEFINE_RUNTIME_ENTRY(CloneContext, 1) {
265 const Context& ctx = Context::CheckedHandle(arguments.ArgAt(0)); 265 const Context& ctx = Context::CheckedHandle(arguments.ArgAt(0));
266 Context& cloned_ctx = Context::Handle(Context::New(ctx.num_variables())); 266 Context& cloned_ctx = Context::Handle(Context::New(ctx.num_variables()));
267 cloned_ctx.set_parent(Context::Handle(ctx.parent())); 267 cloned_ctx.set_parent(Context::Handle(ctx.parent()));
268 Instance& inst = Instance::Handle(isolate); 268 Object& inst = Object::Handle(isolate);
269 for (int i = 0; i < ctx.num_variables(); i++) { 269 for (int i = 0; i < ctx.num_variables(); i++) {
270 inst = ctx.At(i); 270 inst = ctx.At(i);
271 cloned_ctx.SetAt(i, inst); 271 cloned_ctx.SetAt(i, inst);
272 } 272 }
273 arguments.SetReturn(cloned_ctx); 273 arguments.SetReturn(cloned_ctx);
274 } 274 }
275 275
276 276
277 // Helper routine for tracing a type check. 277 // Helper routine for tracing a type check.
278 static void PrintTypeCheck( 278 static void PrintTypeCheck(
(...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 field.RecordStore(value); 1627 field.RecordStore(value);
1628 } 1628 }
1629 1629
1630 1630
1631 DEFINE_RUNTIME_ENTRY(InitStaticField, 1) { 1631 DEFINE_RUNTIME_ENTRY(InitStaticField, 1) {
1632 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); 1632 const Field& field = Field::CheckedHandle(arguments.ArgAt(0));
1633 field.EvaluateInitializer(); 1633 field.EvaluateInitializer();
1634 } 1634 }
1635 1635
1636 } // namespace dart 1636 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/function.cc ('k') | runtime/vm/debugger.h » ('j') | runtime/vm/debugger.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698