Chromium Code Reviews| 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 2039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2050 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { | 2050 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { |
| 2051 LOperand* context = UseFixed(instr->context(), esi); | 2051 LOperand* context = UseFixed(instr->context(), esi); |
| 2052 LOperand* left = UseOrConstantAtStart(instr->left()); | 2052 LOperand* left = UseOrConstantAtStart(instr->left()); |
| 2053 LOperand* right = UseOrConstantAtStart(instr->right()); | 2053 LOperand* right = UseOrConstantAtStart(instr->right()); |
| 2054 LStringAdd* string_add = new LStringAdd(context, left, right); | 2054 LStringAdd* string_add = new LStringAdd(context, left, right); |
| 2055 return MarkAsCall(DefineFixed(string_add, eax), instr); | 2055 return MarkAsCall(DefineFixed(string_add, eax), instr); |
| 2056 } | 2056 } |
| 2057 | 2057 |
| 2058 | 2058 |
| 2059 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { | 2059 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { |
| 2060 LOperand* string = UseRegister(instr->string()); | 2060 LOperand* string = UseTempRegister(instr->string()); |
|
Vitaly Repeshko
2011/08/12 19:01:00
We can use 3 instead of 4 registers if we give up
| |
| 2061 LOperand* index = UseRegisterOrConstant(instr->index()); | 2061 LOperand* index = UseRegisterOrConstant(instr->index()); |
| 2062 LOperand* context = UseAny(instr->context()); | 2062 LOperand* context = UseAny(instr->context()); |
| 2063 LStringCharCodeAt* result = new LStringCharCodeAt(context, string, index); | 2063 LOperand* temp = TempRegister(); |
| 2064 LStringCharCodeAt* result = new LStringCharCodeAt(context, string, | |
| 2065 index, temp); | |
| 2064 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); | 2066 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
| 2065 } | 2067 } |
| 2066 | 2068 |
| 2067 | 2069 |
| 2068 LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) { | 2070 LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) { |
| 2069 LOperand* char_code = UseRegister(instr->value()); | 2071 LOperand* char_code = UseRegister(instr->value()); |
| 2070 LOperand* context = UseAny(instr->context()); | 2072 LOperand* context = UseAny(instr->context()); |
| 2071 LStringCharFromCode* result = new LStringCharFromCode(context, char_code); | 2073 LStringCharFromCode* result = new LStringCharFromCode(context, char_code); |
| 2072 return AssignPointerMap(DefineAsRegister(result)); | 2074 return AssignPointerMap(DefineAsRegister(result)); |
| 2073 } | 2075 } |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2256 LOperand* key = UseOrConstantAtStart(instr->key()); | 2258 LOperand* key = UseOrConstantAtStart(instr->key()); |
| 2257 LOperand* object = UseOrConstantAtStart(instr->object()); | 2259 LOperand* object = UseOrConstantAtStart(instr->object()); |
| 2258 LIn* result = new LIn(context, key, object); | 2260 LIn* result = new LIn(context, key, object); |
| 2259 return MarkAsCall(DefineFixed(result, eax), instr); | 2261 return MarkAsCall(DefineFixed(result, eax), instr); |
| 2260 } | 2262 } |
| 2261 | 2263 |
| 2262 | 2264 |
| 2263 } } // namespace v8::internal | 2265 } } // namespace v8::internal |
| 2264 | 2266 |
| 2265 #endif // V8_TARGET_ARCH_IA32 | 2267 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |