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

Unified Diff: src/x64/builtins-x64.cc

Issue 174639: Use a root array register for constant loads and stack guards on x64.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap.cc ('k') | src/x64/cfg-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/builtins-x64.cc
===================================================================
--- src/x64/builtins-x64.cc (revision 2780)
+++ src/x64/builtins-x64.cc (working copy)
@@ -139,9 +139,7 @@
// Fill remaining expected arguments with undefined values.
Label fill;
- __ movq(kScratchRegister,
- Factory::undefined_value(),
- RelocInfo::EMBEDDED_OBJECT);
+ __ LoadRoot(kScratchRegister, Heap::kUndefinedValueRootIndex);
__ bind(&fill);
__ incq(rcx);
__ push(kScratchRegister);
@@ -218,9 +216,9 @@
__ testl(rbx, Immediate(kSmiTagMask));
__ j(zero, &call_to_object);
- __ Cmp(rbx, Factory::null_value());
+ __ CompareRoot(rbx, Heap::kNullValueRootIndex);
__ j(equal, &use_global_receiver);
- __ Cmp(rbx, Factory::undefined_value());
+ __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex);
__ j(equal, &use_global_receiver);
__ CmpObjectType(rbx, FIRST_JS_OBJECT_TYPE, rcx);
@@ -386,9 +384,9 @@
__ movq(rbx, Operand(rbp, kReceiverOffset));
__ testl(rbx, Immediate(kSmiTagMask));
__ j(zero, &call_to_object);
- __ Cmp(rbx, Factory::null_value());
+ __ CompareRoot(rbx, Heap::kNullValueRootIndex);
__ j(equal, &use_global_receiver);
- __ Cmp(rbx, Factory::undefined_value());
+ __ CompareRoot(rbx, Heap::kUndefinedValueRootIndex);
__ j(equal, &use_global_receiver);
// If given receiver is already a JavaScript object then there's no
@@ -548,7 +546,7 @@
// rbx: JSObject (not HeapObject tagged - the actual address).
// rdi: start of next object
__ movq(Operand(rbx, JSObject::kMapOffset), rax);
- __ Move(rcx, Factory::empty_fixed_array());
+ __ LoadRoot(rcx, Heap::kEmptyFixedArrayRootIndex);
__ movq(Operand(rbx, JSObject::kPropertiesOffset), rcx);
__ movq(Operand(rbx, JSObject::kElementsOffset), rcx);
// Set extra fields in the newly allocated object.
@@ -556,7 +554,7 @@
// rbx: JSObject
// rdi: start of next object
{ Label loop, entry;
- __ Move(rdx, Factory::undefined_value());
+ __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
__ lea(rcx, Operand(rbx, JSObject::kHeaderSize));
__ jmp(&entry);
__ bind(&loop);
@@ -613,7 +611,7 @@
// rdi: FixedArray
// rdx: number of elements
// rax: start of next object
- __ Move(rcx, Factory::fixed_array_map());
+ __ LoadRoot(rcx, Heap::kFixedArrayMapRootIndex);
__ movq(Operand(rdi, JSObject::kMapOffset), rcx); // setup the map
__ movl(Operand(rdi, FixedArray::kLengthOffset), rdx); // and length
@@ -623,7 +621,7 @@
// rax: start of next object
// rdx: number of elements
{ Label loop, entry;
- __ Move(rdx, Factory::undefined_value());
+ __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
__ lea(rcx, Operand(rdi, FixedArray::kHeaderSize));
__ jmp(&entry);
__ bind(&loop);
@@ -797,6 +795,11 @@
__ movq(rax, rcx);
__ movq(rbx, r8);
#endif // _WIN64
+
+ // Set up the roots register.
+ ExternalReference roots_address = ExternalReference::roots_address();
+ __ movq(r13, roots_address);
+
// Current stack contents:
// [rsp + 2 * kPointerSize ... ]: Internal frame
// [rsp + kPointerSize] : function
« no previous file with comments | « src/heap.cc ('k') | src/x64/cfg-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698