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 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 return AssignEnvironment(result); | 2023 return AssignEnvironment(result); |
2024 } | 2024 } |
2025 | 2025 |
2026 | 2026 |
2027 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { | 2027 LInstruction* LChunkBuilder::DoCheckSmi(HCheckSmi* instr) { |
2028 LOperand* value = UseRegisterAtStart(instr->value()); | 2028 LOperand* value = UseRegisterAtStart(instr->value()); |
2029 return AssignEnvironment(new(zone()) LCheckSmi(value)); | 2029 return AssignEnvironment(new(zone()) LCheckSmi(value)); |
2030 } | 2030 } |
2031 | 2031 |
2032 | 2032 |
2033 LInstruction* LChunkBuilder::DoCheckSmiOrInt32(HCheckSmiOrInt32* instr) { | |
2034 LOperand* value = UseRegisterAtStart(instr->value()); | |
2035 return AssignEnvironment(new(zone()) LCheckSmi(value)); | |
2036 } | |
2037 | |
2038 | |
2039 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { | 2033 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { |
2040 LOperand* value = UseRegisterAtStart(instr->value()); | 2034 LOperand* value = UseRegisterAtStart(instr->value()); |
2041 return AssignEnvironment(new(zone()) LCheckFunction(value)); | 2035 return AssignEnvironment(new(zone()) LCheckFunction(value)); |
2042 } | 2036 } |
2043 | 2037 |
2044 | 2038 |
2045 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { | 2039 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { |
2046 LOperand* value = UseRegisterAtStart(instr->value()); | 2040 LOperand* value = UseRegisterAtStart(instr->value()); |
2047 LInstruction* result = new(zone()) LCheckMaps(value); | 2041 LInstruction* result = new(zone()) LCheckMaps(value); |
2048 return AssignEnvironment(result); | 2042 return AssignEnvironment(result); |
(...skipping 24 matching lines...) Expand all Loading... |
2073 parameter_count); | 2067 parameter_count); |
2074 } | 2068 } |
2075 | 2069 |
2076 | 2070 |
2077 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { | 2071 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { |
2078 Representation r = instr->representation(); | 2072 Representation r = instr->representation(); |
2079 if (r.IsInteger32()) { | 2073 if (r.IsInteger32()) { |
2080 return DefineAsRegister(new(zone()) LConstantI); | 2074 return DefineAsRegister(new(zone()) LConstantI); |
2081 } else if (r.IsDouble()) { | 2075 } else if (r.IsDouble()) { |
2082 return DefineAsRegister(new(zone()) LConstantD); | 2076 return DefineAsRegister(new(zone()) LConstantD); |
2083 } else if (r.IsTagged() || r.IsSmi()) { | 2077 } else if (r.IsSmiOrTagged()) { |
2084 return DefineAsRegister(new(zone()) LConstantT); | 2078 return DefineAsRegister(new(zone()) LConstantT); |
2085 } else { | 2079 } else { |
2086 UNREACHABLE(); | 2080 UNREACHABLE(); |
2087 return NULL; | 2081 return NULL; |
2088 } | 2082 } |
2089 } | 2083 } |
2090 | 2084 |
2091 | 2085 |
2092 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { | 2086 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { |
2093 LLoadGlobalCell* result = new(zone()) LLoadGlobalCell; | 2087 LLoadGlobalCell* result = new(zone()) LLoadGlobalCell; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2185 | 2179 |
2186 LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( | 2180 LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( |
2187 HLoadExternalArrayPointer* instr) { | 2181 HLoadExternalArrayPointer* instr) { |
2188 LOperand* input = UseRegisterAtStart(instr->value()); | 2182 LOperand* input = UseRegisterAtStart(instr->value()); |
2189 return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); | 2183 return DefineAsRegister(new(zone()) LLoadExternalArrayPointer(input)); |
2190 } | 2184 } |
2191 | 2185 |
2192 | 2186 |
2193 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { | 2187 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { |
2194 ASSERT(instr->key()->representation().IsInteger32() || | 2188 ASSERT(instr->key()->representation().IsInteger32() || |
2195 instr->key()->representation().IsTagged()); | 2189 instr->key()->representation().IsSmi()); |
2196 ElementsKind elements_kind = instr->elements_kind(); | 2190 ElementsKind elements_kind = instr->elements_kind(); |
2197 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 2191 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
2198 LLoadKeyed* result = NULL; | 2192 LLoadKeyed* result = NULL; |
2199 | 2193 |
2200 if (!instr->is_external()) { | 2194 if (!instr->is_external()) { |
2201 LOperand* obj = NULL; | 2195 LOperand* obj = NULL; |
2202 if (instr->representation().IsDouble()) { | 2196 if (instr->representation().IsDouble()) { |
2203 obj = UseTempRegister(instr->elements()); | 2197 obj = UseTempRegister(instr->elements()); |
2204 } else { | 2198 } else { |
2205 ASSERT(instr->representation().IsSmiOrTagged()); | 2199 ASSERT(instr->representation().IsSmiOrTagged()); |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2646 | 2640 |
2647 | 2641 |
2648 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2642 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2649 LOperand* object = UseRegister(instr->object()); | 2643 LOperand* object = UseRegister(instr->object()); |
2650 LOperand* index = UseRegister(instr->index()); | 2644 LOperand* index = UseRegister(instr->index()); |
2651 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2645 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2652 } | 2646 } |
2653 | 2647 |
2654 | 2648 |
2655 } } // namespace v8::internal | 2649 } } // namespace v8::internal |
OLD | NEW |