| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // o esi: our context | 112 // o esi: our context |
| 113 // o ebp: our caller's frame pointer | 113 // o ebp: our caller's frame pointer |
| 114 // o esp: stack pointer (pointing to return address) | 114 // o esp: stack pointer (pointing to return address) |
| 115 // | 115 // |
| 116 // The function builds a JS frame. Please see JavaScriptFrameConstants in | 116 // The function builds a JS frame. Please see JavaScriptFrameConstants in |
| 117 // frames-ia32.h for its layout. | 117 // frames-ia32.h for its layout. |
| 118 void FullCodeGenerator::Generate() { | 118 void FullCodeGenerator::Generate() { |
| 119 CompilationInfo* info = info_; | 119 CompilationInfo* info = info_; |
| 120 handler_table_ = | 120 handler_table_ = |
| 121 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); | 121 isolate()->factory()->NewFixedArray(function()->handler_count(), TENURED); |
| 122 profiling_counter_ = isolate()->factory()->NewCell( | 122 profiling_budget_ = isolate()->factory()->NewCell( |
| 123 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); | 123 Handle<Smi>(Smi::FromInt(FLAG_interrupt_budget), isolate())); |
| 124 SetFunctionPosition(function()); | 124 SetFunctionPosition(function()); |
| 125 Comment cmnt(masm_, "[ function compiled by full code generator"); | 125 Comment cmnt(masm_, "[ function compiled by full code generator"); |
| 126 | 126 |
| 127 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 127 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
| 128 | 128 |
| 129 #ifdef DEBUG | 129 #ifdef DEBUG |
| 130 if (strlen(FLAG_stop_at) > 0 && | 130 if (strlen(FLAG_stop_at) > 0 && |
| 131 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 131 info->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
| 132 __ int3(); | 132 __ int3(); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 } | 308 } |
| 309 } | 309 } |
| 310 | 310 |
| 311 | 311 |
| 312 void FullCodeGenerator::ClearAccumulator() { | 312 void FullCodeGenerator::ClearAccumulator() { |
| 313 __ Set(eax, Immediate(Smi::FromInt(0))); | 313 __ Set(eax, Immediate(Smi::FromInt(0))); |
| 314 } | 314 } |
| 315 | 315 |
| 316 | 316 |
| 317 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) { | 317 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) { |
| 318 __ mov(ebx, Immediate(profiling_counter_)); | 318 __ mov(ebx, Immediate(profiling_budget_)); |
| 319 __ sub(FieldOperand(ebx, Cell::kValueOffset), | 319 __ sub(FieldOperand(ebx, Cell::kValueOffset), |
| 320 Immediate(Smi::FromInt(delta))); | 320 Immediate(Smi::FromInt(delta))); |
| 321 } | 321 } |
| 322 | 322 |
| 323 | 323 |
| 324 void FullCodeGenerator::EmitProfilingCounterReset() { | 324 void FullCodeGenerator::EmitProfilingCounterReset() { |
| 325 int reset_value = FLAG_interrupt_budget; | 325 int reset_value = FLAG_interrupt_budget; |
| 326 if (info_->ShouldSelfOptimize() && !FLAG_retry_self_opt) { | 326 if (info_->ShouldSelfOptimize() && !FLAG_retry_self_opt) { |
| 327 // Self-optimization is a one-off thing: if it fails, don't try again. | 327 // Self-optimization is a one-off thing: if it fails, don't try again. |
| 328 reset_value = Smi::kMaxValue; | 328 reset_value = Smi::kMaxValue; |
| 329 } | 329 } |
| 330 __ mov(ebx, Immediate(profiling_counter_)); | 330 __ mov(ebx, Immediate(profiling_budget_)); |
| 331 __ mov(FieldOperand(ebx, Cell::kValueOffset), | 331 __ mov(FieldOperand(ebx, Cell::kValueOffset), |
| 332 Immediate(Smi::FromInt(reset_value))); | 332 Immediate(Smi::FromInt(reset_value))); |
| 333 } | 333 } |
| 334 | 334 |
| 335 | 335 |
| 336 void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt, | 336 void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt, |
| 337 Label* back_edge_target) { | 337 Label* back_edge_target) { |
| 338 Comment cmnt(masm_, "[ Back edge bookkeeping"); | 338 Comment cmnt(masm_, "[ Back edge bookkeeping"); |
| 339 Label ok; | 339 Label ok; |
| 340 | 340 |
| (...skipping 4549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4890 *stack_depth = 0; | 4890 *stack_depth = 0; |
| 4891 *context_length = 0; | 4891 *context_length = 0; |
| 4892 return previous_; | 4892 return previous_; |
| 4893 } | 4893 } |
| 4894 | 4894 |
| 4895 #undef __ | 4895 #undef __ |
| 4896 | 4896 |
| 4897 } } // namespace v8::internal | 4897 } } // namespace v8::internal |
| 4898 | 4898 |
| 4899 #endif // V8_TARGET_ARCH_IA32 | 4899 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |