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

Side by Side Diff: vm/flow_graph_compiler.cc

Issue 11745022: - Make Boolean 'true' and 'false' singleton VM isolate objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 7 years, 11 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 | « vm/flow_graph_builder.cc ('k') | vm/flow_graph_compiler_ia32.h » ('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_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/cha.h" 9 #include "vm/cha.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 exception_handlers_list_(NULL), 143 exception_handlers_list_(NULL),
144 pc_descriptors_list_(NULL), 144 pc_descriptors_list_(NULL),
145 stackmap_table_builder_( 145 stackmap_table_builder_(
146 is_optimizing ? new StackmapTableBuilder() : NULL), 146 is_optimizing ? new StackmapTableBuilder() : NULL),
147 block_info_(block_order_.length()), 147 block_info_(block_order_.length()),
148 deopt_infos_(), 148 deopt_infos_(),
149 static_calls_target_table_(GrowableObjectArray::ZoneHandle( 149 static_calls_target_table_(GrowableObjectArray::ZoneHandle(
150 GrowableObjectArray::New())), 150 GrowableObjectArray::New())),
151 is_optimizing_(is_optimizing), 151 is_optimizing_(is_optimizing),
152 may_reoptimize_(false), 152 may_reoptimize_(false),
153 bool_true_(Bool::ZoneHandle(Bool::True())),
154 bool_false_(Bool::ZoneHandle(Bool::False())),
155 double_class_(Class::ZoneHandle( 153 double_class_(Class::ZoneHandle(
156 Isolate::Current()->object_store()->double_class())), 154 Isolate::Current()->object_store()->double_class())),
157 parallel_move_resolver_(this) { 155 parallel_move_resolver_(this) {
158 ASSERT(assembler != NULL); 156 ASSERT(assembler != NULL);
159 } 157 }
160 158
161 159
162 FlowGraphCompiler::~FlowGraphCompiler() { 160 FlowGraphCompiler::~FlowGraphCompiler() {
163 // BlockInfos are zone-allocated, so their destructors are not called. 161 // BlockInfos are zone-allocated, so their destructors are not called.
164 // Verify the labels explicitly here. 162 // Verify the labels explicitly here.
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 720
723 void FlowGraphCompiler::EmitDoubleCompareBool(Condition true_condition, 721 void FlowGraphCompiler::EmitDoubleCompareBool(Condition true_condition,
724 XmmRegister left, 722 XmmRegister left,
725 XmmRegister right, 723 XmmRegister right,
726 Register result) { 724 Register result) {
727 assembler()->comisd(left, right); 725 assembler()->comisd(left, right);
728 Label is_false, is_true, done; 726 Label is_false, is_true, done;
729 assembler()->j(PARITY_EVEN, &is_false, Assembler::kNearJump); // NaN false; 727 assembler()->j(PARITY_EVEN, &is_false, Assembler::kNearJump); // NaN false;
730 assembler()->j(true_condition, &is_true, Assembler::kNearJump); 728 assembler()->j(true_condition, &is_true, Assembler::kNearJump);
731 assembler()->Bind(&is_false); 729 assembler()->Bind(&is_false);
732 assembler()->LoadObject(result, bool_false()); 730 assembler()->LoadObject(result, Bool::False());
733 assembler()->jmp(&done); 731 assembler()->jmp(&done);
734 assembler()->Bind(&is_true); 732 assembler()->Bind(&is_true);
735 assembler()->LoadObject(result, bool_true()); 733 assembler()->LoadObject(result, Bool::True());
736 assembler()->Bind(&done); 734 assembler()->Bind(&done);
737 } 735 }
738 736
739 737
740 // Allocate a register that is not explicitly blocked. 738 // Allocate a register that is not explicitly blocked.
741 static Register AllocateFreeRegister(bool* blocked_registers) { 739 static Register AllocateFreeRegister(bool* blocked_registers) {
742 for (intptr_t regno = 0; regno < kNumberOfCpuRegisters; regno++) { 740 for (intptr_t regno = 0; regno < kNumberOfCpuRegisters; regno++) {
743 if (!blocked_registers[regno]) { 741 if (!blocked_registers[regno]) {
744 blocked_registers[regno] = true; 742 blocked_registers[regno] = true;
745 return static_cast<Register>(regno); 743 return static_cast<Register>(regno);
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 const AbstractTypeArguments& type_arguments = 1072 const AbstractTypeArguments& type_arguments =
1075 AbstractTypeArguments::Handle(type.arguments()); 1073 AbstractTypeArguments::Handle(type.arguments());
1076 const bool is_raw_type = type_arguments.IsNull() || 1074 const bool is_raw_type = type_arguments.IsNull() ||
1077 type_arguments.IsRaw(type_arguments.Length()); 1075 type_arguments.IsRaw(type_arguments.Length());
1078 return is_raw_type; 1076 return is_raw_type;
1079 } 1077 }
1080 return true; 1078 return true;
1081 } 1079 }
1082 1080
1083 } // namespace dart 1081 } // namespace dart
OLDNEW
« no previous file with comments | « vm/flow_graph_builder.cc ('k') | vm/flow_graph_compiler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698