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

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

Issue 12221139: Revert "Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_optimizer.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
11 #include "vm/ast_printer.h" 11 #include "vm/ast_printer.h"
12 #include "vm/dart_entry.h" 12 #include "vm/dart_entry.h"
13 #include "vm/il_printer.h" 13 #include "vm/il_printer.h"
14 #include "vm/locations.h" 14 #include "vm/locations.h"
15 #include "vm/object_store.h" 15 #include "vm/object_store.h"
16 #include "vm/parser.h" 16 #include "vm/parser.h"
17 #include "vm/stub_code.h" 17 #include "vm/stub_code.h"
18 #include "vm/symbols.h" 18 #include "vm/symbols.h"
19 19
20 namespace dart { 20 namespace dart {
21 21
22 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); 22 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization.");
23 DECLARE_FLAG(int, optimization_counter_threshold); 23 DECLARE_FLAG(int, optimization_counter_threshold);
24 DECLARE_FLAG(bool, print_ast); 24 DECLARE_FLAG(bool, print_ast);
25 DECLARE_FLAG(bool, print_scopes); 25 DECLARE_FLAG(bool, print_scopes);
26 DECLARE_FLAG(bool, eliminate_type_checks); 26 DECLARE_FLAG(bool, use_sse41);
27 27
28 28
29 FlowGraphCompiler::~FlowGraphCompiler() { 29 FlowGraphCompiler::~FlowGraphCompiler() {
30 // BlockInfos are zone-allocated, so their destructors are not called. 30 // BlockInfos are zone-allocated, so their destructors are not called.
31 // Verify the labels explicitly here. 31 // Verify the labels explicitly here.
32 for (int i = 0; i < block_info_.length(); ++i) { 32 for (int i = 0; i < block_info_.length(); ++i) {
33 ASSERT(!block_info_[i]->label.IsLinked()); 33 ASSERT(!block_info_[i]->label.IsLinked());
34 ASSERT(!block_info_[i]->label.HasNear()); 34 ASSERT(!block_info_[i]->label.HasNear());
35 } 35 }
36 } 36 }
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 (!dst_type.IsDynamicType() && !dst_type.IsObjectType())); 554 (!dst_type.IsDynamicType() && !dst_type.IsObjectType()));
555 __ pushq(RCX); // Store instantiator. 555 __ pushq(RCX); // Store instantiator.
556 __ pushq(RDX); // Store instantiator type arguments. 556 __ pushq(RDX); // Store instantiator type arguments.
557 // A null object is always assignable and is returned as result. 557 // A null object is always assignable and is returned as result.
558 const Immediate& raw_null = 558 const Immediate& raw_null =
559 Immediate(reinterpret_cast<intptr_t>(Object::null())); 559 Immediate(reinterpret_cast<intptr_t>(Object::null()));
560 Label is_assignable, runtime_call; 560 Label is_assignable, runtime_call;
561 __ cmpq(RAX, raw_null); 561 __ cmpq(RAX, raw_null);
562 __ j(EQUAL, &is_assignable); 562 __ j(EQUAL, &is_assignable);
563 563
564 if (!FLAG_eliminate_type_checks) {
565 // If type checks are not eliminated during the graph building then
566 // a transition sentinel can be seen here.
567 __ CompareObject(RAX, Object::transition_sentinel());
568 __ j(EQUAL, &is_assignable);
569 }
570
571 // Generate throw new TypeError() if the type is malformed. 564 // Generate throw new TypeError() if the type is malformed.
572 if (dst_type.IsMalformed()) { 565 if (dst_type.IsMalformed()) {
573 const Error& error = Error::Handle(dst_type.malformed_error()); 566 const Error& error = Error::Handle(dst_type.malformed_error());
574 const String& error_message = String::ZoneHandle( 567 const String& error_message = String::ZoneHandle(
575 Symbols::New(error.ToErrorCString())); 568 Symbols::New(error.ToErrorCString()));
576 __ PushObject(Object::ZoneHandle()); // Make room for the result. 569 __ PushObject(Object::ZoneHandle()); // Make room for the result.
577 __ pushq(RAX); // Push the source object. 570 __ pushq(RAX); // Push the source object.
578 __ PushObject(dst_name); // Push the name of the destination. 571 __ PushObject(dst_name); // Push the name of the destination.
579 __ PushObject(error_message); 572 __ PushObject(error_message);
580 GenerateCallRuntime(token_pos, 573 GenerateCallRuntime(token_pos,
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) { 1700 void ParallelMoveResolver::Exchange(const Address& mem1, const Address& mem2) {
1708 __ Exchange(mem1, mem2); 1701 __ Exchange(mem1, mem2);
1709 } 1702 }
1710 1703
1711 1704
1712 #undef __ 1705 #undef __
1713 1706
1714 } // namespace dart 1707 } // namespace dart
1715 1708
1716 #endif // defined TARGET_ARCH_X64 1709 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698