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(); |