Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: test/mjsunit/regress/regress-2980.js

Issue 66723020: Merged r17459, r17462, r17474 into 3.21 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.21
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/stub-cache-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-2980.js
diff --git a/test/cctest/test-cpu.cc b/test/mjsunit/regress/regress-2980.js
similarity index 68%
copy from test/cctest/test-cpu.cc
copy to test/mjsunit/regress/regress-2980.js
index 06966c68c86296e510edb8899f4d7deb0343f108..071a73353a79aec11091cc97c117710d2fb36414 100644
--- a/test/cctest/test-cpu.cc
+++ b/test/mjsunit/regress/regress-2980.js
@@ -25,31 +25,40 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "v8.h"
-
-#include "cctest.h"
-#include "cpu.h"
-
-using namespace v8::internal;
+function test(expected, holder) {
+ assertEquals(expected, holder.property);
+}
-TEST(FeatureImplications) {
- // Test for features implied by other features.
- CPU cpu;
+var holder = {}
+holder.__proto__ = null;
+holder.property = "foo";
+delete holder.property;
+test(undefined, holder);
+test(undefined, holder);
+test(undefined, holder);
+holder.property = "bar";
+test("bar", holder);
+test("bar", holder);
- // ia32 and x64 features
- CHECK(!cpu.has_sse() || cpu.has_mmx());
- CHECK(!cpu.has_sse2() || cpu.has_sse());
- CHECK(!cpu.has_sse3() || cpu.has_sse2());
- CHECK(!cpu.has_ssse3() || cpu.has_sse3());
- CHECK(!cpu.has_sse41() || cpu.has_sse3());
- CHECK(!cpu.has_sse42() || cpu.has_sse41());
+// Now the same thing with a nontrivial prototype chain.
- // arm features
- CHECK(!cpu.has_vfp3_d32() || cpu.has_vfp3());
+function test2(expected, holder) {
+ assertEquals(expected, holder.prop2);
}
+var holder2 = {}
+holder2.prop2 = "foo";
+holder2.__proto__ = null;
+function Receiver() {}
+Receiver.prototype = holder2;
-TEST(NumberOfProcessorsOnline) {
- CHECK_GT(CPU::NumberOfProcessorsOnline(), 0);
-}
+var rec2 = new Receiver();
+delete holder2.prop2;
+
+test2(undefined, rec2);
+test2(undefined, rec2);
+test2(undefined, rec2);
+holder2.prop2 = "bar";
+test2("bar", rec2);
+test2("bar", rec2);
« no previous file with comments | « src/x64/stub-cache-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698