| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 cp, target.offset(), a0, a3, GetRAState(), kSaveFPRegs); | 236 cp, target.offset(), a0, a3, GetRAState(), kSaveFPRegs); |
| 237 } | 237 } |
| 238 } | 238 } |
| 239 Comment(";;; End allocate local context"); | 239 Comment(";;; End allocate local context"); |
| 240 } | 240 } |
| 241 | 241 |
| 242 // Trace the call. | 242 // Trace the call. |
| 243 if (FLAG_trace && info()->IsOptimizing()) { | 243 if (FLAG_trace && info()->IsOptimizing()) { |
| 244 __ CallRuntime(Runtime::kTraceEnter, 0); | 244 __ CallRuntime(Runtime::kTraceEnter, 0); |
| 245 } | 245 } |
| 246 EnsureSpaceForLazyDeopt(); | |
| 247 return !is_aborted(); | 246 return !is_aborted(); |
| 248 } | 247 } |
| 249 | 248 |
| 250 | 249 |
| 251 bool LCodeGen::GenerateBody() { | 250 bool LCodeGen::GenerateBody() { |
| 252 ASSERT(is_generating()); | 251 ASSERT(is_generating()); |
| 253 bool emit_instructions = true; | 252 bool emit_instructions = true; |
| 254 for (current_instruction_ = 0; | 253 for (current_instruction_ = 0; |
| 255 !is_aborted() && current_instruction_ < instructions_->length(); | 254 !is_aborted() && current_instruction_ < instructions_->length(); |
| 256 current_instruction_++) { | 255 current_instruction_++) { |
| 257 LInstruction* instr = instructions_->at(current_instruction_); | 256 LInstruction* instr = instructions_->at(current_instruction_); |
| 258 | 257 |
| 259 // Don't emit code for basic blocks with a replacement. | 258 // Don't emit code for basic blocks with a replacement. |
| 260 if (instr->IsLabel()) { | 259 if (instr->IsLabel()) { |
| 261 emit_instructions = !LLabel::cast(instr)->HasReplacement(); | 260 emit_instructions = !LLabel::cast(instr)->HasReplacement(); |
| 262 } | 261 } |
| 263 if (!emit_instructions) continue; | 262 if (!emit_instructions) continue; |
| 264 | 263 |
| 265 if (FLAG_code_comments && instr->HasInterestingComment(this)) { | 264 if (FLAG_code_comments && instr->HasInterestingComment(this)) { |
| 266 Comment(";;; <@%d,#%d> %s", | 265 Comment(";;; <@%d,#%d> %s", |
| 267 current_instruction_, | 266 current_instruction_, |
| 268 instr->hydrogen_value()->id(), | 267 instr->hydrogen_value()->id(), |
| 269 instr->Mnemonic()); | 268 instr->Mnemonic()); |
| 270 } | 269 } |
| 271 | 270 |
| 272 instr->CompileToNative(this); | 271 instr->CompileToNative(this); |
| 273 } | 272 } |
| 273 EnsureSpaceForLazyDeopt(); |
| 274 return !is_aborted(); | 274 return !is_aborted(); |
| 275 } | 275 } |
| 276 | 276 |
| 277 | 277 |
| 278 bool LCodeGen::GenerateDeferredCode() { | 278 bool LCodeGen::GenerateDeferredCode() { |
| 279 ASSERT(is_generating()); | 279 ASSERT(is_generating()); |
| 280 if (deferred_.length() > 0) { | 280 if (deferred_.length() > 0) { |
| 281 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { | 281 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { |
| 282 LDeferredCode* code = deferred_[i]; | 282 LDeferredCode* code = deferred_[i]; |
| 283 Comment(";;; <@%d,#%d> " | 283 Comment(";;; <@%d,#%d> " |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 RelocInfo::Mode mode, | 699 RelocInfo::Mode mode, |
| 700 LInstruction* instr) { | 700 LInstruction* instr) { |
| 701 CallCodeGeneric(code, mode, instr, RECORD_SIMPLE_SAFEPOINT); | 701 CallCodeGeneric(code, mode, instr, RECORD_SIMPLE_SAFEPOINT); |
| 702 } | 702 } |
| 703 | 703 |
| 704 | 704 |
| 705 void LCodeGen::CallCodeGeneric(Handle<Code> code, | 705 void LCodeGen::CallCodeGeneric(Handle<Code> code, |
| 706 RelocInfo::Mode mode, | 706 RelocInfo::Mode mode, |
| 707 LInstruction* instr, | 707 LInstruction* instr, |
| 708 SafepointMode safepoint_mode) { | 708 SafepointMode safepoint_mode) { |
| 709 EnsureSpaceForLazyDeopt(); |
| 709 ASSERT(instr != NULL); | 710 ASSERT(instr != NULL); |
| 710 LPointerMap* pointers = instr->pointer_map(); | 711 LPointerMap* pointers = instr->pointer_map(); |
| 711 RecordPosition(pointers->position()); | 712 RecordPosition(pointers->position()); |
| 712 __ Call(code, mode); | 713 __ Call(code, mode); |
| 713 RecordSafepointWithLazyDeopt(instr, safepoint_mode); | 714 RecordSafepointWithLazyDeopt(instr, safepoint_mode); |
| 714 } | 715 } |
| 715 | 716 |
| 716 | 717 |
| 717 void LCodeGen::CallRuntime(const Runtime::Function* function, | 718 void LCodeGen::CallRuntime(const Runtime::Function* function, |
| 718 int num_arguments, | 719 int num_arguments, |
| (...skipping 5200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5919 __ Subu(scratch, result, scratch); | 5920 __ Subu(scratch, result, scratch); |
| 5920 __ lw(result, FieldMemOperand(scratch, | 5921 __ lw(result, FieldMemOperand(scratch, |
| 5921 FixedArray::kHeaderSize - kPointerSize)); | 5922 FixedArray::kHeaderSize - kPointerSize)); |
| 5922 __ bind(&done); | 5923 __ bind(&done); |
| 5923 } | 5924 } |
| 5924 | 5925 |
| 5925 | 5926 |
| 5926 #undef __ | 5927 #undef __ |
| 5927 | 5928 |
| 5928 } } // namespace v8::internal | 5929 } } // namespace v8::internal |
| OLD | NEW |