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

Side by Side Diff: src/full-codegen.cc

Issue 23747003: Wire up profiling budget to the Code object. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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/full-codegen.h ('k') | src/ia32/full-codegen-ia32.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 unsigned table_offset = cgen.EmitBackEdgeTable(); 331 unsigned table_offset = cgen.EmitBackEdgeTable();
332 332
333 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); 333 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION);
334 Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info); 334 Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info);
335 code->set_optimizable(info->IsOptimizable() && 335 code->set_optimizable(info->IsOptimizable() &&
336 !info->function()->flags()->Contains(kDontOptimize) && 336 !info->function()->flags()->Contains(kDontOptimize) &&
337 info->function()->scope()->AllowsLazyCompilation()); 337 info->function()->scope()->AllowsLazyCompilation());
338 cgen.PopulateDeoptimizationData(code); 338 cgen.PopulateDeoptimizationData(code);
339 cgen.PopulateTypeFeedbackInfo(code); 339 cgen.PopulateTypeFeedbackInfo(code);
340 cgen.PopulateTypeFeedbackCells(code); 340 cgen.PopulateTypeFeedbackCells(code);
341 cgen.SetProfilingBudgetCell(code);
341 code->set_has_deoptimization_support(info->HasDeoptimizationSupport()); 342 code->set_has_deoptimization_support(info->HasDeoptimizationSupport());
342 code->set_handler_table(*cgen.handler_table()); 343 code->set_handler_table(*cgen.handler_table());
343 #ifdef ENABLE_DEBUGGER_SUPPORT 344 #ifdef ENABLE_DEBUGGER_SUPPORT
344 code->set_has_debug_break_slots( 345 code->set_has_debug_break_slots(
345 info->isolate()->debugger()->IsDebuggerActive()); 346 info->isolate()->debugger()->IsDebuggerActive());
346 code->set_compiled_optimizable(info->IsOptimizable()); 347 code->set_compiled_optimizable(info->IsOptimizable());
347 #endif // ENABLE_DEBUGGER_SUPPORT 348 #endif // ENABLE_DEBUGGER_SUPPORT
348 code->set_allow_osr_at_loop_nesting_level(0); 349 code->set_allow_osr_at_loop_nesting_level(0);
349 code->set_profiler_ticks(0); 350 code->set_profiler_ticks(0);
350 code->set_back_edge_table_offset(table_offset); 351 code->set_back_edge_table_offset(table_offset);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 isolate()->factory()->NewFixedArray(array_size, TENURED)); 428 isolate()->factory()->NewFixedArray(array_size, TENURED));
428 for (int i = 0; i < length; i++) { 429 for (int i = 0; i < length; i++) {
429 cache->SetAstId(i, type_feedback_cells_[i].ast_id); 430 cache->SetAstId(i, type_feedback_cells_[i].ast_id);
430 cache->SetCell(i, *type_feedback_cells_[i].cell); 431 cache->SetCell(i, *type_feedback_cells_[i].cell);
431 } 432 }
432 TypeFeedbackInfo::cast(code->type_feedback_info())->set_type_feedback_cells( 433 TypeFeedbackInfo::cast(code->type_feedback_info())->set_type_feedback_cells(
433 *cache); 434 *cache);
434 } 435 }
435 436
436 437
438 void FullCodeGenerator::SetProfilingBudgetCell(Handle<Code> code) {
439 ASSERT(!profiling_budget_.is_null());
Jakob Kummerow 2013/08/30 11:13:39 No need for this ASSERT, you get it for free as pa
440 code->set_profiling_budget(*profiling_budget_);
441 }
442
437 443
438 void FullCodeGenerator::PrepareForBailout(Expression* node, State state) { 444 void FullCodeGenerator::PrepareForBailout(Expression* node, State state) {
439 PrepareForBailoutForId(node->id(), state); 445 PrepareForBailoutForId(node->id(), state);
440 } 446 }
441 447
442 448
443 void FullCodeGenerator::RecordJSReturnSite(Call* call) { 449 void FullCodeGenerator::RecordJSReturnSite(Call* call) {
444 // We record the offset of the function return so we can rebuild the frame 450 // We record the offset of the function return so we can rebuild the frame
445 // if the function was inlined, i.e., this is the return address in the 451 // if the function was inlined, i.e., this is the return address in the
446 // inlined function's frame. 452 // inlined function's frame.
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 } 1618 }
1613 1619
1614 return false; 1620 return false;
1615 } 1621 }
1616 1622
1617 1623
1618 #undef __ 1624 #undef __
1619 1625
1620 1626
1621 } } // namespace v8::internal 1627 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/full-codegen.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698