OLD | NEW |
1 // Copyright 2007-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2010 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 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1979 args.GetReturnValue().Set(v8_num(12)); | 1979 args.GetReturnValue().Set(v8_num(12)); |
1980 } | 1980 } |
1981 }; | 1981 }; |
1982 | 1982 |
1983 intptr_t original_external_references[] = { | 1983 intptr_t original_external_references[] = { |
1984 reinterpret_cast<intptr_t>(SerializedCallback), | 1984 reinterpret_cast<intptr_t>(SerializedCallback), |
1985 reinterpret_cast<intptr_t>(&serialized_static_field), | 1985 reinterpret_cast<intptr_t>(&serialized_static_field), |
1986 reinterpret_cast<intptr_t>(&NamedPropertyGetterForSerialization), | 1986 reinterpret_cast<intptr_t>(&NamedPropertyGetterForSerialization), |
1987 reinterpret_cast<intptr_t>(&AccessorForSerialization), | 1987 reinterpret_cast<intptr_t>(&AccessorForSerialization), |
1988 reinterpret_cast<intptr_t>(&SerializedExtension::FunctionCallback), | 1988 reinterpret_cast<intptr_t>(&SerializedExtension::FunctionCallback), |
| 1989 reinterpret_cast<intptr_t>(&serialized_static_field), // duplicate entry |
1989 0}; | 1990 0}; |
1990 | 1991 |
1991 intptr_t replaced_external_references[] = { | 1992 intptr_t replaced_external_references[] = { |
1992 reinterpret_cast<intptr_t>(SerializedCallbackReplacement), | 1993 reinterpret_cast<intptr_t>(SerializedCallbackReplacement), |
1993 reinterpret_cast<intptr_t>(&serialized_static_field), | 1994 reinterpret_cast<intptr_t>(&serialized_static_field), |
1994 reinterpret_cast<intptr_t>(&NamedPropertyGetterForSerialization), | 1995 reinterpret_cast<intptr_t>(&NamedPropertyGetterForSerialization), |
1995 reinterpret_cast<intptr_t>(&AccessorForSerialization), | 1996 reinterpret_cast<intptr_t>(&AccessorForSerialization), |
1996 reinterpret_cast<intptr_t>(&SerializedExtension::FunctionCallback), | 1997 reinterpret_cast<intptr_t>(&SerializedExtension::FunctionCallback), |
| 1998 reinterpret_cast<intptr_t>(&serialized_static_field), |
1997 0}; | 1999 0}; |
1998 | 2000 |
1999 TEST(SnapshotCreatorExternalReferences) { | 2001 TEST(SnapshotCreatorExternalReferences) { |
2000 DisableAlwaysOpt(); | 2002 DisableAlwaysOpt(); |
2001 v8::StartupData blob; | 2003 v8::StartupData blob; |
2002 { | 2004 { |
2003 v8::SnapshotCreator creator(original_external_references); | 2005 v8::SnapshotCreator creator(original_external_references); |
2004 v8::Isolate* isolate = creator.GetIsolate(); | 2006 v8::Isolate* isolate = creator.GetIsolate(); |
2005 { | 2007 { |
2006 v8::HandleScope handle_scope(isolate); | 2008 v8::HandleScope handle_scope(isolate); |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2455 } | 2457 } |
2456 delete[] blob.data; | 2458 delete[] blob.data; |
2457 } | 2459 } |
2458 | 2460 |
2459 TEST(SerializationMemoryStats) { | 2461 TEST(SerializationMemoryStats) { |
2460 FLAG_profile_deserialization = true; | 2462 FLAG_profile_deserialization = true; |
2461 FLAG_always_opt = false; | 2463 FLAG_always_opt = false; |
2462 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); | 2464 v8::StartupData blob = v8::V8::CreateSnapshotDataBlob(); |
2463 delete[] blob.data; | 2465 delete[] blob.data; |
2464 } | 2466 } |
OLD | NEW |