MIPS: Support slow-mode prototypes for load and call ICs.
authorverwaest@chromium.org <verwaest@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 1 Feb 2013 10:35:21 +0000 (10:35 +0000)
committerverwaest@chromium.org <verwaest@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 1 Feb 2013 10:35:21 +0000 (10:35 +0000)
Port r13571 (c37a2f5).

Original commit message:
Support slow-mode prototypes for load and call ICs.

This changes LoadNonExistent to handle negative lookups as well.

BUG=

Review URL: https://chromiumcodereview.appspot.com/12089098
Patch from Paul Lind <plind44@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13576 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/mips/stub-cache-mips.cc

index 0be9e03..2981e40 100644 (file)
@@ -2893,9 +2893,11 @@ Handle<Code> StoreStubCompiler::CompileStoreGlobal(
 }
 
 
-Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<String> name,
-                                                      Handle<JSObject> object,
-                                                      Handle<JSObject> last) {
+Handle<Code> LoadStubCompiler::CompileLoadNonexistent(
+    Handle<String> name,
+    Handle<JSObject> object,
+    Handle<JSObject> last,
+    Handle<GlobalObject> global) {
   // ----------- S t a t e -------------
   //  -- a0    : receiver
   //  -- ra    : return address
@@ -2905,14 +2907,22 @@ Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<String> name,
   // Check that the receiver is not a smi.
   __ JumpIfSmi(a0, &miss);
 
+  Register scratch = a1;
+
   // Check the maps of the full prototype chain.
-  CheckPrototypes(object, a0, last, a3, a1, t0, name, &miss);
+  Register result =
+      CheckPrototypes(object, a0, last, a3, scratch, t0, name, &miss);
 
   // If the last object in the prototype chain is a global object,
   // check that the global property cell is empty.
-  if (last->IsGlobalObject()) {
-    GenerateCheckPropertyCell(
-        masm(), Handle<GlobalObject>::cast(last), name, a1, &miss);
+  if (!global.is_null()) {
+    GenerateCheckPropertyCell(masm(), global, name, scratch, &miss);
+  }
+
+  if (!last->HasFastProperties()) {
+    __ lw(scratch, FieldMemOperand(result, HeapObject::kMapOffset));
+    __ lw(scratch, FieldMemOperand(scratch, Map::kPrototypeOffset));
+    __ Branch(&miss, ne, scratch, Operand(isolate()->factory()->null_value()));
   }
 
   // Return undefined if maps of the full prototype chain is still the same.