Revision: 24503
Author:   [email protected]
Date:     Thu Oct  9 18:09:14 2014 UTC
Log:      MIPS: Add MEGAMORPHIC state support for KeyedStoreIC.

Port r24500 (e10f342)

BUG=
[email protected]

Review URL: https://codereview.chromium.org/645593006
https://code.google.com/p/v8/source/detail?r=24503

Modified:
 /branches/bleeding_edge/src/ic/mips/ic-mips.cc
 /branches/bleeding_edge/src/ic/mips64/ic-mips64.cc

=======================================
--- /branches/bleeding_edge/src/ic/mips/ic-mips.cc Mon Sep 22 13:23:27 2014 UTC +++ /branches/bleeding_edge/src/ic/mips/ic-mips.cc Thu Oct 9 18:09:14 2014 UTC
@@ -766,8 +766,9 @@
 }


-void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
-                                   StrictMode strict_mode) {
+void KeyedStoreIC::GenerateGeneric(
+    MacroAssembler* masm, StrictMode strict_mode,
+    KeyedStoreStubCacheRequirement handler_requirement) {
   // ---------- S t a t e --------------
   //  -- a0     : value
   //  -- a1     : key
@@ -776,7 +777,7 @@
   // -----------------------------------
   Label slow, fast_object, fast_object_grow;
   Label fast_double, fast_double_grow;
-  Label array, extra, check_if_double_array;
+  Label array, extra, check_if_double_array, maybe_name_key, miss;

   // Register usage.
   Register value = StoreDescriptor::ValueRegister();
@@ -789,7 +790,7 @@
   // t0 and t1 are used as general scratch registers.

   // Check that the key is a smi.
-  __ JumpIfNotSmi(key, &slow);
+  __ JumpIfNotSmi(key, &maybe_name_key);
   // Check that the object isn't a smi.
   __ JumpIfSmi(receiver, &slow);
   // Get the map of the object.
@@ -819,6 +820,23 @@
   // a1: key.
   // a2: receiver.
   PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode);
+  // Never returns to here.
+
+  __ bind(&maybe_name_key);
+  __ lw(t0, FieldMemOperand(key, HeapObject::kMapOffset));
+  __ lb(t0, FieldMemOperand(t0, Map::kInstanceTypeOffset));
+  __ JumpIfNotUniqueNameInstanceType(t0, &slow);
+  Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
+      Code::ComputeHandlerFlags(Code::STORE_IC));
+ masm->isolate()->stub_cache()->GenerateProbe(masm, flags, false, receiver,
+                                               key, a3, t0, t1, t2);
+  // Cache miss.
+  if (handler_requirement == kCallRuntimeOnMissingHandler) {
+    __ Branch(&slow);
+  } else {
+    DCHECK(handler_requirement == kMissOnMissingHandler);
+    __ Branch(&miss);
+  }

   // Extra capacity case: Check if there is extra capacity to
   // perform the store and update the length. Used for adding one
@@ -858,6 +876,9 @@
&slow, kDontCheckMap, kIncrementLength, value, key, receiver, receiver_map, elements_map,
                                   elements);
+
+  __ bind(&miss);
+  GenerateMiss(masm);
 }


=======================================
--- /branches/bleeding_edge/src/ic/mips64/ic-mips64.cc Mon Sep 22 16:08:49 2014 UTC +++ /branches/bleeding_edge/src/ic/mips64/ic-mips64.cc Thu Oct 9 18:09:14 2014 UTC
@@ -775,8 +775,9 @@
 }


-void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
-                                   StrictMode strict_mode) {
+void KeyedStoreIC::GenerateGeneric(
+    MacroAssembler* masm, StrictMode strict_mode,
+    KeyedStoreStubCacheRequirement handler_requirement) {
   // ---------- S t a t e --------------
   //  -- a0     : value
   //  -- a1     : key
@@ -785,7 +786,7 @@
   // -----------------------------------
   Label slow, fast_object, fast_object_grow;
   Label fast_double, fast_double_grow;
-  Label array, extra, check_if_double_array;
+  Label array, extra, check_if_double_array, maybe_name_key, miss;

   // Register usage.
   Register value = StoreDescriptor::ValueRegister();
@@ -798,7 +799,7 @@
   // a4 and a5 are used as general scratch registers.

   // Check that the key is a smi.
-  __ JumpIfNotSmi(key, &slow);
+  __ JumpIfNotSmi(key, &maybe_name_key);
   // Check that the object isn't a smi.
   __ JumpIfSmi(receiver, &slow);
   // Get the map of the object.
@@ -828,6 +829,23 @@
   // a1: key.
   // a2: receiver.
   PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode);
+  // Never returns to here.
+
+  __ bind(&maybe_name_key);
+  __ ld(a4, FieldMemOperand(key, HeapObject::kMapOffset));
+  __ lb(a4, FieldMemOperand(a4, Map::kInstanceTypeOffset));
+  __ JumpIfNotUniqueNameInstanceType(a4, &slow);
+  Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
+      Code::ComputeHandlerFlags(Code::STORE_IC));
+ masm->isolate()->stub_cache()->GenerateProbe(masm, flags, false, receiver,
+                                               key, a3, a4, a5, a6);
+  // Cache miss.
+  if (handler_requirement == kCallRuntimeOnMissingHandler) {
+    __ Branch(&slow);
+  } else {
+    DCHECK(handler_requirement == kMissOnMissingHandler);
+    __ Branch(&miss);
+  }

   // Extra capacity case: Check if there is extra capacity to
   // perform the store and update the length. Used for adding one
@@ -867,6 +885,9 @@
&slow, kDontCheckMap, kIncrementLength, value, key, receiver, receiver_map, elements_map,
                                   elements);
+
+  __ bind(&miss);
+  GenerateMiss(masm);
 }


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to