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

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

Issue 10352012: Using SubtypeTestCache object instead of an array, that way we do not need to patch and can communi… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 "lib/error.h" 10 #include "lib/error.h"
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 __ pushq(Immediate(Smi::RawValue(token_index))); // Source location. 341 __ pushq(Immediate(Smi::RawValue(token_index))); // Source location.
342 __ pushq(Immediate(Smi::RawValue(cid))); // Computation id. 342 __ pushq(Immediate(Smi::RawValue(cid))); // Computation id.
343 __ pushq(RAX); // Push the source object. 343 __ pushq(RAX); // Push the source object.
344 __ PushObject(dst_type); // Push the type of the destination. 344 __ PushObject(dst_type); // Push the type of the destination.
345 if (!dst_type.IsInstantiated()) { 345 if (!dst_type.IsInstantiated()) {
346 __ pushq(RDX); // Instantiator type arguments. 346 __ pushq(RDX); // Instantiator type arguments.
347 } else { 347 } else {
348 __ pushq(raw_null); // Null instantiator. 348 __ pushq(raw_null); // Null instantiator.
349 } 349 }
350 __ PushObject(dst_name); // Push the name of the destination. 350 __ PushObject(dst_name); // Push the name of the destination.
351 __ pushq(raw_null); // SubtypeTestCache not yet supported.
351 GenerateCallRuntime(cid, 352 GenerateCallRuntime(cid,
352 token_index, 353 token_index,
353 try_index, 354 try_index,
354 kTypeCheckRuntimeEntry); 355 kTypeCheckRuntimeEntry);
355 // Pop the parameters supplied to the runtime entry. The result of the 356 // Pop the parameters supplied to the runtime entry. The result of the
356 // type check runtime call is the checked value. 357 // type check runtime call is the checked value.
357 __ addq(RSP, Immediate(6 * kWordSize)); 358 __ addq(RSP, Immediate(7 * kWordSize));
358 __ popq(RAX); 359 __ popq(RAX);
359 360
360 __ Bind(&is_assignable); 361 __ Bind(&is_assignable);
361 } 362 }
362 363
363 364
364 void FlowGraphCompiler::LoadValue(Register dst, Value* value) { 365 void FlowGraphCompiler::LoadValue(Register dst, Value* value) {
365 if (value->IsConstant()) { 366 if (value->IsConstant()) {
366 ConstantVal* constant = value->AsConstant(); 367 ConstantVal* constant = value->AsConstant();
367 if (constant->value().IsSmi()) { 368 if (constant->value().IsSmi()) {
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 __ PushObject(Object::ZoneHandle()); // Make room for the result. 837 __ PushObject(Object::ZoneHandle()); // Make room for the result.
837 __ pushq(Immediate(Smi::RawValue(token_index))); // Source location. 838 __ pushq(Immediate(Smi::RawValue(token_index))); // Source location.
838 __ pushq(Immediate(Smi::RawValue(cid))); // Computation id. 839 __ pushq(Immediate(Smi::RawValue(cid))); // Computation id.
839 __ pushq(RAX); // Push the instance. 840 __ pushq(RAX); // Push the instance.
840 __ PushObject(type); // Push the type. 841 __ PushObject(type); // Push the type.
841 if (!type.IsInstantiated()) { 842 if (!type.IsInstantiated()) {
842 __ pushq(RDX); // Instantiator type arguments. 843 __ pushq(RDX); // Instantiator type arguments.
843 } else { 844 } else {
844 __ pushq(raw_null); // Null instantiator. 845 __ pushq(raw_null); // Null instantiator.
845 } 846 }
847 __ pushq(raw_null); // SubtypeTestCache not yet supported.
846 GenerateCallRuntime(cid, token_index, try_index, kInstanceofRuntimeEntry); 848 GenerateCallRuntime(cid, token_index, try_index, kInstanceofRuntimeEntry);
847 // Pop the two parameters supplied to the runtime entry. The result of the 849 // Pop the two parameters supplied to the runtime entry. The result of the
848 // instanceof runtime call will be left as the result of the operation. 850 // instanceof runtime call will be left as the result of the operation.
849 __ addq(RSP, Immediate(5 * kWordSize)); 851 __ addq(RSP, Immediate(6 * kWordSize));
850 Label done; 852 Label done;
851 if (negate_result) { 853 if (negate_result) {
852 __ popq(RDX); 854 __ popq(RDX);
853 __ LoadObject(RAX, bool_true); 855 __ LoadObject(RAX, bool_true);
854 __ cmpq(RDX, RAX); 856 __ cmpq(RDX, RAX);
855 __ j(NOT_EQUAL, &done, Assembler::kNearJump); 857 __ j(NOT_EQUAL, &done, Assembler::kNearJump);
856 __ LoadObject(RAX, bool_false); 858 __ LoadObject(RAX, bool_false);
857 } else { 859 } else {
858 __ popq(RAX); 860 __ popq(RAX);
859 } 861 }
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1726 ASSERT(exception_handlers_list_ != NULL); 1728 ASSERT(exception_handlers_list_ != NULL);
1727 const ExceptionHandlers& handlers = ExceptionHandlers::Handle( 1729 const ExceptionHandlers& handlers = ExceptionHandlers::Handle(
1728 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint())); 1730 exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint()));
1729 code.set_exception_handlers(handlers); 1731 code.set_exception_handlers(handlers);
1730 } 1732 }
1731 1733
1732 1734
1733 } // namespace dart 1735 } // namespace dart
1734 1736
1735 #endif // defined TARGET_ARCH_X64 1737 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698