OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 19147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19158 USE(ring); | 19158 USE(ring); |
19159 } | 19159 } |
19160 | 19160 |
19161 isolate->Dispose(); | 19161 isolate->Dispose(); |
19162 // Ring has been destroyed. Free Peoples of Middle-earth Rejoice. | 19162 // Ring has been destroyed. Free Peoples of Middle-earth Rejoice. |
19163 CHECK_EQ(1, destroyed); | 19163 CHECK_EQ(1, destroyed); |
19164 } | 19164 } |
19165 | 19165 |
19166 | 19166 |
19167 TEST(ExternalInternalizedStringCollectedAtGC) { | 19167 TEST(ExternalInternalizedStringCollectedAtGC) { |
| 19168 // TODO(mvstanton): vector ics need weak support. |
| 19169 if (i::FLAG_vector_ics) return; |
| 19170 |
19168 int destroyed = 0; | 19171 int destroyed = 0; |
19169 { LocalContext env; | 19172 { LocalContext env; |
19170 v8::HandleScope handle_scope(env->GetIsolate()); | 19173 v8::HandleScope handle_scope(env->GetIsolate()); |
19171 CompileRun("var ring = 'One string to test them all';"); | 19174 CompileRun("var ring = 'One string to test them all';"); |
19172 const char* s = "One string to test them all"; | 19175 const char* s = "One string to test them all"; |
19173 TestOneByteResource* inscription = | 19176 TestOneByteResource* inscription = |
19174 new TestOneByteResource(i::StrDup(s), &destroyed); | 19177 new TestOneByteResource(i::StrDup(s), &destroyed); |
19175 v8::Local<v8::String> ring = CompileRun("ring").As<v8::String>(); | 19178 v8::Local<v8::String> ring = CompileRun("ring").As<v8::String>(); |
19176 CHECK(v8::Utils::OpenHandle(*ring)->IsInternalizedString()); | 19179 CHECK(v8::Utils::OpenHandle(*ring)->IsInternalizedString()); |
19177 ring->MakeExternal(inscription); | 19180 ring->MakeExternal(inscription); |
(...skipping 5442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
24620 | 24623 |
24621 v8::Handle<v8::Value> result = CompileRun("%_GetPrototype(object)"); | 24624 v8::Handle<v8::Value> result = CompileRun("%_GetPrototype(object)"); |
24622 CHECK(result->Equals(proto2)); | 24625 CHECK(result->Equals(proto2)); |
24623 | 24626 |
24624 result = CompileRun( | 24627 result = CompileRun( |
24625 "function f() { return %_GetPrototype(object); }" | 24628 "function f() { return %_GetPrototype(object); }" |
24626 "%OptimizeFunctionOnNextCall(f);" | 24629 "%OptimizeFunctionOnNextCall(f);" |
24627 "f()"); | 24630 "f()"); |
24628 CHECK(result->Equals(proto2)); | 24631 CHECK(result->Equals(proto2)); |
24629 } | 24632 } |
OLD | NEW |