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

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

Issue 619903002: Generalize bounds checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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
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/block_scheduler.h" 10 #include "vm/block_scheduler.h"
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 PcDescriptors::Handle(code.pc_descriptors()); 705 PcDescriptors::Handle(code.pc_descriptors());
706 OS::Print("%s}\n", descriptors.ToCString()); 706 OS::Print("%s}\n", descriptors.ToCString());
707 707
708 uword start = Instructions::Handle(code.instructions()).EntryPoint(); 708 uword start = Instructions::Handle(code.instructions()).EntryPoint();
709 const Array& deopt_table = Array::Handle(code.deopt_info_array()); 709 const Array& deopt_table = Array::Handle(code.deopt_info_array());
710 intptr_t deopt_table_length = DeoptTable::GetLength(deopt_table); 710 intptr_t deopt_table_length = DeoptTable::GetLength(deopt_table);
711 if (deopt_table_length > 0) { 711 if (deopt_table_length > 0) {
712 OS::Print("DeoptInfo: {\n"); 712 OS::Print("DeoptInfo: {\n");
713 Smi& offset = Smi::Handle(); 713 Smi& offset = Smi::Handle();
714 DeoptInfo& info = DeoptInfo::Handle(); 714 DeoptInfo& info = DeoptInfo::Handle();
715 Smi& reason = Smi::Handle(); 715 Smi& reason_and_flags = Smi::Handle();
716 for (intptr_t i = 0; i < deopt_table_length; ++i) { 716 for (intptr_t i = 0; i < deopt_table_length; ++i) {
717 DeoptTable::GetEntry(deopt_table, i, &offset, &info, &reason); 717 DeoptTable::GetEntry(deopt_table, i, &offset, &info, &reason_and_flags);
718 ASSERT((0 <= reason.Value()) && 718 const intptr_t reason =
719 (reason.Value() < ICData::kDeoptNumReasons)); 719 DeoptTable::ReasonField::decode(reason_and_flags.Value());
720 ASSERT((0 <= reason) && (reason < ICData::kDeoptNumReasons));
720 OS::Print("%4" Pd ": 0x%" Px " %s (%s)\n", 721 OS::Print("%4" Pd ": 0x%" Px " %s (%s)\n",
721 i, 722 i,
722 start + offset.Value(), 723 start + offset.Value(),
723 info.ToCString(), 724 info.ToCString(),
724 DeoptReasonToCString( 725 DeoptReasonToCString(
725 static_cast<ICData::DeoptReasonId>(reason.Value()))); 726 static_cast<ICData::DeoptReasonId>(reason)));
726 } 727 }
727 OS::Print("}\n"); 728 OS::Print("}\n");
728 } 729 }
729 730
730 const Array& object_table = Array::Handle(code.object_table()); 731 const Array& object_table = Array::Handle(code.object_table());
731 if (object_table.Length() > 0) { 732 if (object_table.Length() > 0) {
732 OS::Print("Object Table: {\n"); 733 OS::Print("Object Table: {\n");
733 for (intptr_t i = 0; i < object_table.Length(); i++) { 734 for (intptr_t i = 0; i < object_table.Length(); i++) {
734 OS::Print(" %" Pd ": %s\n", i, 735 OS::Print(" %" Pd ": %s\n", i,
735 Object::Handle(object_table.At(i)).ToCString()); 736 Object::Handle(object_table.At(i)).ToCString());
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 const Object& result = 1063 const Object& result =
1063 PassiveObject::Handle(isolate->object_store()->sticky_error()); 1064 PassiveObject::Handle(isolate->object_store()->sticky_error());
1064 isolate->object_store()->clear_sticky_error(); 1065 isolate->object_store()->clear_sticky_error();
1065 return result.raw(); 1066 return result.raw();
1066 } 1067 }
1067 UNREACHABLE(); 1068 UNREACHABLE();
1068 return Object::null(); 1069 return Object::null();
1069 } 1070 }
1070 1071
1071 } // namespace dart 1072 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698