| 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 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 LOperand* value = UseAtStart(instr->value()); | 1856 LOperand* value = UseAtStart(instr->value()); |
| 1857 return AssignEnvironment(new(zone()) LCheckSmi(value)); | 1857 return AssignEnvironment(new(zone()) LCheckSmi(value)); |
| 1858 } | 1858 } |
| 1859 | 1859 |
| 1860 | 1860 |
| 1861 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { | 1861 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { |
| 1862 // If the target is in new space, we'll emit a global cell compare and so | 1862 // If the target is in new space, we'll emit a global cell compare and so |
| 1863 // want the value in a register. If the target gets promoted before we | 1863 // want the value in a register. If the target gets promoted before we |
| 1864 // emit code, we will still get the register but will do an immediate | 1864 // emit code, we will still get the register but will do an immediate |
| 1865 // compare instead of the cell compare. This is safe. | 1865 // compare instead of the cell compare. This is safe. |
| 1866 LOperand* value = Isolate::Current()->heap()->InNewSpace(*instr->target()) | 1866 LOperand* value = instr->target_in_new_space() |
| 1867 ? UseRegisterAtStart(instr->value()) | 1867 ? UseRegisterAtStart(instr->value()) : UseAtStart(instr->value()); |
| 1868 : UseAtStart(instr->value()); | |
| 1869 return AssignEnvironment(new(zone()) LCheckFunction(value)); | 1868 return AssignEnvironment(new(zone()) LCheckFunction(value)); |
| 1870 } | 1869 } |
| 1871 | 1870 |
| 1872 | 1871 |
| 1873 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { | 1872 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { |
| 1874 LOperand* value = UseRegisterAtStart(instr->value()); | 1873 LOperand* value = UseRegisterAtStart(instr->value()); |
| 1875 LCheckMaps* result = new(zone()) LCheckMaps(value); | 1874 LCheckMaps* result = new(zone()) LCheckMaps(value); |
| 1876 return AssignEnvironment(result); | 1875 return AssignEnvironment(result); |
| 1877 } | 1876 } |
| 1878 | 1877 |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2153 ASSERT(instr->value()->representation().IsTagged()); | 2152 ASSERT(instr->value()->representation().IsTagged()); |
| 2154 | 2153 |
| 2155 LStoreKeyedGeneric* result = | 2154 LStoreKeyedGeneric* result = |
| 2156 new(zone()) LStoreKeyedGeneric(context, object, key, value); | 2155 new(zone()) LStoreKeyedGeneric(context, object, key, value); |
| 2157 return MarkAsCall(result, instr); | 2156 return MarkAsCall(result, instr); |
| 2158 } | 2157 } |
| 2159 | 2158 |
| 2160 | 2159 |
| 2161 LInstruction* LChunkBuilder::DoTransitionElementsKind( | 2160 LInstruction* LChunkBuilder::DoTransitionElementsKind( |
| 2162 HTransitionElementsKind* instr) { | 2161 HTransitionElementsKind* instr) { |
| 2163 ElementsKind from_kind = instr->original_map()->elements_kind(); | 2162 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { |
| 2164 ElementsKind to_kind = instr->transitioned_map()->elements_kind(); | |
| 2165 if (IsSimpleMapChangeTransition(from_kind, to_kind)) { | |
| 2166 LOperand* object = UseRegister(instr->object()); | 2163 LOperand* object = UseRegister(instr->object()); |
| 2167 LOperand* new_map_reg = TempRegister(); | 2164 LOperand* new_map_reg = TempRegister(); |
| 2168 LOperand* temp_reg = TempRegister(); | 2165 LOperand* temp_reg = TempRegister(); |
| 2169 LTransitionElementsKind* result = | 2166 LTransitionElementsKind* result = |
| 2170 new(zone()) LTransitionElementsKind(object, new_map_reg, temp_reg); | 2167 new(zone()) LTransitionElementsKind(object, new_map_reg, temp_reg); |
| 2171 return DefineSameAsFirst(result); | 2168 return DefineSameAsFirst(result); |
| 2172 } else { | 2169 } else { |
| 2173 LOperand* object = UseFixed(instr->object(), eax); | 2170 LOperand* object = UseFixed(instr->object(), eax); |
| 2174 LOperand* fixed_object_reg = FixedTemp(edx); | 2171 LOperand* fixed_object_reg = FixedTemp(edx); |
| 2175 LOperand* new_map_reg = FixedTemp(ebx); | 2172 LOperand* new_map_reg = FixedTemp(ebx); |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2444 } | 2441 } |
| 2445 | 2442 |
| 2446 | 2443 |
| 2447 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { | 2444 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { |
| 2448 HEnvironment* outer = current_block_->last_environment(); | 2445 HEnvironment* outer = current_block_->last_environment(); |
| 2449 HConstant* undefined = graph()->GetConstantUndefined(); | 2446 HConstant* undefined = graph()->GetConstantUndefined(); |
| 2450 HEnvironment* inner = outer->CopyForInlining(instr->closure(), | 2447 HEnvironment* inner = outer->CopyForInlining(instr->closure(), |
| 2451 instr->arguments_count(), | 2448 instr->arguments_count(), |
| 2452 instr->function(), | 2449 instr->function(), |
| 2453 undefined, | 2450 undefined, |
| 2454 instr->call_kind(), | 2451 instr->inlining_kind(), |
| 2455 instr->inlining_kind()); | 2452 instr->undefined_receiver()); |
| 2456 if (instr->arguments_var() != NULL) { | 2453 if (instr->arguments_var() != NULL) { |
| 2457 inner->Bind(instr->arguments_var(), graph()->GetArgumentsObject()); | 2454 inner->Bind(instr->arguments_var(), graph()->GetArgumentsObject()); |
| 2458 } | 2455 } |
| 2459 inner->set_entry(instr); | 2456 inner->set_entry(instr); |
| 2460 current_block_->UpdateEnvironment(inner); | 2457 current_block_->UpdateEnvironment(inner); |
| 2461 chunk_->AddInlinedClosure(instr->closure()); | 2458 chunk_->AddInlinedClosure(instr->closure()); |
| 2462 return NULL; | 2459 return NULL; |
| 2463 } | 2460 } |
| 2464 | 2461 |
| 2465 | 2462 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2515 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2512 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2516 LOperand* object = UseRegister(instr->object()); | 2513 LOperand* object = UseRegister(instr->object()); |
| 2517 LOperand* index = UseTempRegister(instr->index()); | 2514 LOperand* index = UseTempRegister(instr->index()); |
| 2518 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2515 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2519 } | 2516 } |
| 2520 | 2517 |
| 2521 | 2518 |
| 2522 } } // namespace v8::internal | 2519 } } // namespace v8::internal |
| 2523 | 2520 |
| 2524 #endif // V8_TARGET_ARCH_IA32 | 2521 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |