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

Side by Side Diff: src/contexts.cc

Issue 10704078: Move quadratic behavior of Context's optimized function list verification behind --enable-slow-asse… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 months 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 if (FLAG_trace_contexts) { 236 if (FLAG_trace_contexts) {
237 PrintF("=> no property/slot found\n"); 237 PrintF("=> no property/slot found\n");
238 } 238 }
239 return Handle<Object>::null(); 239 return Handle<Object>::null();
240 } 240 }
241 241
242 242
243 void Context::AddOptimizedFunction(JSFunction* function) { 243 void Context::AddOptimizedFunction(JSFunction* function) {
244 ASSERT(IsGlobalContext()); 244 ASSERT(IsGlobalContext());
245 #ifdef DEBUG 245 #ifdef DEBUG
246 Object* element = get(OPTIMIZED_FUNCTIONS_LIST); 246 if (FLAG_enable_slow_asserts) {
247 while (!element->IsUndefined()) { 247 Object* element = get(OPTIMIZED_FUNCTIONS_LIST);
248 CHECK(element != function); 248 while (!element->IsUndefined()) {
249 element = JSFunction::cast(element)->next_function_link(); 249 CHECK(element != function);
250 element = JSFunction::cast(element)->next_function_link();
251 }
250 } 252 }
251 253
252 CHECK(function->next_function_link()->IsUndefined()); 254 CHECK(function->next_function_link()->IsUndefined());
253 255
254 // Check that the context belongs to the weak global contexts list. 256 // Check that the context belongs to the weak global contexts list.
255 bool found = false; 257 bool found = false;
256 Object* context = GetHeap()->global_contexts_list(); 258 Object* context = GetHeap()->global_contexts_list();
257 while (!context->IsUndefined()) { 259 while (!context->IsUndefined()) {
258 if (context == this) { 260 if (context == this) {
259 found = true; 261 found = true;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 // During bootstrapping we allow all objects to pass as global 317 // During bootstrapping we allow all objects to pass as global
316 // objects. This is necessary to fix circular dependencies. 318 // objects. This is necessary to fix circular dependencies.
317 Isolate* isolate = Isolate::Current(); 319 Isolate* isolate = Isolate::Current();
318 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || 320 return isolate->heap()->gc_state() != Heap::NOT_IN_GC ||
319 isolate->bootstrapper()->IsActive() || 321 isolate->bootstrapper()->IsActive() ||
320 object->IsGlobalObject(); 322 object->IsGlobalObject();
321 } 323 }
322 #endif 324 #endif
323 325
324 } } // namespace v8::internal 326 } } // 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