Index: runtime/lib/object.cc |
diff --git a/runtime/lib/object.cc b/runtime/lib/object.cc |
index b450038b0f5a832117a6b8c458eee5da46f28e3d..ac1e1725e4ea6cff86e964fd0d9e485058bdf70b 100644 |
--- a/runtime/lib/object.cc |
+++ b/runtime/lib/object.cc |
@@ -39,9 +39,11 @@ DEFINE_NATIVE_ENTRY(Object_equals, 1) { |
DEFINE_NATIVE_ENTRY(Object_getHash, 1) { |
- const Instance& instance = Instance::CheckedHandle(arguments->NativeArgAt(0)); |
+ // Please note that no handle is created for the argument. |
+ // This is safe since the argument is only used in a tail call. |
+ // The performance benefit is more than 5% when using hashCode. |
siva
2016/07/08 22:12:10
Maybe add:
ASSERT(arguments->NativeArgAt(0)->IsDa
bakster
2016/07/08 22:15:11
Done.
|
Heap* heap = isolate->heap(); |
- return Smi::New(heap->GetHash(instance.raw())); |
+ return Smi::New(heap->GetHash(arguments->NativeArgAt(0))); |
} |