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

Side by Side Diff: src/factory.cc

Issue 200363002: Handlify callers of Object::GetElement. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 6 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
« no previous file with comments | « src/builtins.cc ('k') | src/isolate.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 Vector<char> v(buffer, kBufferSize); 1109 Vector<char> v(buffer, kBufferSize);
1110 OS::StrNCpy(v, message, space); 1110 OS::StrNCpy(v, message, space);
1111 space -= Min(space, strlen(message)); 1111 space -= Min(space, strlen(message));
1112 p = &buffer[kBufferSize] - space; 1112 p = &buffer[kBufferSize] - space;
1113 1113
1114 for (unsigned i = 0; i < ARRAY_SIZE(args); i++) { 1114 for (unsigned i = 0; i < ARRAY_SIZE(args); i++) {
1115 if (space > 0) { 1115 if (space > 0) {
1116 *p++ = ' '; 1116 *p++ = ' ';
1117 space--; 1117 space--;
1118 if (space > 0) { 1118 if (space > 0) {
1119 MaybeObject* maybe_arg = args->GetElement(isolate(), i); 1119 Handle<String> arg_str = Handle<String>::cast(
1120 Handle<String> arg_str(reinterpret_cast<String*>(maybe_arg)); 1120 Object::GetElement(isolate(), args, i));
1121 CHECK_NOT_EMPTY_HANDLE(isolate(), arg_str);
1121 SmartArrayPointer<char> arg = arg_str->ToCString(); 1122 SmartArrayPointer<char> arg = arg_str->ToCString();
1122 Vector<char> v2(p, static_cast<int>(space)); 1123 Vector<char> v2(p, static_cast<int>(space));
1123 OS::StrNCpy(v2, arg.get(), space); 1124 OS::StrNCpy(v2, arg.get(), space);
1124 space -= Min(space, strlen(arg.get())); 1125 space -= Min(space, strlen(arg.get()));
1125 p = &buffer[kBufferSize] - space; 1126 p = &buffer[kBufferSize] - space;
1126 } 1127 }
1127 } 1128 }
1128 } 1129 }
1129 if (space > 0) { 1130 if (space > 0) {
1130 *p = '\0'; 1131 *p = '\0';
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
1991 return Handle<Object>::null(); 1992 return Handle<Object>::null();
1992 } 1993 }
1993 1994
1994 1995
1995 Handle<Object> Factory::ToBoolean(bool value) { 1996 Handle<Object> Factory::ToBoolean(bool value) {
1996 return value ? true_value() : false_value(); 1997 return value ? true_value() : false_value();
1997 } 1998 }
1998 1999
1999 2000
2000 } } // namespace v8::internal 2001 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698