| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // o fp: our caller's frame pointer | 122 // o fp: our caller's frame pointer |
| 123 // o sp: stack pointer | 123 // o sp: stack pointer |
| 124 // o lr: return address | 124 // o lr: return address |
| 125 // | 125 // |
| 126 // The function builds a JS frame. Please see JavaScriptFrameConstants in | 126 // The function builds a JS frame. Please see JavaScriptFrameConstants in |
| 127 // frames-arm.h for its layout. | 127 // frames-arm.h for its layout. |
| 128 void FullCodeGenerator::Generate() { | 128 void FullCodeGenerator::Generate() { |
| 129 CompilationInfo* info = info_; | 129 CompilationInfo* info = info_; |
| 130 handler_table_ = | 130 handler_table_ = |
| 131 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); | 131 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); |
| 132 profiling_counter_ = isolate()->factory()->NewCell( | 132 profiling_budget_ = isolate()->factory()->NewCell( |
| 133 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); | 133 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); |
| 134 SetFunctionPosition(function()); | 134 SetFunctionPosition(function()); |
| 135 Comment cmnt(masm_, "[ function compiled by full code generator"); | 135 Comment cmnt(masm_, "[ function compiled by full code generator"); |
| 136 | 136 |
| 137 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 137 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
| 138 | 138 |
| 139 #ifdef DEBUG | 139 #ifdef DEBUG |
| 140 if (strlen(FLAG_stop_at) > 0 && | 140 if (strlen(FLAG_stop_at) > 0 && |
| 141 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 141 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
| 142 __ stop("stop-at"); | 142 __ stop("stop-at"); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 masm()->CheckConstPool(true, false); | 320 masm()->CheckConstPool(true, false); |
| 321 } | 321 } |
| 322 | 322 |
| 323 | 323 |
| 324 void FullCodeGenerator::ClearAccumulator() { | 324 void FullCodeGenerator::ClearAccumulator() { |
| 325 __ mov(r0, Operand(Smi::FromInt(0))); | 325 __ mov(r0, Operand(Smi::FromInt(0))); |
| 326 } | 326 } |
| 327 | 327 |
| 328 | 328 |
| 329 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) { | 329 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) { |
| 330 __ mov(r2, Operand(profiling_counter_)); | 330 __ mov(r2, Operand(profiling_budget_)); |
| 331 __ ldr(r3, FieldMemOperand(r2, Cell::kValueOffset)); | 331 __ ldr(r3, FieldMemOperand(r2, Cell::kValueOffset)); |
| 332 __ sub(r3, r3, Operand(Smi::FromInt(delta)), SetCC); | 332 __ sub(r3, r3, Operand(Smi::FromInt(delta)), SetCC); |
| 333 __ str(r3, FieldMemOperand(r2, Cell::kValueOffset)); | 333 __ str(r3, FieldMemOperand(r2, Cell::kValueOffset)); |
| 334 } | 334 } |
| 335 | 335 |
| 336 | 336 |
| 337 void FullCodeGenerator::EmitProfilingCounterReset() { | 337 void FullCodeGenerator::EmitProfilingCounterReset() { |
| 338 int reset_value = FLAG_interrupt_budget; | 338 int reset_value = FLAG_interrupt_budget; |
| 339 if (info_->ShouldSelfOptimize() && !FLAG_retry_self_opt) { | 339 if (info_->ShouldSelfOptimize() && !FLAG_retry_self_opt) { |
| 340 // Self-optimization is a one-off thing: if it fails, don't try again. | 340 // Self-optimization is a one-off thing: if it fails, don't try again. |
| 341 reset_value = Smi::kMaxValue; | 341 reset_value = Smi::kMaxValue; |
| 342 } | 342 } |
| 343 if (isolate()->IsDebuggerActive()) { | 343 if (isolate()->IsDebuggerActive()) { |
| 344 // Detect debug break requests as soon as possible. | 344 // Detect debug break requests as soon as possible. |
| 345 reset_value = FLAG_interrupt_budget >> 4; | 345 reset_value = FLAG_interrupt_budget >> 4; |
| 346 } | 346 } |
| 347 __ mov(r2, Operand(profiling_counter_)); | 347 __ mov(r2, Operand(profiling_budget_)); |
| 348 __ mov(r3, Operand(Smi::FromInt(reset_value))); | 348 __ mov(r3, Operand(Smi::FromInt(reset_value))); |
| 349 __ str(r3, FieldMemOperand(r2, Cell::kValueOffset)); | 349 __ str(r3, FieldMemOperand(r2, Cell::kValueOffset)); |
| 350 } | 350 } |
| 351 | 351 |
| 352 | 352 |
| 353 void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt, | 353 void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt, |
| 354 Label* back_edge_target) { | 354 Label* back_edge_target) { |
| 355 Comment cmnt(masm_, "[ Back edge bookkeeping"); | 355 Comment cmnt(masm_, "[ Back edge bookkeeping"); |
| 356 // Block literal pools whilst emitting back edge code. | 356 // Block literal pools whilst emitting back edge code. |
| 357 Assembler::BlockConstPoolScope block_const_pool(masm_); | 357 Assembler::BlockConstPoolScope block_const_pool(masm_); |
| (...skipping 4528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4886 *context_length = 0; | 4886 *context_length = 0; |
| 4887 return previous_; | 4887 return previous_; |
| 4888 } | 4888 } |
| 4889 | 4889 |
| 4890 | 4890 |
| 4891 #undef __ | 4891 #undef __ |
| 4892 | 4892 |
| 4893 } } // namespace v8::internal | 4893 } } // namespace v8::internal |
| 4894 | 4894 |
| 4895 #endif // V8_TARGET_ARCH_ARM | 4895 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |