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

Unified Diff: src/compiler/arm/code-generator-arm.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 | « no previous file | src/compiler/arm64/code-generator-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/arm/code-generator-arm.cc
diff --git a/src/compiler/arm/code-generator-arm.cc b/src/compiler/arm/code-generator-arm.cc
index 4c5b2924c58275d1a7fefccf29708956673d401f..21415c4dee6a9e85fd6440637d66f4b8e84b07d4 100644
--- a/src/compiler/arm/code-generator-arm.cc
+++ b/src/compiler/arm/code-generator-arm.cc
@@ -1018,17 +1018,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.
- __ ldr(dst, MemOperand(fp, 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.
- __ ldr(dst,
- MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
+ Heap::RootListIndex index;
+ int offset;
+ if (IsMaterializableFromFrame(src_object, &offset)) {
+ __ ldr(dst, MemOperand(fp, offset));
+ } else if (IsMaterializableFromRoot(src_object, &index)) {
+ __ LoadRoot(dst, index);
} else {
__ Move(dst, src_object);
}
« no previous file with comments | « no previous file | src/compiler/arm64/code-generator-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698