Index: runtime/vm/intrinsifier_ia32.cc |
diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc |
index 93290edd32754b4443ff83411806c01ed7cf5343..09e7744e6563254484579761ab18a7059fd6cbbe 100644 |
--- a/runtime/vm/intrinsifier_ia32.cc |
+++ b/runtime/vm/intrinsifier_ia32.cc |
@@ -1666,6 +1666,39 @@ void Intrinsifier::ObjectEquals(Assembler* assembler) { |
} |
+// Return type quickly for simple types (not parametrized and not signature) |
regis
2015/06/30 23:28:32
parametrized -> parameterized
srdjan
2015/07/01 00:35:41
Done.
|
+void Intrinsifier::ObjectRuntimeType(Assembler* assembler) { |
+ Label fall_through, not_smi; |
+ __ movl(EAX, Address(ESP, + 1 * kWordSize)); |
+ __ testl(EAX, Immediate(kSmiTagMask)); |
+ __ j(NOT_ZERO, ¬_smi, Assembler::kNearJump); |
+ __ LoadObject(EAX, Type::ZoneHandle(Type::IntType())); |
+ __ ret(); |
+ |
+ __ Bind(¬_smi); |
+ __ LoadClass(EBX, EAX, EDI); |
regis
2015/06/30 23:28:32
The C++ code explicitly checks for a null instance
srdjan
2015/07/01 00:35:41
Added a test. The explicit check is probably in C+
|
+ // EBX: class of instance (EAX). |
+ // if ((NumTypeArguments() == 0) && !IsSignatureClass()) { |
+ // return reinterpret_cast<RawType*>(raw_ptr()->canonical_types_); |
+ // } |
regis
2015/06/30 23:28:32
I would remove the code in the comment.
srdjan
2015/07/01 00:35:41
Done.
|
+ const Immediate& raw_null = |
+ Immediate(reinterpret_cast<intptr_t>(Object::null())); |
+ __ movl(EDI, FieldAddress(EBX, Class::signature_function_offset())); |
+ __ cmpl(EDI, raw_null); |
+ __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); |
+ |
+ __ movzxw(EDI, FieldAddress(EBX, Class::num_type_arguments_offset())); |
+ __ cmpl(EDI, Immediate(0)); |
+ __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); |
+ __ movl(EAX, FieldAddress(EBX, Class::canonical_types_offset())); |
+ __ cmpl(EAX, raw_null); |
+ __ j(EQUAL, &fall_through, Assembler::kNearJump); // Not yet set. |
+ __ ret(); |
+ |
+ __ Bind(&fall_through); |
+} |
+ |
+ |
void Intrinsifier::String_getHashCode(Assembler* assembler) { |
Label fall_through; |
__ movl(EAX, Address(ESP, + 1 * kWordSize)); // String object. |
@@ -2073,7 +2106,7 @@ void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) { |
// Registers are now set up for the lazy compile stub. It expects the function |
// in EAX, the argument descriptor in EDX, and IC-Data in ECX. |
static const intptr_t arg_count = RegExpMacroAssembler::kParamCount; |
- __ LoadObject(EDX, Array::Handle(ArgumentsDescriptor::New(arg_count))); |
+ __ LoadObject(EDX, Array::ZoneHandle(ArgumentsDescriptor::New(arg_count))); |
__ xorl(ECX, ECX); |
// Tail-call the function. |