From: vegorov@chromium.org Date: Mon, 27 Sep 2010 10:29:25 +0000 (+0000) Subject: Fix more GC unsafe places X-Git-Tag: upstream/4.7.83~21156 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9045e2e60fab749651644054bf2335dbb1567794;p=platform%2Fupstream%2Fv8.git Fix more GC unsafe places Review URL: http://codereview.chromium.org/3499001 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5530 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/api.cc b/src/api.cc index 91ecc41..5f480c9 100644 --- a/src/api.cc +++ b/src/api.cc @@ -2658,8 +2658,9 @@ void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) { return; } i::Handle pixels = i::Factory::NewPixelArray(length, data); - self->set_map( - *i::Factory::GetSlowElementsMap(i::Handle(self->map()))); + i::Handle slow_map = + i::Factory::GetSlowElementsMap(i::Handle(self->map())); + self->set_map(*slow_map); self->set_elements(*pixels); } @@ -2713,8 +2714,9 @@ void v8::Object::SetIndexedPropertiesToExternalArrayData( } i::Handle array = i::Factory::NewExternalArray(length, array_type, data); - self->set_map( - *i::Factory::GetSlowElementsMap(i::Handle(self->map()))); + i::Handle slow_map = + i::Factory::GetSlowElementsMap(i::Handle(self->map())); + self->set_map(*slow_map); self->set_elements(*array); } diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index f2e31c0..aa8d8e5 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -1064,8 +1064,11 @@ bool Genesis::InstallNatives() { // global object. static const PropertyAttributes attributes = static_cast(READ_ONLY | DONT_DELETE); - SetProperty(builtins, Factory::LookupAsciiSymbol("global"), - Handle(global_context()->global()), attributes); + Handle global_symbol = Factory::LookupAsciiSymbol("global"); + SetProperty(builtins, + global_symbol, + Handle(global_context()->global()), + attributes); // Setup the reference from the global object to the builtins object. JSGlobalObject::cast(global_context()->global())->set_builtins(*builtins); diff --git a/src/debug.cc b/src/debug.cc index 24b1d31..53773ac 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1034,10 +1034,12 @@ bool Debug::CheckBreakPoint(Handle break_point_object) { if (!break_point_object->IsJSObject()) return true; // Get the function CheckBreakPoint (defined in debug.js). + Handle is_break_point_triggered_symbol = + Factory::LookupAsciiSymbol("IsBreakPointTriggered"); Handle check_break_point = Handle(JSFunction::cast( - debug_context()->global()->GetProperty( - *Factory::LookupAsciiSymbol("IsBreakPointTriggered")))); + debug_context()->global()->GetProperty( + *is_break_point_triggered_symbol))); // Get the break id as an object. Handle break_id = Factory::NewNumberFromInt(Debug::break_id()); @@ -2176,9 +2178,11 @@ void Debugger::OnAfterCompile(Handle