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

Side by Side Diff: src/contexts.cc

Issue 11360062: Revert r12825 and r12796 from trunk. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 8 years, 1 month 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 | src/heap.cc » ('j') | 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 ASSERT(IsNativeContext()); 244 ASSERT(IsNativeContext());
245 #ifdef DEBUG 245 #ifdef DEBUG
246 if (FLAG_enable_slow_asserts) { 246 if (FLAG_enable_slow_asserts) {
247 Object* element = get(OPTIMIZED_FUNCTIONS_LIST); 247 Object* element = get(OPTIMIZED_FUNCTIONS_LIST);
248 while (!element->IsUndefined()) { 248 while (!element->IsUndefined()) {
249 CHECK(element != function); 249 CHECK(element != function);
250 element = JSFunction::cast(element)->next_function_link(); 250 element = JSFunction::cast(element)->next_function_link();
251 } 251 }
252 } 252 }
253 253
254 CHECK(function->next_function_link()->IsUndefined());
255
254 // Check that the context belongs to the weak native contexts list. 256 // Check that the context belongs to the weak native contexts list.
255 bool found = false; 257 bool found = false;
256 Object* context = GetHeap()->native_contexts_list(); 258 Object* context = GetHeap()->native_contexts_list();
257 while (!context->IsUndefined()) { 259 while (!context->IsUndefined()) {
258 if (context == this) { 260 if (context == this) {
259 found = true; 261 found = true;
260 break; 262 break;
261 } 263 }
262 context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK); 264 context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK);
263 } 265 }
264 CHECK(found); 266 CHECK(found);
265 #endif 267 #endif
266
267 // If the function link field is already used then the function was
268 // enqueued as a code flushing candidate and we remove it now.
269 if (!function->next_function_link()->IsUndefined()) {
270 CodeFlusher* flusher = GetHeap()->mark_compact_collector()->code_flusher();
271 flusher->EvictCandidate(function);
272 }
273
274 ASSERT(function->next_function_link()->IsUndefined());
275
276 function->set_next_function_link(get(OPTIMIZED_FUNCTIONS_LIST)); 268 function->set_next_function_link(get(OPTIMIZED_FUNCTIONS_LIST));
277 set(OPTIMIZED_FUNCTIONS_LIST, function); 269 set(OPTIMIZED_FUNCTIONS_LIST, function);
278 } 270 }
279 271
280 272
281 void Context::RemoveOptimizedFunction(JSFunction* function) { 273 void Context::RemoveOptimizedFunction(JSFunction* function) {
282 ASSERT(IsNativeContext()); 274 ASSERT(IsNativeContext());
283 Object* element = get(OPTIMIZED_FUNCTIONS_LIST); 275 Object* element = get(OPTIMIZED_FUNCTIONS_LIST);
284 JSFunction* prev = NULL; 276 JSFunction* prev = NULL;
285 while (!element->IsUndefined()) { 277 while (!element->IsUndefined()) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 // During bootstrapping we allow all objects to pass as global 334 // During bootstrapping we allow all objects to pass as global
343 // objects. This is necessary to fix circular dependencies. 335 // objects. This is necessary to fix circular dependencies.
344 Isolate* isolate = Isolate::Current(); 336 Isolate* isolate = Isolate::Current();
345 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || 337 return isolate->heap()->gc_state() != Heap::NOT_IN_GC ||
346 isolate->bootstrapper()->IsActive() || 338 isolate->bootstrapper()->IsActive() ||
347 object->IsGlobalObject(); 339 object->IsGlobalObject();
348 } 340 }
349 #endif 341 #endif
350 342
351 } } // namespace v8::internal 343 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698