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

Side by Side Diff: src/api.cc

Issue 9724022: Add API call that identifies strings that are guaranteed (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 9 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
OLDNEW
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 3676 matching lines...) Expand 10 before | Expand all | Expand 10 after
3687 } 3687 }
3688 3688
3689 3689
3690 int String::Utf8Length() const { 3690 int String::Utf8Length() const {
3691 i::Handle<i::String> str = Utils::OpenHandle(this); 3691 i::Handle<i::String> str = Utils::OpenHandle(this);
3692 if (IsDeadCheck(str->GetIsolate(), "v8::String::Utf8Length()")) return 0; 3692 if (IsDeadCheck(str->GetIsolate(), "v8::String::Utf8Length()")) return 0;
3693 return i::Utf8Length(str); 3693 return i::Utf8Length(str);
3694 } 3694 }
3695 3695
3696 3696
3697 bool String::MayContainNonAscii() const {
3698 i::Handle<i::String> str = Utils::OpenHandle(this);
3699 if (IsDeadCheck(str->GetIsolate(), "v8::String::MayContainNonAscii()")) {
3700 return 0;
fschneider 2012/03/19 08:46:31 you mean "return false"?
Erik Corry 2012/03/19 09:51:02 Done.
3701 }
3702 return !str->HasOnlyAsciiChars();
3703 }
3704
3705
3697 int String::WriteUtf8(char* buffer, 3706 int String::WriteUtf8(char* buffer,
3698 int capacity, 3707 int capacity,
3699 int* nchars_ref, 3708 int* nchars_ref,
3700 int options) const { 3709 int options) const {
3701 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); 3710 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3702 if (IsDeadCheck(isolate, "v8::String::WriteUtf8()")) return 0; 3711 if (IsDeadCheck(isolate, "v8::String::WriteUtf8()")) return 0;
3703 LOG_API(isolate, "String::WriteUtf8"); 3712 LOG_API(isolate, "String::WriteUtf8");
3704 ENTER_V8(isolate); 3713 ENTER_V8(isolate);
3705 i::Handle<i::String> str = Utils::OpenHandle(this); 3714 i::Handle<i::String> str = Utils::OpenHandle(this);
3706 if (str->IsAsciiRepresentation()) { 3715 if (str->IsAsciiRepresentation()) {
(...skipping 2515 matching lines...) Expand 10 before | Expand all | Expand 10 after
6222 6231
6223 6232
6224 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 6233 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
6225 HandleScopeImplementer* scope_implementer = 6234 HandleScopeImplementer* scope_implementer =
6226 reinterpret_cast<HandleScopeImplementer*>(storage); 6235 reinterpret_cast<HandleScopeImplementer*>(storage);
6227 scope_implementer->IterateThis(v); 6236 scope_implementer->IterateThis(v);
6228 return storage + ArchiveSpacePerThread(); 6237 return storage + ArchiveSpacePerThread();
6229 } 6238 }
6230 6239
6231 } } // namespace v8::internal 6240 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698