Chromium Code Reviews| Index: src/debug.cc |
| diff --git a/src/debug.cc b/src/debug.cc |
| index 8c6c4280ee7cfe87e37f1a90088db36376c12774..dfbe1481bccf696707d024df26840bd117f0035f 100644 |
| --- a/src/debug.cc |
| +++ b/src/debug.cc |
| @@ -2459,17 +2459,17 @@ void Debug::ClearMirrorCache() { |
| PostponeInterruptsScope postpone(isolate_); |
| HandleScope scope(isolate_); |
| ASSERT(isolate_->context() == *Debug::debug_context()); |
| - |
| - // Clear the mirror cache. |
| - Handle<Object> fun = Object::GetProperty( |
| - isolate_, |
| - isolate_->global_object(), |
| - "ClearMirrorCache").ToHandleChecked(); |
| - ASSERT(fun->IsJSFunction()); |
| - Execution::TryCall(Handle<JSFunction>::cast(fun), |
| - Handle<JSObject>(Debug::debug_context()->global_object()), |
| - 0, |
| - NULL); |
| + Factory* factory = isolate_->factory(); |
|
yurys
2014/06/03 13:27:18
Just curious why is the advantage of this implemen
Yang
2014/06/03 14:22:05
Less overhead, and I think that two SetProperty is
|
| + JSObject::SetProperty(isolate_->global_object(), |
| + factory->NewStringFromAsciiChecked("next_handle_"), |
| + handle(Smi::FromInt(0), isolate_), |
| + NONE, |
| + SLOPPY); |
| + JSObject::SetProperty(isolate_->global_object(), |
| + factory->NewStringFromAsciiChecked("mirror_cache_"), |
| + factory->NewJSArray(0, FAST_ELEMENTS), |
| + NONE, |
| + SLOPPY); |
| } |