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

Side by Side Diff: src/ic.cc

Issue 14833: Fix an issue of a raw pointer being returned after possible allocation. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 if (object->IsJSObject() && JSObject::cast(*object)->HasFastElements()) { 348 if (object->IsJSObject() && JSObject::cast(*object)->HasFastElements()) {
349 Object* opt = Top::LookupSpecialFunction(JSObject::cast(*object), 349 Object* opt = Top::LookupSpecialFunction(JSObject::cast(*object),
350 lookup.holder(), 350 lookup.holder(),
351 JSFunction::cast(result)); 351 JSFunction::cast(result));
352 if (opt->IsJSFunction()) return opt; 352 if (opt->IsJSFunction()) return opt;
353 } 353 }
354 354
355 // If performing debug step into then flood this function with one-shot 355 // If performing debug step into then flood this function with one-shot
356 // break points if it is called from where step into was requested. 356 // break points if it is called from where step into was requested.
357 if (Debug::StepInActive() && fp() == Debug::step_in_fp()) { 357 if (Debug::StepInActive() && fp() == Debug::step_in_fp()) {
358 // Protect the result in a handle as the debugger can allocate and might
359 //cause GC.
Mads Ager (chromium) 2008/12/18 09:37:11 space after //
360 HandleScope scope;
361 Handle<Object> result_handle(result);
358 // Don't allow step into functions in the native context. 362 // Don't allow step into functions in the native context.
359 if (JSFunction::cast(result)->context()->global() != 363 if (JSFunction::cast(result)->context()->global() !=
360 Top::context()->builtins()) { 364 Top::context()->builtins()) {
361 HandleScope scope;
362 Handle<SharedFunctionInfo> shared(JSFunction::cast(result)->shared()); 365 Handle<SharedFunctionInfo> shared(JSFunction::cast(result)->shared());
363 Debug::FloodWithOneShot(shared); 366 Debug::FloodWithOneShot(shared);
364 } 367 }
368 return *result_handle;
365 } 369 }
370
366 return result; 371 return result;
367 } 372 }
368 373
369 // Try to find a suitable function delegate for the object at hand. 374 // Try to find a suitable function delegate for the object at hand.
370 result = TryCallAsFunction(result); 375 result = TryCallAsFunction(result);
371 return result->IsJSFunction() ? 376 return result->IsJSFunction() ?
372 result : TypeError("property_not_function", object, name); 377 result : TypeError("property_not_function", object, name);
373 } 378 }
374 379
375 380
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 #undef ADDR 1200 #undef ADDR
1196 }; 1201 };
1197 1202
1198 1203
1199 Address IC::AddressFromUtilityId(IC::UtilityId id) { 1204 Address IC::AddressFromUtilityId(IC::UtilityId id) {
1200 return IC_utilities[id]; 1205 return IC_utilities[id];
1201 } 1206 }
1202 1207
1203 1208
1204 } } // namespace v8::internal 1209 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698