Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: src/api.cc

Issue 7977001: Added ability to lock strings to prevent their representation or encoding from changing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix bug in test when running threaded. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/handles.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4461 matching lines...) Expand 10 before | Expand all | Expand 10 after
4472 i::Handle<i::String> obj = Utils::OpenHandle(this); 4472 i::Handle<i::String> obj = Utils::OpenHandle(this);
4473 i::Isolate* isolate = obj->GetIsolate(); 4473 i::Isolate* isolate = obj->GetIsolate();
4474 if (IsDeadCheck(isolate, "v8::String::MakeExternal()")) return false; 4474 if (IsDeadCheck(isolate, "v8::String::MakeExternal()")) return false;
4475 if (i::StringShape(*obj).IsExternalTwoByte()) { 4475 if (i::StringShape(*obj).IsExternalTwoByte()) {
4476 return false; // Already an external string. 4476 return false; // Already an external string.
4477 } 4477 }
4478 ENTER_V8(isolate); 4478 ENTER_V8(isolate);
4479 if (isolate->string_tracker()->IsFreshUnusedString(obj)) { 4479 if (isolate->string_tracker()->IsFreshUnusedString(obj)) {
4480 return false; 4480 return false;
4481 } 4481 }
4482 if (isolate->heap()->IsStringLocked(*obj)) {
4483 return false;
4484 }
4482 if (isolate->heap()->IsInGCPostProcessing()) { 4485 if (isolate->heap()->IsInGCPostProcessing()) {
4483 return false; 4486 return false;
4484 } 4487 }
4485 bool result = obj->MakeExternal(resource); 4488 bool result = obj->MakeExternal(resource);
4486 if (result && !obj->IsSymbol()) { 4489 if (result && !obj->IsSymbol()) {
4487 isolate->heap()->external_string_table()->AddString(*obj); 4490 isolate->heap()->external_string_table()->AddString(*obj);
4488 } 4491 }
4489 return result; 4492 return result;
4490 } 4493 }
4491 4494
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after
6080 6083
6081 6084
6082 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 6085 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
6083 HandleScopeImplementer* scope_implementer = 6086 HandleScopeImplementer* scope_implementer =
6084 reinterpret_cast<HandleScopeImplementer*>(storage); 6087 reinterpret_cast<HandleScopeImplementer*>(storage);
6085 scope_implementer->IterateThis(v); 6088 scope_implementer->IterateThis(v);
6086 return storage + ArchiveSpacePerThread(); 6089 return storage + ArchiveSpacePerThread();
6087 } 6090 }
6088 6091
6089 } } // namespace v8::internal 6092 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698