| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 if (FLAG_trace && info()->IsOptimizing()) { | 248 if (FLAG_trace && info()->IsOptimizing()) { |
| 249 __ CallRuntime(Runtime::kTraceEnter, 0); | 249 __ CallRuntime(Runtime::kTraceEnter, 0); |
| 250 } | 250 } |
| 251 return !is_aborted(); | 251 return !is_aborted(); |
| 252 } | 252 } |
| 253 | 253 |
| 254 | 254 |
| 255 bool LCodeGen::GenerateBody() { | 255 bool LCodeGen::GenerateBody() { |
| 256 ASSERT(is_generating()); | 256 ASSERT(is_generating()); |
| 257 bool emit_instructions = true; | 257 bool emit_instructions = true; |
| 258 int old_position = RelocInfo::kNoPosition; |
| 258 for (current_instruction_ = 0; | 259 for (current_instruction_ = 0; |
| 259 !is_aborted() && current_instruction_ < instructions_->length(); | 260 !is_aborted() && current_instruction_ < instructions_->length(); |
| 260 current_instruction_++) { | 261 current_instruction_++) { |
| 261 LInstruction* instr = instructions_->at(current_instruction_); | 262 LInstruction* instr = instructions_->at(current_instruction_); |
| 262 | 263 |
| 263 // Don't emit code for basic blocks with a replacement. | 264 // Don't emit code for basic blocks with a replacement. |
| 264 if (instr->IsLabel()) { | 265 if (instr->IsLabel()) { |
| 265 emit_instructions = !LLabel::cast(instr)->HasReplacement(); | 266 emit_instructions = !LLabel::cast(instr)->HasReplacement(); |
| 266 } | 267 } |
| 267 if (!emit_instructions) continue; | 268 if (!emit_instructions) continue; |
| 268 | 269 |
| 269 if (FLAG_code_comments && instr->HasInterestingComment(this)) { | 270 if (FLAG_code_comments && instr->HasInterestingComment(this)) { |
| 270 Comment(";;; <@%d,#%d> %s", | 271 Comment(";;; <@%d,#%d> %s", |
| 271 current_instruction_, | 272 current_instruction_, |
| 272 instr->hydrogen_value()->id(), | 273 instr->hydrogen_value()->id(), |
| 273 instr->Mnemonic()); | 274 instr->Mnemonic()); |
| 274 } | 275 } |
| 275 | 276 |
| 277 int pos = instr->position(); |
| 278 if (pos >= 0 && pos != old_position) { |
| 279 RecordPosition(pos); |
| 280 old_position = pos; |
| 281 } |
| 282 |
| 276 instr->CompileToNative(this); | 283 instr->CompileToNative(this); |
| 277 } | 284 } |
| 278 EnsureSpaceForLazyDeopt(Deoptimizer::patch_size()); | 285 EnsureSpaceForLazyDeopt(Deoptimizer::patch_size()); |
| 279 return !is_aborted(); | 286 return !is_aborted(); |
| 280 } | 287 } |
| 281 | 288 |
| 282 | 289 |
| 283 bool LCodeGen::GenerateJumpTable() { | 290 bool LCodeGen::GenerateJumpTable() { |
| 284 Label needs_frame; | 291 Label needs_frame; |
| 285 if (jump_table_.length() > 0) { | 292 if (jump_table_.length() > 0) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 } | 326 } |
| 320 return !is_aborted(); | 327 return !is_aborted(); |
| 321 } | 328 } |
| 322 | 329 |
| 323 | 330 |
| 324 bool LCodeGen::GenerateDeferredCode() { | 331 bool LCodeGen::GenerateDeferredCode() { |
| 325 ASSERT(is_generating()); | 332 ASSERT(is_generating()); |
| 326 if (deferred_.length() > 0) { | 333 if (deferred_.length() > 0) { |
| 327 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { | 334 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { |
| 328 LDeferredCode* code = deferred_[i]; | 335 LDeferredCode* code = deferred_[i]; |
| 336 |
| 337 int pos = instructions_->at(code->instruction_index())->position(); |
| 338 if (pos >=0) RecordPosition(pos); |
| 339 |
| 329 Comment(";;; <@%d,#%d> " | 340 Comment(";;; <@%d,#%d> " |
| 330 "-------------------- Deferred %s --------------------", | 341 "-------------------- Deferred %s --------------------", |
| 331 code->instruction_index(), | 342 code->instruction_index(), |
| 332 code->instr()->hydrogen_value()->id(), | 343 code->instr()->hydrogen_value()->id(), |
| 333 code->instr()->Mnemonic()); | 344 code->instr()->Mnemonic()); |
| 334 __ bind(code->entry()); | 345 __ bind(code->entry()); |
| 335 if (NeedsDeferredFrame()) { | 346 if (NeedsDeferredFrame()) { |
| 336 Comment(";;; Build frame"); | 347 Comment(";;; Build frame"); |
| 337 ASSERT(!frame_is_built_); | 348 ASSERT(!frame_is_built_); |
| 338 ASSERT(info()->IsStub()); | 349 ASSERT(info()->IsStub()); |
| (...skipping 5227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5566 FixedArray::kHeaderSize - kPointerSize)); | 5577 FixedArray::kHeaderSize - kPointerSize)); |
| 5567 __ bind(&done); | 5578 __ bind(&done); |
| 5568 } | 5579 } |
| 5569 | 5580 |
| 5570 | 5581 |
| 5571 #undef __ | 5582 #undef __ |
| 5572 | 5583 |
| 5573 } } // namespace v8::internal | 5584 } } // namespace v8::internal |
| 5574 | 5585 |
| 5575 #endif // V8_TARGET_ARCH_X64 | 5586 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |