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 | 6 |
7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/ppc/macro-assembler-ppc.h" | 10 #include "src/ppc/macro-assembler-ppc.h" |
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 __ Move(dst, | 1341 __ Move(dst, |
1342 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); | 1342 isolate()->factory()->NewNumber(src.ToFloat32(), TENURED)); |
1343 break; | 1343 break; |
1344 case Constant::kFloat64: | 1344 case Constant::kFloat64: |
1345 __ Move(dst, | 1345 __ Move(dst, |
1346 isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); | 1346 isolate()->factory()->NewNumber(src.ToFloat64(), TENURED)); |
1347 break; | 1347 break; |
1348 case Constant::kExternalReference: | 1348 case Constant::kExternalReference: |
1349 __ mov(dst, Operand(src.ToExternalReference())); | 1349 __ mov(dst, Operand(src.ToExternalReference())); |
1350 break; | 1350 break; |
1351 case Constant::kHeapObject: | 1351 case Constant::kHeapObject: { |
1352 __ Move(dst, src.ToHeapObject()); | 1352 Handle<HeapObject> src_object = src.ToHeapObject(); |
| 1353 if (info()->IsOptimizing() && |
| 1354 src_object.is_identical_to(info()->context())) { |
| 1355 // Loading the context from the frame is way cheaper than |
| 1356 // materializing the actual context heap object address. |
| 1357 __ LoadP(dst, |
| 1358 MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 1359 } else if (info()->IsOptimizing() && |
| 1360 src_object.is_identical_to(info()->closure())) { |
| 1361 // Loading the JSFunction from the frame is way cheaper than |
| 1362 // materializing the actual JSFunction heap object address. |
| 1363 __ LoadP(dst, |
| 1364 MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1365 } else { |
| 1366 __ Move(dst, src_object); |
| 1367 } |
1353 break; | 1368 break; |
| 1369 } |
1354 case Constant::kRpoNumber: | 1370 case Constant::kRpoNumber: |
1355 UNREACHABLE(); // TODO(dcarney): loading RPO constants on PPC. | 1371 UNREACHABLE(); // TODO(dcarney): loading RPO constants on PPC. |
1356 break; | 1372 break; |
1357 } | 1373 } |
1358 if (destination->IsStackSlot()) { | 1374 if (destination->IsStackSlot()) { |
1359 __ StoreP(dst, g.ToMemOperand(destination), r0); | 1375 __ StoreP(dst, g.ToMemOperand(destination), r0); |
1360 } | 1376 } |
1361 } else { | 1377 } else { |
1362 DoubleRegister dst = destination->IsDoubleRegister() | 1378 DoubleRegister dst = destination->IsDoubleRegister() |
1363 ? g.ToDoubleRegister(destination) | 1379 ? g.ToDoubleRegister(destination) |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 } | 1507 } |
1492 } | 1508 } |
1493 MarkLazyDeoptSite(); | 1509 MarkLazyDeoptSite(); |
1494 } | 1510 } |
1495 | 1511 |
1496 #undef __ | 1512 #undef __ |
1497 | 1513 |
1498 } // namespace compiler | 1514 } // namespace compiler |
1499 } // namespace internal | 1515 } // namespace internal |
1500 } // namespace v8 | 1516 } // namespace v8 |
OLD | NEW |