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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 expected_ptr = reinterpret_cast<void*>(1); | 867 expected_ptr = reinterpret_cast<void*>(1); |
868 TestExternalPointerWrapping(); | 868 TestExternalPointerWrapping(); |
869 | 869 |
870 expected_ptr = reinterpret_cast<void*>(0xdeadbeef); | 870 expected_ptr = reinterpret_cast<void*>(0xdeadbeef); |
871 TestExternalPointerWrapping(); | 871 TestExternalPointerWrapping(); |
872 | 872 |
873 expected_ptr = reinterpret_cast<void*>(0xdeadbeef + 1); | 873 expected_ptr = reinterpret_cast<void*>(0xdeadbeef + 1); |
874 TestExternalPointerWrapping(); | 874 TestExternalPointerWrapping(); |
875 | 875 |
876 #if defined(V8_HOST_ARCH_X64) | 876 #if defined(V8_HOST_ARCH_X64) |
| 877 // Check a value with a leading 1 bit in x64 Smi encoding. |
| 878 expected_ptr = reinterpret_cast<void*>(0x400000000); |
| 879 TestExternalPointerWrapping(); |
| 880 |
877 expected_ptr = reinterpret_cast<void*>(0xdeadbeefdeadbeef); | 881 expected_ptr = reinterpret_cast<void*>(0xdeadbeefdeadbeef); |
878 TestExternalPointerWrapping(); | 882 TestExternalPointerWrapping(); |
879 | 883 |
880 expected_ptr = reinterpret_cast<void*>(0xdeadbeefdeadbeef + 1); | 884 expected_ptr = reinterpret_cast<void*>(0xdeadbeefdeadbeef + 1); |
881 TestExternalPointerWrapping(); | 885 TestExternalPointerWrapping(); |
882 #endif | 886 #endif |
883 } | 887 } |
884 | 888 |
885 | 889 |
886 THREADED_TEST(FindInstanceInPrototypeChain) { | 890 THREADED_TEST(FindInstanceInPrototypeChain) { |
(...skipping 11279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12166 v8::Context::Scope context_scope(context.local()); | 12170 v8::Context::Scope context_scope(context.local()); |
12167 | 12171 |
12168 v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New(); | 12172 v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New(); |
12169 tmpl->SetNamedPropertyHandler(Getter, NULL, NULL, NULL, Enumerator); | 12173 tmpl->SetNamedPropertyHandler(Getter, NULL, NULL, NULL, Enumerator); |
12170 context->Global()->Set(v8_str("o"), tmpl->NewInstance()); | 12174 context->Global()->Set(v8_str("o"), tmpl->NewInstance()); |
12171 v8::Handle<v8::Array> result = v8::Handle<v8::Array>::Cast(CompileRun( | 12175 v8::Handle<v8::Array> result = v8::Handle<v8::Array>::Cast(CompileRun( |
12172 "var result = []; for (var k in o) result.push(k); result")); | 12176 "var result = []; for (var k in o) result.push(k); result")); |
12173 CHECK_EQ(1, result->Length()); | 12177 CHECK_EQ(1, result->Length()); |
12174 CHECK_EQ(v8_str("universalAnswer"), result->Get(0)); | 12178 CHECK_EQ(v8_str("universalAnswer"), result->Get(0)); |
12175 } | 12179 } |
OLD | NEW |