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

Side by Side Diff: src/deoptimizer.cc

Issue 17826004: Get rid of the ZoneScopeMode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | « src/compiler.cc ('k') | src/gdb-jit.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 int count, 277 int count,
278 BailoutType type) { 278 BailoutType type) {
279 TableEntryGenerator generator(masm, type, count); 279 TableEntryGenerator generator(masm, type, count);
280 generator.Generate(); 280 generator.Generate();
281 } 281 }
282 282
283 283
284 void Deoptimizer::VisitAllOptimizedFunctionsForContext( 284 void Deoptimizer::VisitAllOptimizedFunctionsForContext(
285 Context* context, OptimizedFunctionVisitor* visitor) { 285 Context* context, OptimizedFunctionVisitor* visitor) {
286 Isolate* isolate = context->GetIsolate(); 286 Isolate* isolate = context->GetIsolate();
287 ZoneScope zone_scope(isolate->runtime_zone(), DELETE_ON_EXIT); 287 ZoneScope zone_scope(isolate->runtime_zone());
288 DisallowHeapAllocation no_allocation; 288 DisallowHeapAllocation no_allocation;
289 289
290 ASSERT(context->IsNativeContext()); 290 ASSERT(context->IsNativeContext());
291 291
292 visitor->EnterContext(context); 292 visitor->EnterContext(context);
293 293
294 // Create a snapshot of the optimized functions list. This is needed because 294 // Create a snapshot of the optimized functions list. This is needed because
295 // visitors might remove more than one link from the list at once. 295 // visitors might remove more than one link from the list at once.
296 ZoneList<JSFunction*> snapshot(1, isolate->runtime_zone()); 296 ZoneList<JSFunction*> snapshot(1, isolate->runtime_zone());
297 Object* element = context->OptimizedFunctionsListHead(); 297 Object* element = context->OptimizedFunctionsListHead();
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 } 414 }
415 415
416 416
417 void Deoptimizer::DeoptimizeFunction(JSFunction* function) { 417 void Deoptimizer::DeoptimizeFunction(JSFunction* function) {
418 if (!function->IsOptimized()) return; 418 if (!function->IsOptimized()) return;
419 Code* code = function->code(); 419 Code* code = function->code();
420 Context* context = function->context()->native_context(); 420 Context* context = function->context()->native_context();
421 Isolate* isolate = context->GetIsolate(); 421 Isolate* isolate = context->GetIsolate();
422 Object* undefined = isolate->heap()->undefined_value(); 422 Object* undefined = isolate->heap()->undefined_value();
423 Zone* zone = isolate->runtime_zone(); 423 Zone* zone = isolate->runtime_zone();
424 ZoneScope zone_scope(zone, DELETE_ON_EXIT); 424 ZoneScope zone_scope(zone);
425 ZoneList<Code*> codes(1, zone); 425 ZoneList<Code*> codes(1, zone);
426 DeoptimizeWithMatchingCodeFilter filter(code); 426 DeoptimizeWithMatchingCodeFilter filter(code);
427 PartitionOptimizedFunctions(context, &filter, &codes, zone, undefined); 427 PartitionOptimizedFunctions(context, &filter, &codes, zone, undefined);
428 ASSERT_EQ(1, codes.length()); 428 ASSERT_EQ(1, codes.length());
429 DeoptimizeFunctionWithPreparedFunctionList( 429 DeoptimizeFunctionWithPreparedFunctionList(
430 JSFunction::cast(codes.at(0)->deoptimizing_functions())); 430 JSFunction::cast(codes.at(0)->deoptimizing_functions()));
431 codes.at(0)->set_deoptimizing_functions(undefined); 431 codes.at(0)->set_deoptimizing_functions(undefined);
432 } 432 }
433 433
434 434
435 void Deoptimizer::DeoptimizeAllFunctionsForContext( 435 void Deoptimizer::DeoptimizeAllFunctionsForContext(
436 Context* context, OptimizedFunctionFilter* filter) { 436 Context* context, OptimizedFunctionFilter* filter) {
437 ASSERT(context->IsNativeContext()); 437 ASSERT(context->IsNativeContext());
438 Isolate* isolate = context->GetIsolate(); 438 Isolate* isolate = context->GetIsolate();
439 Object* undefined = isolate->heap()->undefined_value(); 439 Object* undefined = isolate->heap()->undefined_value();
440 Zone* zone = isolate->runtime_zone(); 440 Zone* zone = isolate->runtime_zone();
441 ZoneScope zone_scope(zone, DELETE_ON_EXIT); 441 ZoneScope zone_scope(zone);
442 ZoneList<Code*> codes(1, zone); 442 ZoneList<Code*> codes(1, zone);
443 PartitionOptimizedFunctions(context, filter, &codes, zone, undefined); 443 PartitionOptimizedFunctions(context, filter, &codes, zone, undefined);
444 for (int i = 0; i < codes.length(); ++i) { 444 for (int i = 0; i < codes.length(); ++i) {
445 DeoptimizeFunctionWithPreparedFunctionList( 445 DeoptimizeFunctionWithPreparedFunctionList(
446 JSFunction::cast(codes.at(i)->deoptimizing_functions())); 446 JSFunction::cast(codes.at(i)->deoptimizing_functions()));
447 codes.at(i)->set_deoptimizing_functions(undefined); 447 codes.at(i)->set_deoptimizing_functions(undefined);
448 } 448 }
449 } 449 }
450 450
451 451
(...skipping 2659 matching lines...) Expand 10 before | Expand all | Expand 10 after
3111 3111
3112 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 3112 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
3113 v->VisitPointer(BitCast<Object**>(&function_)); 3113 v->VisitPointer(BitCast<Object**>(&function_));
3114 v->VisitPointers(parameters_, parameters_ + parameters_count_); 3114 v->VisitPointers(parameters_, parameters_ + parameters_count_);
3115 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 3115 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
3116 } 3116 }
3117 3117
3118 #endif // ENABLE_DEBUGGER_SUPPORT 3118 #endif // ENABLE_DEBUGGER_SUPPORT
3119 3119
3120 } } // namespace v8::internal 3120 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/gdb-jit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698