| 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   361   stream->Add(" length "); |   361   stream->Add(" length "); | 
|   362   length()->PrintTo(stream); |   362   length()->PrintTo(stream); | 
|   363  |   363  | 
|   364   stream->Add(" index "); |   364   stream->Add(" index "); | 
|   365   index()->PrintTo(stream); |   365   index()->PrintTo(stream); | 
|   366 } |   366 } | 
|   367  |   367  | 
|   368  |   368  | 
|   369 int LChunk::GetNextSpillIndex(bool is_double) { |   369 int LChunk::GetNextSpillIndex(bool is_double) { | 
|   370   // Skip a slot if for a double-width slot. |   370   // Skip a slot if for a double-width slot. | 
|   371   if (is_double) spill_slot_count_++; |   371   if (is_double) { | 
 |   372     spill_slot_count_ |= 1; | 
 |   373     spill_slot_count_++; | 
 |   374     num_double_slots_++; | 
 |   375   } | 
|   372   return spill_slot_count_++; |   376   return spill_slot_count_++; | 
|   373 } |   377 } | 
|   374  |   378  | 
|   375  |   379  | 
|   376 LOperand* LChunk::GetNextSpillSlot(bool is_double) { |   380 LOperand* LChunk::GetNextSpillSlot(bool is_double) { | 
|   377   int index = GetNextSpillIndex(is_double); |   381   int index = GetNextSpillIndex(is_double); | 
|   378   if (is_double) { |   382   if (is_double) { | 
|   379     return LDoubleStackSlot::Create(index); |   383     return LDoubleStackSlot::Create(index); | 
|   380   } else { |   384   } else { | 
|   381     return LStackSlot::Create(index); |   385     return LStackSlot::Create(index); | 
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   542     LConstantOperand* operand) const { |   546     LConstantOperand* operand) const { | 
|   543   return graph_->LookupValue(operand->index())->representation(); |   547   return graph_->LookupValue(operand->index())->representation(); | 
|   544 } |   548 } | 
|   545  |   549  | 
|   546  |   550  | 
|   547 LChunk* LChunkBuilder::Build() { |   551 LChunk* LChunkBuilder::Build() { | 
|   548   ASSERT(is_unused()); |   552   ASSERT(is_unused()); | 
|   549   chunk_ = new(zone()) LChunk(info(), graph()); |   553   chunk_ = new(zone()) LChunk(info(), graph()); | 
|   550   HPhase phase("L_Building chunk", chunk_); |   554   HPhase phase("L_Building chunk", chunk_); | 
|   551   status_ = BUILDING; |   555   status_ = BUILDING; | 
 |   556  | 
 |   557   // Reserve the first spill slot for the state of dynamic alignment. | 
 |   558   int alignment_state_index = chunk_->GetNextSpillIndex(false); | 
 |   559   ASSERT_EQ(alignment_marker_index, 0); | 
 |   560   USE(alignment_state_index); | 
 |   561  | 
|   552   const ZoneList<HBasicBlock*>* blocks = graph()->blocks(); |   562   const ZoneList<HBasicBlock*>* blocks = graph()->blocks(); | 
|   553   for (int i = 0; i < blocks->length(); i++) { |   563   for (int i = 0; i < blocks->length(); i++) { | 
|   554     HBasicBlock* next = NULL; |   564     HBasicBlock* next = NULL; | 
|   555     if (i < blocks->length() - 1) next = blocks->at(i + 1); |   565     if (i < blocks->length() - 1) next = blocks->at(i + 1); | 
|   556     DoBasicBlock(blocks->at(i), next); |   566     DoBasicBlock(blocks->at(i), next); | 
|   557     if (is_aborted()) return NULL; |   567     if (is_aborted()) return NULL; | 
|   558   } |   568   } | 
|   559   status_ = DONE; |   569   status_ = DONE; | 
|   560   return chunk_; |   570   return chunk_; | 
|   561 } |   571 } | 
| (...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2438 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |  2448 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 
|  2439   LOperand* object = UseRegister(instr->object()); |  2449   LOperand* object = UseRegister(instr->object()); | 
|  2440   LOperand* index = UseTempRegister(instr->index()); |  2450   LOperand* index = UseTempRegister(instr->index()); | 
|  2441   return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |  2451   return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 
|  2442 } |  2452 } | 
|  2443  |  2453  | 
|  2444  |  2454  | 
|  2445 } }  // namespace v8::internal |  2455 } }  // namespace v8::internal | 
|  2446  |  2456  | 
|  2447 #endif  // V8_TARGET_ARCH_IA32 |  2457 #endif  // V8_TARGET_ARCH_IA32 | 
| OLD | NEW |