Index: src/contexts.cc |
diff --git a/src/contexts.cc b/src/contexts.cc |
index 76784bd704602b955924c6255c8883b013b1e624..7e671252c8f34def676b7147a6801d7a412c5d59 100644 |
--- a/src/contexts.cc |
+++ b/src/contexts.cc |
@@ -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()); |