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

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 22670004: Fix/unify root handling in code generation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/heap.h » ('j') | src/ia32/macro-assembler-ia32.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 } else { 368 } else {
369 usat(dst, satpos, src, cond); 369 usat(dst, satpos, src, cond);
370 } 370 }
371 } 371 }
372 372
373 373
374 void MacroAssembler::LoadRoot(Register destination, 374 void MacroAssembler::LoadRoot(Register destination,
375 Heap::RootListIndex index, 375 Heap::RootListIndex index,
376 Condition cond) { 376 Condition cond) {
377 if (CpuFeatures::IsSupported(MOVW_MOVT_IMMEDIATE_LOADS) && 377 if (CpuFeatures::IsSupported(MOVW_MOVT_IMMEDIATE_LOADS) &&
378 !Heap::RootCanBeWrittenAfterInitialization(index) && 378 isolate()->heap()->RootCanBeTreatedAsConstant(index) &&
379 !predictable_code_size()) { 379 !predictable_code_size()) {
380 Handle<Object> root(isolate()->heap()->roots_array_start()[index], 380 // The CPU supports fast immediate values, and this root will never
381 isolate()); 381 // change. We will load it as a relocatable immediate value.
382 if (!isolate()->heap()->InNewSpace(*root)) { 382 Handle<Object> root(&isolate()->heap()->roots_array_start()[index]);
383 // The CPU supports fast immediate values, and this root will never 383 mov(destination, Operand(root), LeaveCC, cond);
384 // change. We will load it as a relocatable immediate value. 384 return;
385 mov(destination, Operand(root), LeaveCC, cond);
386 return;
387 }
388 } 385 }
389 ldr(destination, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); 386 ldr(destination, MemOperand(kRootRegister, index << kPointerSizeLog2), cond);
390 } 387 }
391 388
392 389
393 void MacroAssembler::StoreRoot(Register source, 390 void MacroAssembler::StoreRoot(Register source,
394 Heap::RootListIndex index, 391 Heap::RootListIndex index,
395 Condition cond) { 392 Condition cond) {
396 str(source, MemOperand(kRootRegister, index << kPointerSizeLog2), cond); 393 str(source, MemOperand(kRootRegister, index << kPointerSizeLog2), cond);
397 } 394 }
(...skipping 3479 matching lines...) Expand 10 before | Expand all | Expand 10 after
3877 void CodePatcher::EmitCondition(Condition cond) { 3874 void CodePatcher::EmitCondition(Condition cond) {
3878 Instr instr = Assembler::instr_at(masm_.pc_); 3875 Instr instr = Assembler::instr_at(masm_.pc_);
3879 instr = (instr & ~kCondMask) | cond; 3876 instr = (instr & ~kCondMask) | cond;
3880 masm_.emit(instr); 3877 masm_.emit(instr);
3881 } 3878 }
3882 3879
3883 3880
3884 } } // namespace v8::internal 3881 } } // namespace v8::internal
3885 3882
3886 #endif // V8_TARGET_ARCH_ARM 3883 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/heap.h » ('j') | src/ia32/macro-assembler-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698