Move quadratic behavior of Context's optimized function list verification...

Move quadratic behavior of Context's optimized function list verification behind --enable-slow-asserts flag

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
parent ec4ab693
......@@ -243,10 +243,12 @@ Handle<Object> Context::Lookup(Handle<String> name,
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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment