Reviewers: Søren Gjesse,

Message:
Søren,

fix a stupid check: ASSERTs should have checked that it's safe to omit
CheckPrototypes if we try not to do it.

May you have a look?

Description:
Move assertions to not take case to check that it's safe to omit CheckPrototypes
in this case.

Please review this at http://codereview.chromium.org/2279005/show

Affected files:
  M src/arm/stub-cache-arm.cc
  M src/ia32/stub-cache-ia32.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 98052231a58e5acd2b90bc206d795f2d6faea91a..979a00f0d396ad88cfddce264e320a78b5089fea 100644
--- a/src/arm/stub-cache-arm.cc
+++ b/src/arm/stub-cache-arm.cc
@@ -789,11 +789,12 @@ class CallInterceptorCompiler BASE_EMBEDDED {
       stub_compiler_->CheckPrototypes(interceptor_holder, receiver,
                                       lookup->holder(), scratch1,
                                       scratch2, name, depth2, miss);
+    } else {
       // CheckPrototypes has a side effect of fetching a 'holder'
       // for API (object which is instanceof for the signature).  It's
       // safe to omit it here, as if present, it should be fetched
       // by the previous CheckPrototypes.
- ASSERT((depth2 == kInvalidProtoDepth) || (depth1 != kInvalidProtoDepth));
+      ASSERT(depth2 == kInvalidProtoDepth);
     }

     // Invoke function.
Index: src/ia32/stub-cache-ia32.cc
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc
index 5c783f55e8df96b889f36c0d9670cdb0d25b2474..8a50682001caac829dbf2c9325a7bcbdb3d25624 100644
--- a/src/ia32/stub-cache-ia32.cc
+++ b/src/ia32/stub-cache-ia32.cc
@@ -687,11 +687,12 @@ class CallInterceptorCompiler BASE_EMBEDDED {
       stub_compiler_->CheckPrototypes(interceptor_holder, receiver,
                                       lookup->holder(), scratch1,
                                       scratch2, name, depth2, miss);
+    } else {
       // CheckPrototypes has a side effect of fetching a 'holder'
       // for API (object which is instanceof for the signature).  It's
       // safe to omit it here, as if present, it should be fetched
       // by the previous CheckPrototypes.
- ASSERT((depth2 == kInvalidProtoDepth) || (depth1 != kInvalidProtoDepth));
+      ASSERT(depth2 == kInvalidProtoDepth);
     }

     // Invoke function.
Index: src/x64/stub-cache-x64.cc
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc
index eaa7b843d123ae7b37aa50f159896cf32d65e862..799382456732923695331eab6433100b452b1525 100644
--- a/src/x64/stub-cache-x64.cc
+++ b/src/x64/stub-cache-x64.cc
@@ -763,11 +763,12 @@ class CallInterceptorCompiler BASE_EMBEDDED {
       stub_compiler_->CheckPrototypes(interceptor_holder, receiver,
                                       lookup->holder(), scratch1,
                                       scratch2, name, depth2, miss);
+    } else {
       // CheckPrototypes has a side effect of fetching a 'holder'
       // for API (object which is instanceof for the signature).  It's
       // safe to omit it here, as if present, it should be fetched
       // by the previous CheckPrototypes.
- ASSERT((depth2 == kInvalidProtoDepth) || (depth1 != kInvalidProtoDepth));
+      ASSERT(depth2 == kInvalidProtoDepth);
     }

     // Invoke function.


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to