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

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

Issue 10829009: Classify small functions platform-dependently. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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 | « no previous file | src/full-codegen.h » ('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 if (isolate()->IsDebuggerActive()) { 331 if (isolate()->IsDebuggerActive()) {
332 // Detect debug break requests as soon as possible. 332 // Detect debug break requests as soon as possible.
333 reset_value = FLAG_interrupt_budget >> 4; 333 reset_value = FLAG_interrupt_budget >> 4;
334 } 334 }
335 __ mov(r2, Operand(profiling_counter_)); 335 __ mov(r2, Operand(profiling_counter_));
336 __ mov(r3, Operand(Smi::FromInt(reset_value))); 336 __ mov(r3, Operand(Smi::FromInt(reset_value)));
337 __ str(r3, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset)); 337 __ str(r3, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset));
338 } 338 }
339 339
340 340
341 static const int kMaxBackEdgeWeight = 127; 341 const int FullCodeGenerator::kMaxBackEdgeWeight = 127;
342 static const int kBackEdgeDistanceDivisor = 142; 342 const int FullCodeGenerator::kBackEdgeDistanceUnit = 142;
343 343
344 344
345 void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt, 345 void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt,
346 Label* back_edge_target) { 346 Label* back_edge_target) {
347 Comment cmnt(masm_, "[ Stack check"); 347 Comment cmnt(masm_, "[ Stack check");
348 // Block literal pools whilst emitting stack check code. 348 // Block literal pools whilst emitting stack check code.
349 Assembler::BlockConstPoolScope block_const_pool(masm_); 349 Assembler::BlockConstPoolScope block_const_pool(masm_);
350 Label ok; 350 Label ok;
351 351
352 if (FLAG_count_based_interrupts) { 352 if (FLAG_count_based_interrupts) {
353 int weight = 1; 353 int weight = 1;
354 if (FLAG_weighted_back_edges) { 354 if (FLAG_weighted_back_edges) {
355 ASSERT(back_edge_target->is_bound()); 355 ASSERT(back_edge_target->is_bound());
356 int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target); 356 int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target);
357 weight = Min(kMaxBackEdgeWeight, 357 weight = Min(kMaxBackEdgeWeight,
358 Max(1, distance / kBackEdgeDistanceDivisor)); 358 Max(1, distance / kBackEdgeDistanceUnit));
359 } 359 }
360 EmitProfilingCounterDecrement(weight); 360 EmitProfilingCounterDecrement(weight);
361 __ b(pl, &ok); 361 __ b(pl, &ok);
362 InterruptStub stub; 362 InterruptStub stub;
363 __ CallStub(&stub); 363 __ CallStub(&stub);
364 } else { 364 } else {
365 __ LoadRoot(ip, Heap::kStackLimitRootIndex); 365 __ LoadRoot(ip, Heap::kStackLimitRootIndex);
366 __ cmp(sp, Operand(ip)); 366 __ cmp(sp, Operand(ip));
367 __ b(hs, &ok); 367 __ b(hs, &ok);
368 StackCheckStub stub; 368 StackCheckStub stub;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 __ CallRuntime(Runtime::kTraceExit, 1); 400 __ CallRuntime(Runtime::kTraceExit, 1);
401 } 401 }
402 if (FLAG_interrupt_at_exit || FLAG_self_optimization) { 402 if (FLAG_interrupt_at_exit || FLAG_self_optimization) {
403 // Pretend that the exit is a backwards jump to the entry. 403 // Pretend that the exit is a backwards jump to the entry.
404 int weight = 1; 404 int weight = 1;
405 if (info_->ShouldSelfOptimize()) { 405 if (info_->ShouldSelfOptimize()) {
406 weight = FLAG_interrupt_budget / FLAG_self_opt_count; 406 weight = FLAG_interrupt_budget / FLAG_self_opt_count;
407 } else if (FLAG_weighted_back_edges) { 407 } else if (FLAG_weighted_back_edges) {
408 int distance = masm_->pc_offset(); 408 int distance = masm_->pc_offset();
409 weight = Min(kMaxBackEdgeWeight, 409 weight = Min(kMaxBackEdgeWeight,
410 Max(1, distance / kBackEdgeDistanceDivisor)); 410 Max(1, distance / kBackEdgeDistanceUnit));
411 } 411 }
412 EmitProfilingCounterDecrement(weight); 412 EmitProfilingCounterDecrement(weight);
413 Label ok; 413 Label ok;
414 __ b(pl, &ok); 414 __ b(pl, &ok);
415 __ push(r0); 415 __ push(r0);
416 if (info_->ShouldSelfOptimize() && FLAG_direct_self_opt) { 416 if (info_->ShouldSelfOptimize() && FLAG_direct_self_opt) {
417 __ ldr(r2, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 417 __ ldr(r2, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
418 __ push(r2); 418 __ push(r2);
419 __ CallRuntime(Runtime::kOptimizeFunctionOnNextCall, 1); 419 __ CallRuntime(Runtime::kOptimizeFunctionOnNextCall, 1);
420 } else { 420 } else {
(...skipping 4160 matching lines...) Expand 10 before | Expand all | Expand 10 after
4581 *context_length = 0; 4581 *context_length = 0;
4582 return previous_; 4582 return previous_;
4583 } 4583 }
4584 4584
4585 4585
4586 #undef __ 4586 #undef __
4587 4587
4588 } } // namespace v8::internal 4588 } } // namespace v8::internal
4589 4589
4590 #endif // V8_TARGET_ARCH_ARM 4590 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698