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

Side by Side Diff: src/log.cc

Issue 204693002: Handlify callers to GetElementNoException. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix 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/liveedit.cc ('k') | src/objects.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 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 1199
1200 void Logger::LogRuntime(Vector<const char> format, 1200 void Logger::LogRuntime(Vector<const char> format,
1201 Handle<JSArray> args) { 1201 Handle<JSArray> args) {
1202 if (!log_->IsEnabled() || !FLAG_log_runtime) return; 1202 if (!log_->IsEnabled() || !FLAG_log_runtime) return;
1203 Log::MessageBuilder msg(log_); 1203 Log::MessageBuilder msg(log_);
1204 for (int i = 0; i < format.length(); i++) { 1204 for (int i = 0; i < format.length(); i++) {
1205 char c = format[i]; 1205 char c = format[i];
1206 if (c == '%' && i <= format.length() - 2) { 1206 if (c == '%' && i <= format.length() - 2) {
1207 i++; 1207 i++;
1208 ASSERT('0' <= format[i] && format[i] <= '9'); 1208 ASSERT('0' <= format[i] && format[i] <= '9');
1209 Handle<Object> obj = Object::GetElement(isolate_, args, format[i] - '0');
1210 // No exception expected when getting an element from an array literal. 1209 // No exception expected when getting an element from an array literal.
1211 CHECK_NOT_EMPTY_HANDLE(isolate_, obj); 1210 Handle<Object> obj =
1211 Object::GetElementNoExceptionThrown(isolate_, args, format[i] - '0');
1212 i++; 1212 i++;
1213 switch (format[i]) { 1213 switch (format[i]) {
1214 case 's': 1214 case 's':
1215 msg.AppendDetailed(String::cast(*obj), false); 1215 msg.AppendDetailed(String::cast(*obj), false);
1216 break; 1216 break;
1217 case 'S': 1217 case 'S':
1218 msg.AppendDetailed(String::cast(*obj), true); 1218 msg.AppendDetailed(String::cast(*obj), true);
1219 break; 1219 break;
1220 case 'r': 1220 case 'r':
1221 Logger::LogRegExpSource(Handle<JSRegExp>::cast(obj)); 1221 Logger::LogRegExpSource(Handle<JSRegExp>::cast(obj));
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
2155 if (jit_logger_) { 2155 if (jit_logger_) {
2156 removeCodeEventListener(jit_logger_); 2156 removeCodeEventListener(jit_logger_);
2157 delete jit_logger_; 2157 delete jit_logger_;
2158 jit_logger_ = NULL; 2158 jit_logger_ = NULL;
2159 } 2159 }
2160 2160
2161 return log_->Close(); 2161 return log_->Close();
2162 } 2162 }
2163 2163
2164 } } // namespace v8::internal 2164 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/liveedit.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698