BUG=webkit:90003
TEST=the following takes only about 1 second in debug mode: var a=[1,2,3,4,5]; eval("for (var i=0;i<50000;i++) a.sort(function(){return 1;});");
Review URL: https://chromiumcodereview.appspot.com/
10704078
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11982
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
void Context::AddOptimizedFunction(JSFunction* function) {
ASSERT(IsGlobalContext());
#ifdef DEBUG
- Object* element = get(OPTIMIZED_FUNCTIONS_LIST);
- while (!element->IsUndefined()) {
- CHECK(element != function);
- element = JSFunction::cast(element)->next_function_link();
+ if (FLAG_enable_slow_asserts) {
+ Object* element = get(OPTIMIZED_FUNCTIONS_LIST);
+ while (!element->IsUndefined()) {
+ CHECK(element != function);
+ element = JSFunction::cast(element)->next_function_link();
+ }
}
CHECK(function->next_function_link()->IsUndefined());