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

Side by Side Diff: src/api.cc

Issue 271085: - Add String::Concat(Handle<String> left, Handle<String> right) to the V8 API... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 | « include/v8.h ('k') | test/cctest/test-api.cc » ('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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 2896 matching lines...) Expand 10 before | Expand all | Expand 10 after
2907 LOG_API("String::New(char)"); 2907 LOG_API("String::New(char)");
2908 if (length == 0) return Empty(); 2908 if (length == 0) return Empty();
2909 ENTER_V8; 2909 ENTER_V8;
2910 if (length == -1) length = strlen(data); 2910 if (length == -1) length = strlen(data);
2911 i::Handle<i::String> result = 2911 i::Handle<i::String> result =
2912 i::Factory::NewStringFromUtf8(i::Vector<const char>(data, length)); 2912 i::Factory::NewStringFromUtf8(i::Vector<const char>(data, length));
2913 return Utils::ToLocal(result); 2913 return Utils::ToLocal(result);
2914 } 2914 }
2915 2915
2916 2916
2917 Local<String> v8::String::Concat(Handle<String> left, Handle<String> right) {
2918 EnsureInitialized("v8::String::New()");
2919 LOG_API("String::New(char)");
2920 ENTER_V8;
2921 i::Handle<i::String> left_string = Utils::OpenHandle(*left);
2922 i::Handle<i::String> right_string = Utils::OpenHandle(*right);
2923 i::Handle<i::String> result = i::Factory::NewConsString(left_string,
2924 right_string);
2925 return Utils::ToLocal(result);
2926 }
2927
2928
2917 Local<String> v8::String::NewUndetectable(const char* data, int length) { 2929 Local<String> v8::String::NewUndetectable(const char* data, int length) {
2918 EnsureInitialized("v8::String::NewUndetectable()"); 2930 EnsureInitialized("v8::String::NewUndetectable()");
2919 LOG_API("String::NewUndetectable(char)"); 2931 LOG_API("String::NewUndetectable(char)");
2920 ENTER_V8; 2932 ENTER_V8;
2921 if (length == -1) length = strlen(data); 2933 if (length == -1) length = strlen(data);
2922 i::Handle<i::String> result = 2934 i::Handle<i::String> result =
2923 i::Factory::NewStringFromUtf8(i::Vector<const char>(data, length)); 2935 i::Factory::NewStringFromUtf8(i::Vector<const char>(data, length));
2924 result->MarkAsUndetectable(); 2936 result->MarkAsUndetectable();
2925 return Utils::ToLocal(result); 2937 return Utils::ToLocal(result);
2926 } 2938 }
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
3768 3780
3769 3781
3770 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 3782 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
3771 HandleScopeImplementer* thread_local = 3783 HandleScopeImplementer* thread_local =
3772 reinterpret_cast<HandleScopeImplementer*>(storage); 3784 reinterpret_cast<HandleScopeImplementer*>(storage);
3773 thread_local->IterateThis(v); 3785 thread_local->IterateThis(v);
3774 return storage + ArchiveSpacePerThread(); 3786 return storage + ArchiveSpacePerThread();
3775 } 3787 }
3776 3788
3777 } } // namespace v8::internal 3789 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698