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

Unified Diff: src/log.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/log.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index 76fef5cd280887e4f41f51f2a696f2b7eb56ce63..e01692e188f53d418f64bd077c7ed589cdceb74c 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -1198,37 +1198,33 @@ void Logger::RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache) {
void Logger::LogRuntime(Vector<const char> format,
- JSArray* args) {
+ Handle<JSArray> args) {
if (!log_->IsEnabled() || !FLAG_log_runtime) return;
- HandleScope scope(isolate_);
Log::MessageBuilder msg(log_);
for (int i = 0; i < format.length(); i++) {
char c = format[i];
if (c == '%' && i <= format.length() - 2) {
i++;
ASSERT('0' <= format[i] && format[i] <= '9');
- MaybeObject* maybe = args->GetElement(isolate_, format[i] - '0');
- Object* obj;
- if (!maybe->ToObject(&obj)) {
- msg.Append("<exception>");
- continue;
- }
+ Handle<Object> obj = Object::GetElement(isolate_, args, format[i] - '0');
+ // No exception expected when getting an element from an array literal.
+ CHECK_NOT_EMPTY_HANDLE(isolate_, obj);
i++;
switch (format[i]) {
case 's':
- msg.AppendDetailed(String::cast(obj), false);
+ msg.AppendDetailed(String::cast(*obj), false);
break;
case 'S':
- msg.AppendDetailed(String::cast(obj), true);
+ msg.AppendDetailed(String::cast(*obj), true);
break;
case 'r':
- Logger::LogRegExpSource(Handle<JSRegExp>(JSRegExp::cast(obj)));
+ Logger::LogRegExpSource(Handle<JSRegExp>::cast(obj));
break;
case 'x':
- msg.Append("0x%x", Smi::cast(obj)->value());
+ msg.Append("0x%x", Smi::cast(*obj)->value());
break;
case 'i':
- msg.Append("%i", Smi::cast(obj)->value());
+ msg.Append("%i", Smi::cast(*obj)->value());
break;
default:
UNREACHABLE();
« no previous file with comments | « src/log.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698