| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 | 445 |
| 446 void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { | 446 void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { |
| 447 object()->PrintTo(stream); | 447 object()->PrintTo(stream); |
| 448 stream->Add("["); | 448 stream->Add("["); |
| 449 key()->PrintTo(stream); | 449 key()->PrintTo(stream); |
| 450 stream->Add("] <- "); | 450 stream->Add("] <- "); |
| 451 value()->PrintTo(stream); | 451 value()->PrintTo(stream); |
| 452 } | 452 } |
| 453 | 453 |
| 454 | 454 |
| 455 void LTransitionElementsKind::PrintDataTo(StringStream* stream) { |
| 456 object()->PrintTo(stream); |
| 457 stream->Add(" %p -> %p", *original_map(), *transitioned_map()); |
| 458 } |
| 459 |
| 460 |
| 455 void LChunk::AddInstruction(LInstruction* instr, HBasicBlock* block) { | 461 void LChunk::AddInstruction(LInstruction* instr, HBasicBlock* block) { |
| 456 LInstructionGap* gap = new LInstructionGap(block); | 462 LInstructionGap* gap = new LInstructionGap(block); |
| 457 int index = -1; | 463 int index = -1; |
| 458 if (instr->IsControl()) { | 464 if (instr->IsControl()) { |
| 459 instructions_.Add(gap); | 465 instructions_.Add(gap); |
| 460 index = instructions_.length(); | 466 index = instructions_.length(); |
| 461 instructions_.Add(instr); | 467 instructions_.Add(instr); |
| 462 } else { | 468 } else { |
| 463 index = instructions_.length(); | 469 index = instructions_.length(); |
| 464 instructions_.Add(instr); | 470 instructions_.Add(instr); |
| (...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2026 ASSERT(instr->object()->representation().IsTagged()); | 2032 ASSERT(instr->object()->representation().IsTagged()); |
| 2027 ASSERT(instr->key()->representation().IsTagged()); | 2033 ASSERT(instr->key()->representation().IsTagged()); |
| 2028 ASSERT(instr->value()->representation().IsTagged()); | 2034 ASSERT(instr->value()->representation().IsTagged()); |
| 2029 | 2035 |
| 2030 LStoreKeyedGeneric* result = | 2036 LStoreKeyedGeneric* result = |
| 2031 new LStoreKeyedGeneric(context, object, key, value); | 2037 new LStoreKeyedGeneric(context, object, key, value); |
| 2032 return MarkAsCall(result, instr); | 2038 return MarkAsCall(result, instr); |
| 2033 } | 2039 } |
| 2034 | 2040 |
| 2035 | 2041 |
| 2042 LInstruction* LChunkBuilder::DoTransitionElementsKind( |
| 2043 HTransitionElementsKind* instr) { |
| 2044 if (instr->original_map()->elements_kind() == FAST_SMI_ONLY_ELEMENTS && |
| 2045 instr->transitioned_map()->elements_kind() == FAST_ELEMENTS) { |
| 2046 LOperand* object = UseRegister(instr->object()); |
| 2047 LOperand* new_map_reg = TempRegister(); |
| 2048 LOperand* temp_reg = TempRegister(); |
| 2049 LTransitionElementsKind* result = |
| 2050 new LTransitionElementsKind(object, new_map_reg, temp_reg); |
| 2051 return DefineSameAsFirst(result); |
| 2052 } else { |
| 2053 LOperand* object = UseFixed(instr->object(), eax); |
| 2054 LOperand* fixed_object_reg = FixedTemp(edx); |
| 2055 LOperand* new_map_reg = FixedTemp(ebx); |
| 2056 LTransitionElementsKind* result = |
| 2057 new LTransitionElementsKind(object, new_map_reg, fixed_object_reg); |
| 2058 return MarkAsCall(DefineFixed(result, eax), instr); |
| 2059 } |
| 2060 } |
| 2061 |
| 2062 |
| 2036 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { | 2063 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
| 2037 bool needs_write_barrier = instr->NeedsWriteBarrier(); | 2064 bool needs_write_barrier = instr->NeedsWriteBarrier(); |
| 2038 | 2065 |
| 2039 LOperand* obj; | 2066 LOperand* obj; |
| 2040 if (needs_write_barrier) { | 2067 if (needs_write_barrier) { |
| 2041 obj = instr->is_in_object() | 2068 obj = instr->is_in_object() |
| 2042 ? UseRegister(instr->object()) | 2069 ? UseRegister(instr->object()) |
| 2043 : UseTempRegister(instr->object()); | 2070 : UseTempRegister(instr->object()); |
| 2044 } else { | 2071 } else { |
| 2045 obj = UseRegisterAtStart(instr->object()); | 2072 obj = UseRegisterAtStart(instr->object()); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2278 LOperand* key = UseOrConstantAtStart(instr->key()); | 2305 LOperand* key = UseOrConstantAtStart(instr->key()); |
| 2279 LOperand* object = UseOrConstantAtStart(instr->object()); | 2306 LOperand* object = UseOrConstantAtStart(instr->object()); |
| 2280 LIn* result = new LIn(context, key, object); | 2307 LIn* result = new LIn(context, key, object); |
| 2281 return MarkAsCall(DefineFixed(result, eax), instr); | 2308 return MarkAsCall(DefineFixed(result, eax), instr); |
| 2282 } | 2309 } |
| 2283 | 2310 |
| 2284 | 2311 |
| 2285 } } // namespace v8::internal | 2312 } } // namespace v8::internal |
| 2286 | 2313 |
| 2287 #endif // V8_TARGET_ARCH_IA32 | 2314 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |