| OLD | NEW |
| 1 // Copyright 2007-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 expected_ptr = reinterpret_cast<void*>(1); | 866 expected_ptr = reinterpret_cast<void*>(1); |
| 867 TestExternalPointerWrapping(); | 867 TestExternalPointerWrapping(); |
| 868 | 868 |
| 869 expected_ptr = reinterpret_cast<void*>(0xdeadbeef); | 869 expected_ptr = reinterpret_cast<void*>(0xdeadbeef); |
| 870 TestExternalPointerWrapping(); | 870 TestExternalPointerWrapping(); |
| 871 | 871 |
| 872 expected_ptr = reinterpret_cast<void*>(0xdeadbeef + 1); | 872 expected_ptr = reinterpret_cast<void*>(0xdeadbeef + 1); |
| 873 TestExternalPointerWrapping(); | 873 TestExternalPointerWrapping(); |
| 874 | 874 |
| 875 #if defined(V8_HOST_ARCH_X64) | 875 #if defined(V8_HOST_ARCH_X64) |
| 876 // Check a value with a leading 1 bit in x64 Smi encoding. |
| 877 expected_ptr = reinterpret_cast<void*>(0x400000000); |
| 878 TestExternalPointerWrapping(); |
| 879 |
| 876 expected_ptr = reinterpret_cast<void*>(0xdeadbeefdeadbeef); | 880 expected_ptr = reinterpret_cast<void*>(0xdeadbeefdeadbeef); |
| 877 TestExternalPointerWrapping(); | 881 TestExternalPointerWrapping(); |
| 878 | 882 |
| 879 expected_ptr = reinterpret_cast<void*>(0xdeadbeefdeadbeef + 1); | 883 expected_ptr = reinterpret_cast<void*>(0xdeadbeefdeadbeef + 1); |
| 880 TestExternalPointerWrapping(); | 884 TestExternalPointerWrapping(); |
| 881 #endif | 885 #endif |
| 882 } | 886 } |
| 883 | 887 |
| 884 | 888 |
| 885 THREADED_TEST(FindInstanceInPrototypeChain) { | 889 THREADED_TEST(FindInstanceInPrototypeChain) { |
| (...skipping 10931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11817 v8::Context::Scope context_scope(context.local()); | 11821 v8::Context::Scope context_scope(context.local()); |
| 11818 | 11822 |
| 11819 v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New(); | 11823 v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New(); |
| 11820 tmpl->SetNamedPropertyHandler(Getter, NULL, NULL, NULL, Enumerator); | 11824 tmpl->SetNamedPropertyHandler(Getter, NULL, NULL, NULL, Enumerator); |
| 11821 context->Global()->Set(v8_str("o"), tmpl->NewInstance()); | 11825 context->Global()->Set(v8_str("o"), tmpl->NewInstance()); |
| 11822 v8::Handle<v8::Array> result = v8::Handle<v8::Array>::Cast(CompileRun( | 11826 v8::Handle<v8::Array> result = v8::Handle<v8::Array>::Cast(CompileRun( |
| 11823 "var result = []; for (var k in o) result.push(k); result")); | 11827 "var result = []; for (var k in o) result.push(k); result")); |
| 11824 CHECK_EQ(1, result->Length()); | 11828 CHECK_EQ(1, result->Length()); |
| 11825 CHECK_EQ(v8_str("universalAnswer"), result->Get(0)); | 11829 CHECK_EQ(v8_str("universalAnswer"), result->Get(0)); |
| 11826 } | 11830 } |
| OLD | NEW |