Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Unified Diff: src/compiler/x64/code-generator-x64.cc

Issue 1088913002: [turbofan] Load immortal heap objects from the heap roots. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/x64/code-generator-x64.cc
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc
index 4213c9f135131957dc51e93505a2b7f4444df20f..f4b90e92624750a8148953cb0dd27dcabfcd62ee 100644
--- a/src/compiler/x64/code-generator-x64.cc
+++ b/src/compiler/x64/code-generator-x64.cc
@@ -1531,17 +1531,12 @@ void CodeGenerator::AssembleMove(InstructionOperand* source,
break;
case Constant::kHeapObject: {
Handle<HeapObject> src_object = src.ToHeapObject();
- if (info()->IsOptimizing() &&
- src_object.is_identical_to(info()->context())) {
- // Loading the context from the frame is way cheaper than
- // materializing the actual context heap object address.
- __ movp(dst, Operand(rbp, StandardFrameConstants::kContextOffset));
- } else if (info()->IsOptimizing() &&
- src_object.is_identical_to(info()->closure())) {
- // Loading the JSFunction from the frame is way cheaper than
- // materializing the actual JSFunction heap object address.
- __ movp(dst,
- Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
+ Heap::RootListIndex index;
+ int offset;
+ if (IsMaterializableFromFrame(src_object, &offset)) {
+ __ movp(dst, Operand(rbp, offset));
+ } else if (IsMaterializableFromRoot(src_object, &index)) {
+ __ LoadRoot(dst, index);
} else {
__ Move(dst, src_object);
}
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698