| 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 // incoming context. | 323 // incoming context. |
| 324 __ CallRuntime(Runtime::kTraceEnter, 0); | 324 __ CallRuntime(Runtime::kTraceEnter, 0); |
| 325 } | 325 } |
| 326 return !is_aborted(); | 326 return !is_aborted(); |
| 327 } | 327 } |
| 328 | 328 |
| 329 | 329 |
| 330 bool LCodeGen::GenerateBody() { | 330 bool LCodeGen::GenerateBody() { |
| 331 ASSERT(is_generating()); | 331 ASSERT(is_generating()); |
| 332 bool emit_instructions = true; | 332 bool emit_instructions = true; |
| 333 int old_position = RelocInfo::kNoPosition; |
| 333 for (current_instruction_ = 0; | 334 for (current_instruction_ = 0; |
| 334 !is_aborted() && current_instruction_ < instructions_->length(); | 335 !is_aborted() && current_instruction_ < instructions_->length(); |
| 335 current_instruction_++) { | 336 current_instruction_++) { |
| 336 LInstruction* instr = instructions_->at(current_instruction_); | 337 LInstruction* instr = instructions_->at(current_instruction_); |
| 337 | 338 |
| 338 // Don't emit code for basic blocks with a replacement. | 339 // Don't emit code for basic blocks with a replacement. |
| 339 if (instr->IsLabel()) { | 340 if (instr->IsLabel()) { |
| 340 emit_instructions = !LLabel::cast(instr)->HasReplacement(); | 341 emit_instructions = !LLabel::cast(instr)->HasReplacement(); |
| 341 } | 342 } |
| 342 if (!emit_instructions) continue; | 343 if (!emit_instructions) continue; |
| 343 | 344 |
| 344 if (FLAG_code_comments && instr->HasInterestingComment(this)) { | 345 if (FLAG_code_comments && instr->HasInterestingComment(this)) { |
| 345 Comment(";;; <@%d,#%d> %s", | 346 Comment(";;; <@%d,#%d> %s", |
| 346 current_instruction_, | 347 current_instruction_, |
| 347 instr->hydrogen_value()->id(), | 348 instr->hydrogen_value()->id(), |
| 348 instr->Mnemonic()); | 349 instr->Mnemonic()); |
| 349 } | 350 } |
| 350 | 351 |
| 351 if (!CpuFeatures::IsSupported(SSE2)) FlushX87StackIfNecessary(instr); | 352 if (!CpuFeatures::IsSupported(SSE2)) FlushX87StackIfNecessary(instr); |
| 352 | 353 |
| 354 int pos = instr->position(); |
| 355 if (pos >= 0 && pos != old_position) { |
| 356 RecordPosition(pos); |
| 357 old_position = pos; |
| 358 } |
| 359 |
| 353 instr->CompileToNative(this); | 360 instr->CompileToNative(this); |
| 354 | 361 |
| 355 if (!CpuFeatures::IsSupported(SSE2)) { | 362 if (!CpuFeatures::IsSupported(SSE2)) { |
| 356 if (FLAG_debug_code && FLAG_enable_slow_asserts) { | 363 if (FLAG_debug_code && FLAG_enable_slow_asserts) { |
| 357 __ VerifyX87StackDepth(x87_stack_depth_); | 364 __ VerifyX87StackDepth(x87_stack_depth_); |
| 358 } | 365 } |
| 359 } | 366 } |
| 360 } | 367 } |
| 361 EnsureSpaceForLazyDeopt(); | 368 EnsureSpaceForLazyDeopt(); |
| 362 return !is_aborted(); | 369 return !is_aborted(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 } | 417 } |
| 411 return !is_aborted(); | 418 return !is_aborted(); |
| 412 } | 419 } |
| 413 | 420 |
| 414 | 421 |
| 415 bool LCodeGen::GenerateDeferredCode() { | 422 bool LCodeGen::GenerateDeferredCode() { |
| 416 ASSERT(is_generating()); | 423 ASSERT(is_generating()); |
| 417 if (deferred_.length() > 0) { | 424 if (deferred_.length() > 0) { |
| 418 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { | 425 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { |
| 419 LDeferredCode* code = deferred_[i]; | 426 LDeferredCode* code = deferred_[i]; |
| 427 |
| 428 int pos = instructions_->at(code->instruction_index())->position(); |
| 429 if (pos >=0) RecordPosition(pos); |
| 430 |
| 420 Comment(";;; <@%d,#%d> " | 431 Comment(";;; <@%d,#%d> " |
| 421 "-------------------- Deferred %s --------------------", | 432 "-------------------- Deferred %s --------------------", |
| 422 code->instruction_index(), | 433 code->instruction_index(), |
| 423 code->instr()->hydrogen_value()->id(), | 434 code->instr()->hydrogen_value()->id(), |
| 424 code->instr()->Mnemonic()); | 435 code->instr()->Mnemonic()); |
| 425 __ bind(code->entry()); | 436 __ bind(code->entry()); |
| 426 if (NeedsDeferredFrame()) { | 437 if (NeedsDeferredFrame()) { |
| 427 Comment(";;; Build frame"); | 438 Comment(";;; Build frame"); |
| 428 ASSERT(!frame_is_built_); | 439 ASSERT(!frame_is_built_); |
| 429 ASSERT(info()->IsStub()); | 440 ASSERT(info()->IsStub()); |
| (...skipping 6083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6513 FixedArray::kHeaderSize - kPointerSize)); | 6524 FixedArray::kHeaderSize - kPointerSize)); |
| 6514 __ bind(&done); | 6525 __ bind(&done); |
| 6515 } | 6526 } |
| 6516 | 6527 |
| 6517 | 6528 |
| 6518 #undef __ | 6529 #undef __ |
| 6519 | 6530 |
| 6520 } } // namespace v8::internal | 6531 } } // namespace v8::internal |
| 6521 | 6532 |
| 6522 #endif // V8_TARGET_ARCH_IA32 | 6533 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |