OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 #include "src/compiler/code-generator-impl.h" | 6 #include "src/compiler/code-generator-impl.h" |
7 #include "src/compiler/gap-resolver.h" | 7 #include "src/compiler/gap-resolver.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/mips/macro-assembler-mips.h" | 9 #include "src/mips/macro-assembler-mips.h" |
10 #include "src/scopes.h" | 10 #include "src/scopes.h" |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 __ li(dst, Operand(src.ToInt64())); | 1199 __ li(dst, Operand(src.ToInt64())); |
1200 break; | 1200 break; |
1201 case Constant::kFloat64: | 1201 case Constant::kFloat64: |
1202 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); | 1202 __ li(dst, isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); |
1203 break; | 1203 break; |
1204 case Constant::kExternalReference: | 1204 case Constant::kExternalReference: |
1205 __ li(dst, Operand(src.ToExternalReference())); | 1205 __ li(dst, Operand(src.ToExternalReference())); |
1206 break; | 1206 break; |
1207 case Constant::kHeapObject: { | 1207 case Constant::kHeapObject: { |
1208 Handle<HeapObject> src_object = src.ToHeapObject(); | 1208 Handle<HeapObject> src_object = src.ToHeapObject(); |
1209 if (info()->IsOptimizing() && | 1209 Heap::RootListIndex index; |
1210 src_object.is_identical_to(info()->context())) { | 1210 int offset; |
1211 // Loading the context from the frame is way cheaper than | 1211 if (IsMaterializableFromFrame(src_object, &offset)) { |
1212 // materializing the actual context heap object address. | 1212 __ ld(dst, MemOperand(fp, offset)); |
1213 __ ld(dst, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 1213 } else if (IsMaterializableFromRoot(src_object, &index)) { |
1214 } else if (info()->IsOptimizing() && | 1214 __ LoadRoot(dst, index); |
1215 src_object.is_identical_to(info()->closure())) { | |
1216 // Loading the JSFunction from the frame is way cheaper than | |
1217 // materializing the actual JSFunction heap object address. | |
1218 __ ld(dst, | |
1219 MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | |
1220 } else { | 1215 } else { |
1221 __ li(dst, src_object); | 1216 __ li(dst, src_object); |
1222 } | 1217 } |
1223 break; | 1218 break; |
1224 } | 1219 } |
1225 case Constant::kRpoNumber: | 1220 case Constant::kRpoNumber: |
1226 UNREACHABLE(); // TODO(titzer): loading RPO numbers on mips64. | 1221 UNREACHABLE(); // TODO(titzer): loading RPO numbers on mips64. |
1227 break; | 1222 break; |
1228 } | 1223 } |
1229 if (destination->IsStackSlot()) __ sd(dst, g.ToMemOperand(destination)); | 1224 if (destination->IsStackSlot()) __ sd(dst, g.ToMemOperand(destination)); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 } | 1365 } |
1371 } | 1366 } |
1372 MarkLazyDeoptSite(); | 1367 MarkLazyDeoptSite(); |
1373 } | 1368 } |
1374 | 1369 |
1375 #undef __ | 1370 #undef __ |
1376 | 1371 |
1377 } // namespace compiler | 1372 } // namespace compiler |
1378 } // namespace internal | 1373 } // namespace internal |
1379 } // namespace v8 | 1374 } // namespace v8 |
OLD | NEW |