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

Unified Diff: src/arm/macro-assembler-arm.cc

Issue 11307012: Use movw/movt on ARM to load constant roots (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/macro-assembler-arm.cc
===================================================================
--- src/arm/macro-assembler-arm.cc (revision 12826)
+++ src/arm/macro-assembler-arm.cc (working copy)
@@ -422,6 +422,17 @@
void MacroAssembler::LoadRoot(Register destination,
Heap::RootListIndex index,
Condition cond) {
+ if (CpuFeatures::IsSupported(MOVW_MOVT_IMMEDIATE_LOADS)) {
+ Handle<Object> root(isolate()->heap()->roots_array_start()[index]);
+ if (root->IsOddball() || root->IsMap() ||
danno 2012/10/29 15:05:39 Can you phrase this test as checking against a bla
+ index == Heap::kEmptyFixedArrayRootIndex ||
+ index == Heap::kSingleCharacterStringCacheRootIndex) {
+ // The CPU supports fast immediate values, and this root will never
+ // change. We will load it as a relocatable immediate value.
+ mov(destination, Operand(root), LeaveCC, cond);
+ return;
+ }
+ }
ldr(destination, MemOperand(kRootRegister, index << kPointerSizeLog2), cond);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698