OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 4433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4444 i::Handle<i::String> obj = Utils::OpenHandle(this); | 4444 i::Handle<i::String> obj = Utils::OpenHandle(this); |
4445 i::Isolate* isolate = obj->GetIsolate(); | 4445 i::Isolate* isolate = obj->GetIsolate(); |
4446 if (IsDeadCheck(isolate, "v8::String::MakeExternal()")) return false; | 4446 if (IsDeadCheck(isolate, "v8::String::MakeExternal()")) return false; |
4447 if (i::StringShape(*obj).IsExternalTwoByte()) { | 4447 if (i::StringShape(*obj).IsExternalTwoByte()) { |
4448 return false; // Already an external string. | 4448 return false; // Already an external string. |
4449 } | 4449 } |
4450 ENTER_V8(isolate); | 4450 ENTER_V8(isolate); |
4451 if (isolate->string_tracker()->IsFreshUnusedString(obj)) { | 4451 if (isolate->string_tracker()->IsFreshUnusedString(obj)) { |
4452 return false; | 4452 return false; |
4453 } | 4453 } |
4454 if (isolate->heap()->IsStringLocked(*obj)) { | |
4455 return false; | |
4456 } | |
4457 if (isolate->heap()->IsInGCPostProcessing()) { | 4454 if (isolate->heap()->IsInGCPostProcessing()) { |
4458 return false; | 4455 return false; |
4459 } | 4456 } |
4460 bool result = obj->MakeExternal(resource); | 4457 bool result = obj->MakeExternal(resource); |
4461 if (result && !obj->IsSymbol()) { | 4458 if (result && !obj->IsSymbol()) { |
4462 isolate->heap()->external_string_table()->AddString(*obj); | 4459 isolate->heap()->external_string_table()->AddString(*obj); |
4463 } | 4460 } |
4464 return result; | 4461 return result; |
4465 } | 4462 } |
4466 | 4463 |
(...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6065 | 6062 |
6066 | 6063 |
6067 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 6064 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
6068 HandleScopeImplementer* scope_implementer = | 6065 HandleScopeImplementer* scope_implementer = |
6069 reinterpret_cast<HandleScopeImplementer*>(storage); | 6066 reinterpret_cast<HandleScopeImplementer*>(storage); |
6070 scope_implementer->IterateThis(v); | 6067 scope_implementer->IterateThis(v); |
6071 return storage + ArchiveSpacePerThread(); | 6068 return storage + ArchiveSpacePerThread(); |
6072 } | 6069 } |
6073 | 6070 |
6074 } } // namespace v8::internal | 6071 } } // namespace v8::internal |
OLD | NEW |