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

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

Issue 10796004: Consolidate a few fields in RawFunction using bitfields. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | « runtime/vm/code_patcher_x64_test.cc ('k') | runtime/vm/dart_api_impl.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 "vm/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 } 412 }
413 413
414 414
415 RawError* Compiler::CompileAllFunctions(const Class& cls) { 415 RawError* Compiler::CompileAllFunctions(const Class& cls) {
416 Error& error = Error::Handle(); 416 Error& error = Error::Handle();
417 Array& functions = Array::Handle(cls.functions()); 417 Array& functions = Array::Handle(cls.functions());
418 Function& func = Function::Handle(); 418 Function& func = Function::Handle();
419 for (int i = 0; i < functions.Length(); i++) { 419 for (int i = 0; i < functions.Length(); i++) {
420 func ^= functions.At(i); 420 func ^= functions.At(i);
421 ASSERT(!func.IsNull()); 421 ASSERT(!func.IsNull());
422 if (!func.HasCode() && !func.IsAbstract()) { 422 if (!func.HasCode() && !func.is_abstract()) {
423 error = CompileFunction(func); 423 error = CompileFunction(func);
424 if (!error.IsNull()) { 424 if (!error.IsNull()) {
425 return error.raw(); 425 return error.raw();
426 } 426 }
427 } 427 }
428 } 428 }
429 return error.raw(); 429 return error.raw();
430 } 430 }
431 431
432 432
433 RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) { 433 RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) {
434 Isolate* isolate = Isolate::Current(); 434 Isolate* isolate = Isolate::Current();
435 LongJump* base = isolate->long_jump_base(); 435 LongJump* base = isolate->long_jump_base();
436 LongJump jump; 436 LongJump jump;
437 isolate->set_long_jump_base(&jump); 437 isolate->set_long_jump_base(&jump);
438 if (setjmp(*jump.Set()) == 0) { 438 if (setjmp(*jump.Set()) == 0) {
439 if (FLAG_trace_compiler) { 439 if (FLAG_trace_compiler) {
440 OS::Print("compiling expression: "); 440 OS::Print("compiling expression: ");
441 AstPrinter::PrintNode(fragment); 441 AstPrinter::PrintNode(fragment);
442 } 442 }
443 443
444 // Create a dummy function object for the code generator. 444 // Create a dummy function object for the code generator.
445 const char* kEvalConst = "eval_const"; 445 const char* kEvalConst = "eval_const";
446 const Function& func = Function::Handle(Function::New( 446 const Function& func = Function::Handle(Function::New(
447 String::Handle(Symbols::New(kEvalConst)), 447 String::Handle(Symbols::New(kEvalConst)),
448 RawFunction::kConstImplicitGetter, 448 RawFunction::kConstImplicitGetter,
449 true, // static function. 449 true, // static function.
450 false, // not const function. 450 false, // not const function.
451 false, // not abstract
451 false, // not external. 452 false, // not external.
452 fragment->token_pos())); 453 fragment->token_pos()));
453 454
454 func.set_result_type(Type::Handle(Type::DynamicType())); 455 func.set_result_type(Type::Handle(Type::DynamicType()));
455 func.set_num_fixed_parameters(0); 456 func.set_num_fixed_parameters(0);
456 func.set_num_optional_parameters(0); 457 func.set_num_optional_parameters(0);
457 458
458 // The function needs to be associated with a named Class: the interface 459 // The function needs to be associated with a named Class: the interface
459 // Function fits the bill. 460 // Function fits the bill.
460 func.set_owner(Class::Handle( 461 func.set_owner(Class::Handle(
(...skipping 27 matching lines...) Expand all
488 isolate->object_store()->clear_sticky_error(); 489 isolate->object_store()->clear_sticky_error();
489 isolate->set_long_jump_base(base); 490 isolate->set_long_jump_base(base);
490 return result.raw(); 491 return result.raw();
491 } 492 }
492 UNREACHABLE(); 493 UNREACHABLE();
493 return Object::null(); 494 return Object::null();
494 } 495 }
495 496
496 497
497 } // namespace dart 498 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_patcher_x64_test.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698