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

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

Issue 10010029: When checking against non-parametrized types use a cache to hold result tuples (class, result). Tha… (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
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_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 "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 __ j(NOT_EQUAL, &runtime_call, Assembler::kNearJump); 549 __ j(NOT_EQUAL, &runtime_call, Assembler::kNearJump);
550 __ PushObject(negate_result ? bool_false : bool_true); 550 __ PushObject(negate_result ? bool_false : bool_true);
551 __ jmp(&done, Assembler::kNearJump); 551 __ jmp(&done, Assembler::kNearJump);
552 __ Bind(&runtime_call); 552 __ Bind(&runtime_call);
553 } 553 }
554 } 554 }
555 } 555 }
556 __ PushObject(Object::ZoneHandle()); // Make room for the result. 556 __ PushObject(Object::ZoneHandle()); // Make room for the result.
557 const Immediate location = 557 const Immediate location =
558 Immediate(reinterpret_cast<int64_t>(Smi::New(token_index))); 558 Immediate(reinterpret_cast<int64_t>(Smi::New(token_index)));
559 const Immediate node_id_as_smi =
560 Immediate(reinterpret_cast<int64_t>(Smi::New(node_id)));
559 __ pushq(location); // Push the source location. 561 __ pushq(location); // Push the source location.
562 __ pushq(node_id_as_smi);
560 __ pushq(RAX); // Push the instance. 563 __ pushq(RAX); // Push the instance.
561 __ PushObject(type); // Push the type. 564 __ PushObject(type); // Push the type.
562 if (!type.IsInstantiated()) { 565 if (!type.IsInstantiated()) {
563 GenerateInstantiatorTypeArguments(token_index); 566 GenerateInstantiatorTypeArguments(token_index);
564 } else { 567 } else {
565 __ pushq(raw_null); // Null instantiator. 568 __ pushq(raw_null); // Null instantiator.
566 } 569 }
567 GenerateCallRuntime(node_id, token_index, kInstanceofRuntimeEntry); 570 GenerateCallRuntime(node_id, token_index, kInstanceofRuntimeEntry);
568 // Pop the two parameters supplied to the runtime entry. The result of the 571 // Pop the two parameters supplied to the runtime entry. The result of the
569 // instanceof runtime call will be left as the result of the operation. 572 // instanceof runtime call will be left as the result of the operation.
570 __ addq(RSP, Immediate(4 * kWordSize)); 573 __ addq(RSP, Immediate(5 * kWordSize));
571 if (negate_result) { 574 if (negate_result) {
572 Label negate_done; 575 Label negate_done;
573 __ popq(RDX); 576 __ popq(RDX);
574 __ LoadObject(RAX, bool_true); 577 __ LoadObject(RAX, bool_true);
575 __ cmpq(RDX, RAX); 578 __ cmpq(RDX, RAX);
576 __ j(NOT_EQUAL, &negate_done, Assembler::kNearJump); 579 __ j(NOT_EQUAL, &negate_done, Assembler::kNearJump);
577 __ LoadObject(RAX, bool_false); 580 __ LoadObject(RAX, bool_false);
578 __ Bind(&negate_done); 581 __ Bind(&negate_done);
579 __ pushq(RAX); 582 __ pushq(RAX);
580 } 583 }
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) { 1295 void FlowGraphCompiler::FinalizeExceptionHandlers(const Code& code) {
1293 // We don't compile exception handlers yet. 1296 // We don't compile exception handlers yet.
1294 code.set_exception_handlers( 1297 code.set_exception_handlers(
1295 ExceptionHandlers::Handle(ExceptionHandlers::New(0))); 1298 ExceptionHandlers::Handle(ExceptionHandlers::New(0)));
1296 } 1299 }
1297 1300
1298 1301
1299 } // namespace dart 1302 } // namespace dart
1300 1303
1301 #endif // defined TARGET_ARCH_X64 1304 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698