| 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 17976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17987 env->GetIsolate(), string, v8::String::kInternalizedString); | 17987 env->GetIsolate(), string, v8::String::kInternalizedString); |
| 17988 CHECK(string2->MakeExternal(resource[2])); | 17988 CHECK(string2->MakeExternal(resource[2])); |
| 17989 | 17989 |
| 17990 // Symbolized External. | 17990 // Symbolized External. |
| 17991 resource[3] = new TestResource(AsciiToTwoByteString("Some other string")); | 17991 resource[3] = new TestResource(AsciiToTwoByteString("Some other string")); |
| 17992 v8::Local<v8::String> string3 = | 17992 v8::Local<v8::String> string3 = |
| 17993 v8::String::NewExternal(env->GetIsolate(), resource[3]); | 17993 v8::String::NewExternal(env->GetIsolate(), resource[3]); |
| 17994 CcTest::heap()->CollectAllAvailableGarbage(); // Tenure string. | 17994 CcTest::heap()->CollectAllAvailableGarbage(); // Tenure string. |
| 17995 // Turn into a symbol. | 17995 // Turn into a symbol. |
| 17996 i::Handle<i::String> string3_i = v8::Utils::OpenHandle(*string3); | 17996 i::Handle<i::String> string3_i = v8::Utils::OpenHandle(*string3); |
| 17997 CHECK(!CcTest::heap()->InternalizeString(*string3_i)->IsFailure()); | 17997 CHECK(!CcTest::test_heap()->InternalizeString(*string3_i)->IsFailure()); |
| 17998 CHECK(string3_i->IsInternalizedString()); | 17998 CHECK(string3_i->IsInternalizedString()); |
| 17999 | 17999 |
| 18000 // We need to add usages for string* to avoid warnings in GCC 4.7 | 18000 // We need to add usages for string* to avoid warnings in GCC 4.7 |
| 18001 CHECK(string0->IsExternal()); | 18001 CHECK(string0->IsExternal()); |
| 18002 CHECK(string1->IsExternal()); | 18002 CHECK(string1->IsExternal()); |
| 18003 CHECK(string2->IsExternal()); | 18003 CHECK(string2->IsExternal()); |
| 18004 CHECK(string3->IsExternal()); | 18004 CHECK(string3->IsExternal()); |
| 18005 | 18005 |
| 18006 VisitorImpl visitor(resource); | 18006 VisitorImpl visitor(resource); |
| 18007 v8::V8::VisitExternalResources(&visitor); | 18007 v8::V8::VisitExternalResources(&visitor); |
| (...skipping 4484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22492 v8::internal::FLAG_stack_size = 150; | 22492 v8::internal::FLAG_stack_size = 150; |
| 22493 LocalContext current; | 22493 LocalContext current; |
| 22494 v8::Isolate* isolate = current->GetIsolate(); | 22494 v8::Isolate* isolate = current->GetIsolate(); |
| 22495 v8::HandleScope scope(isolate); | 22495 v8::HandleScope scope(isolate); |
| 22496 V8::SetCaptureStackTraceForUncaughtExceptions( | 22496 V8::SetCaptureStackTraceForUncaughtExceptions( |
| 22497 true, 10, v8::StackTrace::kDetailed); | 22497 true, 10, v8::StackTrace::kDetailed); |
| 22498 v8::TryCatch try_catch; | 22498 v8::TryCatch try_catch; |
| 22499 CompileRun("(function f(x) { f(x+1); })(0)"); | 22499 CompileRun("(function f(x) { f(x+1); })(0)"); |
| 22500 CHECK(try_catch.HasCaught()); | 22500 CHECK(try_catch.HasCaught()); |
| 22501 } | 22501 } |
| OLD | NEW |