OLD | NEW |
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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 } | 307 } |
308 | 308 |
309 // Always emit a 'return undefined' in case control fell off the end of | 309 // Always emit a 'return undefined' in case control fell off the end of |
310 // the body. | 310 // the body. |
311 { Comment cmnt(masm_, "[ return <undefined>;"); | 311 { Comment cmnt(masm_, "[ return <undefined>;"); |
312 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 312 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
313 } | 313 } |
314 EmitReturnSequence(); | 314 EmitReturnSequence(); |
315 | 315 |
316 // Force emit the constant pool, so it doesn't get emitted in the middle | 316 // Force emit the constant pool, so it doesn't get emitted in the middle |
317 // of the stack check table. | 317 // of the back edge table. |
318 masm()->CheckConstPool(true, false); | 318 masm()->CheckConstPool(true, false); |
319 } | 319 } |
320 | 320 |
321 | 321 |
322 void FullCodeGenerator::ClearAccumulator() { | 322 void FullCodeGenerator::ClearAccumulator() { |
323 __ mov(r0, Operand(Smi::FromInt(0))); | 323 __ mov(r0, Operand(Smi::FromInt(0))); |
324 } | 324 } |
325 | 325 |
326 | 326 |
327 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) { | 327 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) { |
(...skipping 16 matching lines...) Expand all Loading... |
344 } | 344 } |
345 __ mov(r2, Operand(profiling_counter_)); | 345 __ mov(r2, Operand(profiling_counter_)); |
346 __ mov(r3, Operand(Smi::FromInt(reset_value))); | 346 __ mov(r3, Operand(Smi::FromInt(reset_value))); |
347 __ str(r3, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset)); | 347 __ str(r3, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset)); |
348 } | 348 } |
349 | 349 |
350 | 350 |
351 void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt, | 351 void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt, |
352 Label* back_edge_target) { | 352 Label* back_edge_target) { |
353 Comment cmnt(masm_, "[ Back edge bookkeeping"); | 353 Comment cmnt(masm_, "[ Back edge bookkeeping"); |
354 // Block literal pools whilst emitting stack check code. | 354 // Block literal pools whilst emitting back edge code. |
355 Assembler::BlockConstPoolScope block_const_pool(masm_); | 355 Assembler::BlockConstPoolScope block_const_pool(masm_); |
356 Label ok; | 356 Label ok; |
357 | 357 |
358 int weight = 1; | 358 int weight = 1; |
359 if (FLAG_weighted_back_edges) { | 359 if (FLAG_weighted_back_edges) { |
360 ASSERT(back_edge_target->is_bound()); | 360 ASSERT(back_edge_target->is_bound()); |
361 int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target); | 361 int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target); |
362 weight = Min(kMaxBackEdgeWeight, | 362 weight = Min(kMaxBackEdgeWeight, |
363 Max(1, distance / kBackEdgeDistanceUnit)); | 363 Max(1, distance / kBackEdgeDistanceUnit)); |
364 } | 364 } |
(...skipping 4203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4568 *context_length = 0; | 4568 *context_length = 0; |
4569 return previous_; | 4569 return previous_; |
4570 } | 4570 } |
4571 | 4571 |
4572 | 4572 |
4573 #undef __ | 4573 #undef __ |
4574 | 4574 |
4575 } } // namespace v8::internal | 4575 } } // namespace v8::internal |
4576 | 4576 |
4577 #endif // V8_TARGET_ARCH_ARM | 4577 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |