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

Side by Side Diff: src/mips/full-codegen-mips.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
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // o fp: our caller's frame pointer 131 // o fp: our caller's frame pointer
132 // o sp: stack pointer 132 // o sp: stack pointer
133 // o ra: return address 133 // o ra: return address
134 // 134 //
135 // The function builds a JS frame. Please see JavaScriptFrameConstants in 135 // The function builds a JS frame. Please see JavaScriptFrameConstants in
136 // frames-mips.h for its layout. 136 // frames-mips.h for its layout.
137 void FullCodeGenerator::Generate() { 137 void FullCodeGenerator::Generate() {
138 CompilationInfo* info = info_; 138 CompilationInfo* info = info_;
139 handler_table_ = 139 handler_table_ =
140 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); 140 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED);
141 profiling_counter_ = isolate()->factory()->NewCell( 141 profiling_budget_ = isolate()->factory()->NewCell(
142 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); 142 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate()));
143 SetFunctionPosition(function()); 143 SetFunctionPosition(function());
144 Comment cmnt(masm_, "[ function compiled by full code generator"); 144 Comment cmnt(masm_, "[ function compiled by full code generator");
145 145
146 ProfileEntryHookStub::MaybeCallEntryHook(masm_); 146 ProfileEntryHookStub::MaybeCallEntryHook(masm_);
147 147
148 #ifdef DEBUG 148 #ifdef DEBUG
149 if (strlen(FLAG_stop_at) > 0 && 149 if (strlen(FLAG_stop_at) > 0 &&
150 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { 150 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) {
151 __ stop("stop-at"); 151 __ stop("stop-at");
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 } 319 }
320 320
321 321
322 void FullCodeGenerator::ClearAccumulator() { 322 void FullCodeGenerator::ClearAccumulator() {
323 ASSERT(Smi::FromInt(0) == 0); 323 ASSERT(Smi::FromInt(0) == 0);
324 __ mov(v0, zero_reg); 324 __ mov(v0, zero_reg);
325 } 325 }
326 326
327 327
328 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) { 328 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) {
329 __ li(a2, Operand(profiling_counter_)); 329 __ li(a2, Operand(profiling_budget_));
330 __ lw(a3, FieldMemOperand(a2, Cell::kValueOffset)); 330 __ lw(a3, FieldMemOperand(a2, Cell::kValueOffset));
331 __ Subu(a3, a3, Operand(Smi::FromInt(delta))); 331 __ Subu(a3, a3, Operand(Smi::FromInt(delta)));
332 __ sw(a3, FieldMemOperand(a2, Cell::kValueOffset)); 332 __ sw(a3, FieldMemOperand(a2, Cell::kValueOffset));
333 } 333 }
334 334
335 335
336 void FullCodeGenerator::EmitProfilingCounterReset() { 336 void FullCodeGenerator::EmitProfilingCounterReset() {
337 int reset_value = FLAG_interrupt_budget; 337 int reset_value = FLAG_interrupt_budget;
338 if (info_->ShouldSelfOptimize() && !FLAG_retry_self_opt) { 338 if (info_->ShouldSelfOptimize() && !FLAG_retry_self_opt) {
339 // Self-optimization is a one-off thing: if it fails, don't try again. 339 // Self-optimization is a one-off thing: if it fails, don't try again.
340 reset_value = Smi::kMaxValue; 340 reset_value = Smi::kMaxValue;
341 } 341 }
342 if (isolate()->IsDebuggerActive()) { 342 if (isolate()->IsDebuggerActive()) {
343 // Detect debug break requests as soon as possible. 343 // Detect debug break requests as soon as possible.
344 reset_value = FLAG_interrupt_budget >> 4; 344 reset_value = FLAG_interrupt_budget >> 4;
345 } 345 }
346 __ li(a2, Operand(profiling_counter_)); 346 __ li(a2, Operand(profiling_budget_));
347 __ li(a3, Operand(Smi::FromInt(reset_value))); 347 __ li(a3, Operand(Smi::FromInt(reset_value)));
348 __ sw(a3, FieldMemOperand(a2, Cell::kValueOffset)); 348 __ sw(a3, FieldMemOperand(a2, Cell::kValueOffset));
349 } 349 }
350 350
351 351
352 void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt, 352 void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt,
353 Label* back_edge_target) { 353 Label* back_edge_target) {
354 // The generated code is used in Deoptimizer::PatchStackCheckCodeAt so we need 354 // The generated code is used in Deoptimizer::PatchStackCheckCodeAt so we need
355 // to make sure it is constant. Branch may emit a skip-or-jump sequence 355 // to make sure it is constant. Branch may emit a skip-or-jump sequence
356 // instead of the normal Branch. It seems that the "skip" part of that 356 // instead of the normal Branch. It seems that the "skip" part of that
(...skipping 4561 matching lines...) Expand 10 before | Expand all | Expand 10 after
4918 *context_length = 0; 4918 *context_length = 0;
4919 return previous_; 4919 return previous_;
4920 } 4920 }
4921 4921
4922 4922
4923 #undef __ 4923 #undef __
4924 4924
4925 } } // namespace v8::internal 4925 } } // namespace v8::internal
4926 4926
4927 #endif // V8_TARGET_ARCH_MIPS 4927 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« src/full-codegen.cc ('K') | « src/ia32/full-codegen-ia32.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698