OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2040 Abort("LoadPrototype unimplemented."); | 2040 Abort("LoadPrototype unimplemented."); |
2041 } | 2041 } |
2042 | 2042 |
2043 | 2043 |
2044 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 2044 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
2045 Abort("DoCheckPrototypeMaps unimplemented."); | 2045 Abort("DoCheckPrototypeMaps unimplemented."); |
2046 } | 2046 } |
2047 | 2047 |
2048 | 2048 |
2049 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { | 2049 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { |
2050 Abort("DoArrayLiteral unimplemented."); | 2050 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 2051 __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); |
| 2052 __ mov(r2, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); |
| 2053 __ mov(r1, Operand(instr->hydrogen()->constant_elements())); |
| 2054 __ Push(r3, r2, r1); |
| 2055 |
| 2056 // Pick the right runtime function or stub to call. |
| 2057 int length = instr->hydrogen()->length(); |
| 2058 if (instr->hydrogen()->IsCopyOnWrite()) { |
| 2059 ASSERT(instr->hydrogen()->depth() == 1); |
| 2060 FastCloneShallowArrayStub::Mode mode = |
| 2061 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS; |
| 2062 FastCloneShallowArrayStub stub(mode, length); |
| 2063 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 2064 } else if (instr->hydrogen()->depth() > 1) { |
| 2065 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr); |
| 2066 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
| 2067 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); |
| 2068 } else { |
| 2069 FastCloneShallowArrayStub::Mode mode = |
| 2070 FastCloneShallowArrayStub::CLONE_ELEMENTS; |
| 2071 FastCloneShallowArrayStub stub(mode, length); |
| 2072 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 2073 } |
2051 } | 2074 } |
2052 | 2075 |
2053 | 2076 |
2054 void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) { | 2077 void LCodeGen::DoObjectLiteral(LObjectLiteral* instr) { |
2055 Abort("DoObjectLiteral unimplemented."); | 2078 Abort("DoObjectLiteral unimplemented."); |
2056 } | 2079 } |
2057 | 2080 |
2058 | 2081 |
2059 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { | 2082 void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) { |
2060 Abort("DoRegExpLiteral unimplemented."); | 2083 Abort("DoRegExpLiteral unimplemented."); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2204 | 2227 |
2205 | 2228 |
2206 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 2229 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
2207 Abort("DoOsrEntry unimplemented."); | 2230 Abort("DoOsrEntry unimplemented."); |
2208 } | 2231 } |
2209 | 2232 |
2210 | 2233 |
2211 #undef __ | 2234 #undef __ |
2212 | 2235 |
2213 } } // namespace v8::internal | 2236 } } // namespace v8::internal |
OLD | NEW |