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

Side by Side Diff: vm/compiler.cc

Issue 11613009: Changed the API in DartEntry for invoking dart code from C++ to make it more compatible with the re… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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) 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 "vm/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 8
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/code_generator.h" 10 #include "vm/code_generator.h"
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 parsed_function->SetNodeSequence(fragment); 618 parsed_function->SetNodeSequence(fragment);
619 parsed_function->set_default_parameter_values(Array::ZoneHandle()); 619 parsed_function->set_default_parameter_values(Array::ZoneHandle());
620 parsed_function->set_expression_temp_var( 620 parsed_function->set_expression_temp_var(
621 ParsedFunction::CreateExpressionTempVar(0)); 621 ParsedFunction::CreateExpressionTempVar(0));
622 fragment->scope()->AddVariable(parsed_function->expression_temp_var()); 622 fragment->scope()->AddVariable(parsed_function->expression_temp_var());
623 parsed_function->AllocateVariables(); 623 parsed_function->AllocateVariables();
624 624
625 // Non-optimized code generator. 625 // Non-optimized code generator.
626 CompileParsedFunctionHelper(*parsed_function, false); 626 CompileParsedFunctionHelper(*parsed_function, false);
627 627
628 GrowableArray<const Object*> arguments; // no arguments. 628 const Array& args = Array::Handle(Object::empty_array());
629 const Array& kNoArgumentNames = Array::Handle(); 629 const Object& result = Object::Handle(DartEntry::InvokeStatic(func, args));
630 Object& result = Object::Handle();
631 result = DartEntry::InvokeStatic(func,
632 arguments,
633 kNoArgumentNames);
634 isolate->set_long_jump_base(base); 630 isolate->set_long_jump_base(base);
635 return result.raw(); 631 return result.raw();
636 } else { 632 } else {
637 Object& result = Object::Handle(); 633 const Object& result =
638 result = isolate->object_store()->sticky_error(); 634 Object::Handle(isolate->object_store()->sticky_error());
639 isolate->object_store()->clear_sticky_error(); 635 isolate->object_store()->clear_sticky_error();
640 isolate->set_long_jump_base(base); 636 isolate->set_long_jump_base(base);
641 return result.raw(); 637 return result.raw();
642 } 638 }
643 UNREACHABLE(); 639 UNREACHABLE();
644 return Object::null(); 640 return Object::null();
645 } 641 }
646 642
647 } // namespace dart 643 } // namespace dart
OLDNEW
« no previous file with comments | « vm/code_generator_test.cc ('k') | vm/custom_isolate_test.cc » ('j') | vm/dart_entry.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698