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

Side by Side Diff: src/x64/full-codegen-x64.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
« src/full-codegen.cc ('K') | « src/objects-inl.h ('k') | 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 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // o rsi: our context 111 // o rsi: our context
112 // o rbp: our caller's frame pointer 112 // o rbp: our caller's frame pointer
113 // o rsp: stack pointer (pointing to return address) 113 // o rsp: stack pointer (pointing to return address)
114 // 114 //
115 // The function builds a JS frame. Please see JavaScriptFrameConstants in 115 // The function builds a JS frame. Please see JavaScriptFrameConstants in
116 // frames-x64.h for its layout. 116 // frames-x64.h for its layout.
117 void FullCodeGenerator::Generate() { 117 void FullCodeGenerator::Generate() {
118 CompilationInfo* info = info_; 118 CompilationInfo* info = info_;
119 handler_table_ = 119 handler_table_ =
120 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); 120 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED);
121 profiling_counter_ = isolate()->factory()->NewCell( 121 profiling_budget_ = isolate()->factory()->NewCell(
122 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); 122 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
123 SetFunctionPosition(function()); 123 SetFunctionPosition(function());
124 Comment cmnt(masm_, "[ function compiled by full code generator"); 124 Comment cmnt(masm_, "[ function compiled by full code generator");
125 125
126 ProfileEntryHookStub::MaybeCallEntryHook(masm_); 126 ProfileEntryHookStub::MaybeCallEntryHook(masm_);
127 127
128 #ifdef DEBUG 128 #ifdef DEBUG
129 if (strlen(FLAG_stop_at) > 0 && 129 if (strlen(FLAG_stop_at) > 0 &&
130 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { 130 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
131 __ int3(); 131 __ int3();
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 } 300 }
301 } 301 }
302 302
303 303
304 void FullCodeGenerator::ClearAccumulator() { 304 void FullCodeGenerator::ClearAccumulator() {
305 __ Set(rax, 0); 305 __ Set(rax, 0);
306 } 306 }
307 307
308 308
309 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) { 309 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) {
310 __ movq(rbx, profiling_counter_, RelocInfo::EMBEDDED_OBJECT); 310 __ movq(rbx, profiling_budget_, RelocInfo::EMBEDDED_OBJECT);
311 __ SmiAddConstant(FieldOperand(rbx, Cell::kValueOffset), 311 __ SmiAddConstant(FieldOperand(rbx, Cell::kValueOffset),
312 Smi::FromInt(-delta)); 312 Smi::FromInt(-delta));
313 } 313 }
314 314
315 315
316 void FullCodeGenerator::EmitProfilingCounterReset() { 316 void FullCodeGenerator::EmitProfilingCounterReset() {
317 int reset_value = FLAG_interrupt_budget; 317 int reset_value = FLAG_interrupt_budget;
318 if (info_->ShouldSelfOptimize() && !FLAG_retry_self_opt) { 318 if (info_->ShouldSelfOptimize() && !FLAG_retry_self_opt) {
319 // Self-optimization is a one-off thing; if it fails, don't try again. 319 // Self-optimization is a one-off thing; if it fails, don't try again.
320 reset_value = Smi::kMaxValue; 320 reset_value = Smi::kMaxValue;
321 } 321 }
322 __ movq(rbx, profiling_counter_, RelocInfo::EMBEDDED_OBJECT); 322 __ movq(rbx, profiling_budget_, RelocInfo::EMBEDDED_OBJECT);
323 __ movq(kScratchRegister, 323 __ movq(kScratchRegister,
324 reinterpret_cast<uint64_t>(Smi::FromInt(reset_value)), 324 reinterpret_cast<uint64_t>(Smi::FromInt(reset_value)),
325 RelocInfo::NONE64); 325 RelocInfo::NONE64);
326 __ movq(FieldOperand(rbx, Cell::kValueOffset), kScratchRegister); 326 __ movq(FieldOperand(rbx, Cell::kValueOffset), kScratchRegister);
327 } 327 }
328 328
329 329
330 void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt, 330 void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt,
331 Label* back_edge_target) { 331 Label* back_edge_target) {
332 Comment cmnt(masm_, "[ Back edge bookkeeping"); 332 Comment cmnt(masm_, "[ Back edge bookkeeping");
(...skipping 4545 matching lines...) Expand 10 before | Expand all | Expand 10 after
4878 *context_length = 0; 4878 *context_length = 0;
4879 return previous_; 4879 return previous_;
4880 } 4880 }
4881 4881
4882 4882
4883 #undef __ 4883 #undef __
4884 4884
4885 } } // namespace v8::internal 4885 } } // namespace v8::internal
4886 4886
4887 #endif // V8_TARGET_ARCH_X64 4887 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/full-codegen.cc ('K') | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698