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

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

Issue 9854030: Improve checked mode a little (more to come in a different CL). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | « no previous file | runtime/vm/intrinsifier_ia32.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/globals.h" // Needed here to get TARGET_ARCH_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/code_generator.h" 8 #include "vm/code_generator.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 } else { 698 } else {
699 __ LoadObject(EAX, literal); 699 __ LoadObject(EAX, literal);
700 } 700 }
701 } else { 701 } else {
702 // Pop the previously evaluated result value into EAX. 702 // Pop the previously evaluated result value into EAX.
703 __ popl(EAX); 703 __ popl(EAX);
704 } 704 }
705 705
706 // Generate type check. 706 // Generate type check.
707 if (FLAG_enable_type_checks) { 707 if (FLAG_enable_type_checks) {
708 const bool returns_null = node->value()->IsLiteralNode() &&
709 node->value()->AsLiteralNode()->literal().IsNull();
708 const RawFunction::Kind kind = parsed_function().function().kind(); 710 const RawFunction::Kind kind = parsed_function().function().kind();
709 // Implicit getters do not need a type check at return. 711 // Implicit getters do not need a type check at return.
710 if ((kind != RawFunction::kImplicitGetter) && 712 if (!returns_null &&
713 (kind != RawFunction::kImplicitGetter) &&
711 (kind != RawFunction::kConstImplicitGetter)) { 714 (kind != RawFunction::kConstImplicitGetter)) {
712 GenerateAssertAssignable( 715 GenerateAssertAssignable(
713 node->id(), 716 node->id(),
714 node->value()->token_index(), 717 node->value()->token_index(),
715 AbstractType::ZoneHandle(parsed_function().function().result_type()), 718 AbstractType::ZoneHandle(parsed_function().function().result_type()),
716 String::ZoneHandle(String::NewSymbol("function result"))); 719 String::ZoneHandle(String::NewSymbol("function result")));
717 } 720 }
718 } 721 }
719 GenerateReturnEpilog(node); 722 GenerateReturnEpilog(node);
720 } 723 }
(...skipping 1976 matching lines...) Expand 10 before | Expand all | Expand 10 after
2697 const Error& error = Error::Handle( 2700 const Error& error = Error::Handle(
2698 Parser::FormatError(script, token_index, "Error", format, args)); 2701 Parser::FormatError(script, token_index, "Error", format, args));
2699 va_end(args); 2702 va_end(args);
2700 Isolate::Current()->long_jump_base()->Jump(1, error); 2703 Isolate::Current()->long_jump_base()->Jump(1, error);
2701 UNREACHABLE(); 2704 UNREACHABLE();
2702 } 2705 }
2703 2706
2704 } // namespace dart 2707 } // namespace dart
2705 2708
2706 #endif // defined TARGET_ARCH_IA32 2709 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intrinsifier_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698