Reviewers: danno,

Message:
PTAL

Description:
Remove unnecessary explicity prototype check.

The prototype is implicitly checked through a map check of the holder.
This is either checked in CheckPrototypes, or as part of the IC.


Please review this at https://chromiumcodereview.appspot.com/13529017/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/arm/stub-cache-arm.cc
  M src/ia32/stub-cache-ia32.cc
  M src/mips/stub-cache-mips.cc
  M src/x64/stub-cache-x64.cc


Index: src/arm/stub-cache-arm.cc
diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc
index f2d45e190af4679ee81638192e871e8e230b4d78..676fa0f5ea743889644c2fd26411fb4e354989ec 100644
--- a/src/arm/stub-cache-arm.cc
+++ b/src/arm/stub-cache-arm.cc
@@ -1225,7 +1225,7 @@ void BaseLoadStubCompiler::NonexistentHandlerFrontend(
     Handle<GlobalObject> global) {
   Label miss;

- Register reg = HandlerFrontendHeader(object, receiver(), last, name, &miss);
+  HandlerFrontendHeader(object, receiver(), last, name, &miss);

   // If the last object in the prototype chain is a global object,
   // check that the global property cell is empty.
@@ -1233,13 +1233,6 @@ void BaseLoadStubCompiler::NonexistentHandlerFrontend(
     GenerateCheckPropertyCell(masm(), global, name, scratch2(), &miss);
   }

-  if (!last->HasFastProperties()) {
-    __ ldr(scratch2(), FieldMemOperand(reg, HeapObject::kMapOffset));
-    __ ldr(scratch2(), FieldMemOperand(scratch2(), Map::kPrototypeOffset));
-    __ cmp(scratch2(), Operand(isolate()->factory()->null_value()));
-    __ b(ne, &miss);
-  }
-
   HandlerFrontendFooter(success, &miss);
 }

Index: src/ia32/stub-cache-ia32.cc
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc
index fbe33510c16967df7c703be55d57dd3b2d1d192d..fcc06fada7fa2886125a5db80bdb1d1d5cfee12a 100644
--- a/src/ia32/stub-cache-ia32.cc
+++ b/src/ia32/stub-cache-ia32.cc
@@ -1113,7 +1113,7 @@ void BaseLoadStubCompiler::NonexistentHandlerFrontend(
     Handle<GlobalObject> global) {
   Label miss;

- Register reg = HandlerFrontendHeader(object, receiver(), last, name, &miss);
+  HandlerFrontendHeader(object, receiver(), last, name, &miss);

   // If the last object in the prototype chain is a global object,
   // check that the global property cell is empty.
@@ -1121,13 +1121,6 @@ void BaseLoadStubCompiler::NonexistentHandlerFrontend(
     GenerateCheckPropertyCell(masm(), global, name, scratch2(), &miss);
   }

-  if (!last->HasFastProperties()) {
-    __ mov(scratch2(), FieldOperand(reg, HeapObject::kMapOffset));
-    __ mov(scratch2(), FieldOperand(scratch2(), Map::kPrototypeOffset));
-    __ cmp(scratch2(), isolate()->factory()->null_value());
-    __ j(not_equal, &miss);
-  }
-
   HandlerFrontendFooter(success, &miss);
 }

Index: src/mips/stub-cache-mips.cc
diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc
index da6770a14ce05e5095558c4110b61a1c5f92a529..b6bf924b6600877d6170ee271365bea259b22ff2 100644
--- a/src/mips/stub-cache-mips.cc
+++ b/src/mips/stub-cache-mips.cc
@@ -1229,7 +1229,7 @@ void BaseLoadStubCompiler::NonexistentHandlerFrontend(
     Handle<GlobalObject> global) {
   Label miss;

- Register reg = HandlerFrontendHeader(object, receiver(), last, name, &miss);
+  HandlerFrontendHeader(object, receiver(), last, name, &miss);

   // If the last object in the prototype chain is a global object,
   // check that the global property cell is empty.
@@ -1237,13 +1237,6 @@ void BaseLoadStubCompiler::NonexistentHandlerFrontend(
     GenerateCheckPropertyCell(masm(), global, name, scratch2(), &miss);
   }

-  if (!last->HasFastProperties()) {
-    __ lw(scratch2(), FieldMemOperand(reg, HeapObject::kMapOffset));
-    __ lw(scratch2(), FieldMemOperand(scratch2(), Map::kPrototypeOffset));
-    __ Branch(&miss, ne, scratch2(),
-        Operand(isolate()->factory()->null_value()));
-  }
-
   HandlerFrontendFooter(success, &miss);
 }

Index: src/x64/stub-cache-x64.cc
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc
index 7e900dbe6866f229983dc3157f39c0dee06933af..c16da0cdb62826757c20d43ded1ebafd3159a7b1 100644
--- a/src/x64/stub-cache-x64.cc
+++ b/src/x64/stub-cache-x64.cc
@@ -1077,7 +1077,7 @@ void BaseLoadStubCompiler::NonexistentHandlerFrontend(
     Handle<GlobalObject> global) {
   Label miss;

- Register reg = HandlerFrontendHeader(object, receiver(), last, name, &miss);
+  HandlerFrontendHeader(object, receiver(), last, name, &miss);

   // If the last object in the prototype chain is a global object,
   // check that the global property cell is empty.
@@ -1085,13 +1085,6 @@ void BaseLoadStubCompiler::NonexistentHandlerFrontend(
     GenerateCheckPropertyCell(masm(), global, name, scratch2(), &miss);
   }

-  if (!last->HasFastProperties()) {
-    __ movq(scratch2(), FieldOperand(reg, HeapObject::kMapOffset));
-    __ movq(scratch2(), FieldOperand(scratch2(), Map::kPrototypeOffset));
-    __ Cmp(scratch2(), isolate()->factory()->null_value());
-    __ j(not_equal, &miss);
-  }
-
   HandlerFrontendFooter(success, &miss);
 }



--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to