Index: runtime/vm/intrinsifier_x64.cc |
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc |
index 14eb3cf88885901d1df596bb213f4f46d3c760dc..bd56e2da74f483bfa2cdefc79402014b06265643 100644 |
--- a/runtime/vm/intrinsifier_x64.cc |
+++ b/runtime/vm/intrinsifier_x64.cc |
@@ -1524,6 +1524,41 @@ void Intrinsifier::ObjectEquals(Assembler* assembler) { |
} |
+// Return type quickly for simple types (not parametrized and not signature) |
regis
2015/06/30 23:28:32
ditto
srdjan
2015/07/01 00:35:41
ditto
|
+void Intrinsifier::ObjectRuntimeType(Assembler* assembler) { |
+ Label fall_through, not_smi, cid_loaded; |
+ __ movq(RAX, Address(RSP, + 1 * kWordSize)); |
+ // Note: we cannot refer to IntType inside intrinsic code. |
+ __ testq(RAX, Immediate(kSmiTagMask)); |
+ __ j(NOT_ZERO, ¬_smi, Assembler::kNearJump); |
+ __ LoadImmediate(RCX, Immediate(kSmiCid), PP); |
+ __ jmp(&cid_loaded); |
+ __ Bind(¬_smi); |
+ __ LoadClassId(RCX, RAX); |
+ __ Bind(&cid_loaded); |
+ |
+ // RCX: untagged cid of instance (RAX). |
+ __ LoadClassById(RDI, RCX, PP); |
+ // RDI: class of instance (RAX). |
+ // if ((NumTypeArguments() == 0) && !IsSignatureClass()) { |
+ // return reinterpret_cast<RawType*>(raw_ptr()->canonical_types_); |
+ // } |
+ __ movq(RCX, FieldAddress(RDI, Class::signature_function_offset())); |
+ __ CompareObject(RCX, Object::null_object(), PP); |
+ __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); |
+ |
+ __ movzxw(RCX, FieldAddress(RDI, Class::num_type_arguments_offset())); |
+ __ cmpq(RCX, Immediate(0)); |
+ __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); |
+ __ movq(RAX, FieldAddress(RDI, Class::canonical_types_offset())); |
+ __ CompareObject(RAX, Object::null_object(), PP); |
+ __ j(EQUAL, &fall_through, Assembler::kNearJump); // Not yet set. |
+ __ ret(); |
+ |
+ __ Bind(&fall_through); |
+} |
+ |
+ |
void Intrinsifier::String_getHashCode(Assembler* assembler) { |
Label fall_through; |
__ movq(RAX, Address(RSP, + 1 * kWordSize)); // String object. |
@@ -1932,7 +1967,8 @@ void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) { |
// Registers are now set up for the lazy compile stub. It expects the function |
// in RAX, the argument descriptor in R10, and IC-Data in RCX. |
static const intptr_t arg_count = RegExpMacroAssembler::kParamCount; |
- __ LoadObject(R10, Array::Handle(ArgumentsDescriptor::New(arg_count)), PP); |
+ __ LoadObject(R10, |
+ Array::ZoneHandle(ArgumentsDescriptor::New(arg_count)), PP); |
__ xorq(RCX, RCX); |
// Tail-call the function. |