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

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

Issue 10548043: Merged r11784 into 3.9 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.9
Patch Set: Created 8 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/arm/code-stubs-arm.cc ('k') | src/arm/lithium-codegen-arm.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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 ASSERT(patch_site_.is_bound() == info_emitted_); 66 ASSERT(patch_site_.is_bound() == info_emitted_);
67 } 67 }
68 68
69 // When initially emitting this ensure that a jump is always generated to skip 69 // When initially emitting this ensure that a jump is always generated to skip
70 // the inlined smi code. 70 // the inlined smi code.
71 void EmitJumpIfNotSmi(Register reg, Label* target) { 71 void EmitJumpIfNotSmi(Register reg, Label* target) {
72 ASSERT(!patch_site_.is_bound() && !info_emitted_); 72 ASSERT(!patch_site_.is_bound() && !info_emitted_);
73 Assembler::BlockConstPoolScope block_const_pool(masm_); 73 Assembler::BlockConstPoolScope block_const_pool(masm_);
74 __ bind(&patch_site_); 74 __ bind(&patch_site_);
75 __ cmp(reg, Operand(reg)); 75 __ cmp(reg, Operand(reg));
76 // Don't use b(al, ...) as that might emit the constant pool right after the
77 // branch. After patching when the branch is no longer unconditional
78 // execution can continue into the constant pool.
79 __ b(eq, target); // Always taken before patched. 76 __ b(eq, target); // Always taken before patched.
80 } 77 }
81 78
82 // When initially emitting this ensure that a jump is never generated to skip 79 // When initially emitting this ensure that a jump is never generated to skip
83 // the inlined smi code. 80 // the inlined smi code.
84 void EmitJumpIfSmi(Register reg, Label* target) { 81 void EmitJumpIfSmi(Register reg, Label* target) {
85 ASSERT(!patch_site_.is_bound() && !info_emitted_); 82 ASSERT(!patch_site_.is_bound() && !info_emitted_);
86 Assembler::BlockConstPoolScope block_const_pool(masm_); 83 Assembler::BlockConstPoolScope block_const_pool(masm_);
87 __ bind(&patch_site_); 84 __ bind(&patch_site_);
88 __ cmp(reg, Operand(reg)); 85 __ cmp(reg, Operand(reg));
89 __ b(ne, target); // Never taken before patched. 86 __ b(ne, target); // Never taken before patched.
90 } 87 }
91 88
92 void EmitPatchInfo() { 89 void EmitPatchInfo() {
90 // Block literal pool emission whilst recording patch site information.
91 Assembler::BlockConstPoolScope block_const_pool(masm_);
93 if (patch_site_.is_bound()) { 92 if (patch_site_.is_bound()) {
94 int delta_to_patch_site = masm_->InstructionsGeneratedSince(&patch_site_); 93 int delta_to_patch_site = masm_->InstructionsGeneratedSince(&patch_site_);
95 Register reg; 94 Register reg;
96 reg.set_code(delta_to_patch_site / kOff12Mask); 95 reg.set_code(delta_to_patch_site / kOff12Mask);
97 __ cmp_raw_immediate(reg, delta_to_patch_site % kOff12Mask); 96 __ cmp_raw_immediate(reg, delta_to_patch_site % kOff12Mask);
98 #ifdef DEBUG 97 #ifdef DEBUG
99 info_emitted_ = true; 98 info_emitted_ = true;
100 #endif 99 #endif
101 } else { 100 } else {
102 __ nop(); // Signals no inlined code. 101 __ nop(); // Signals no inlined code.
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 343 }
345 344
346 345
347 static const int kMaxBackEdgeWeight = 127; 346 static const int kMaxBackEdgeWeight = 127;
348 static const int kBackEdgeDistanceDivisor = 142; 347 static const int kBackEdgeDistanceDivisor = 142;
349 348
350 349
351 void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt, 350 void FullCodeGenerator::EmitStackCheck(IterationStatement* stmt,
352 Label* back_edge_target) { 351 Label* back_edge_target) {
353 Comment cmnt(masm_, "[ Stack check"); 352 Comment cmnt(masm_, "[ Stack check");
353 // Block literal pools whilst emitting stack check code.
354 Assembler::BlockConstPoolScope block_const_pool(masm_);
354 Label ok; 355 Label ok;
355 356
356 if (FLAG_count_based_interrupts) { 357 if (FLAG_count_based_interrupts) {
357 int weight = 1; 358 int weight = 1;
358 if (FLAG_weighted_back_edges) { 359 if (FLAG_weighted_back_edges) {
359 ASSERT(back_edge_target->is_bound()); 360 ASSERT(back_edge_target->is_bound());
360 int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target); 361 int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target);
361 weight = Min(kMaxBackEdgeWeight, 362 weight = Min(kMaxBackEdgeWeight,
362 Max(1, distance / kBackEdgeDistanceDivisor)); 363 Max(1, distance / kBackEdgeDistanceDivisor));
363 } 364 }
(...skipping 4066 matching lines...) Expand 10 before | Expand all | Expand 10 after
4430 *context_length = 0; 4431 *context_length = 0;
4431 return previous_; 4432 return previous_;
4432 } 4433 }
4433 4434
4434 4435
4435 #undef __ 4436 #undef __
4436 4437
4437 } } // namespace v8::internal 4438 } } // namespace v8::internal
4438 4439
4439 #endif // V8_TARGET_ARCH_ARM 4440 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698