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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 6066010: Merge 6095:6198 from bleeding_edge to experimental/gc. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 11 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 | « src/x64/code-stubs-x64.h ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 // Get the function from the stack. 98 // Get the function from the stack.
99 __ movq(rcx, Operand(rsp, 1 * kPointerSize)); 99 __ movq(rcx, Operand(rsp, 1 * kPointerSize));
100 100
101 // Setup the object header. 101 // Setup the object header.
102 __ LoadRoot(kScratchRegister, Heap::kContextMapRootIndex); 102 __ LoadRoot(kScratchRegister, Heap::kContextMapRootIndex);
103 __ movq(FieldOperand(rax, HeapObject::kMapOffset), kScratchRegister); 103 __ movq(FieldOperand(rax, HeapObject::kMapOffset), kScratchRegister);
104 __ Move(FieldOperand(rax, FixedArray::kLengthOffset), Smi::FromInt(length)); 104 __ Move(FieldOperand(rax, FixedArray::kLengthOffset), Smi::FromInt(length));
105 105
106 // Setup the fixed slots. 106 // Setup the fixed slots.
107 __ xor_(rbx, rbx); // Set to NULL. 107 __ Set(rbx, 0); // Set to NULL.
108 __ movq(Operand(rax, Context::SlotOffset(Context::CLOSURE_INDEX)), rcx); 108 __ movq(Operand(rax, Context::SlotOffset(Context::CLOSURE_INDEX)), rcx);
109 __ movq(Operand(rax, Context::SlotOffset(Context::FCONTEXT_INDEX)), rax); 109 __ movq(Operand(rax, Context::SlotOffset(Context::FCONTEXT_INDEX)), rax);
110 __ movq(Operand(rax, Context::SlotOffset(Context::PREVIOUS_INDEX)), rbx); 110 __ movq(Operand(rax, Context::SlotOffset(Context::PREVIOUS_INDEX)), rbx);
111 __ movq(Operand(rax, Context::SlotOffset(Context::EXTENSION_INDEX)), rbx); 111 __ movq(Operand(rax, Context::SlotOffset(Context::EXTENSION_INDEX)), rbx);
112 112
113 // Copy the global object from the surrounding context. 113 // Copy the global object from the surrounding context.
114 __ movq(rbx, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX))); 114 __ movq(rbx, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
115 __ movq(Operand(rax, Context::SlotOffset(Context::GLOBAL_INDEX)), rbx); 115 __ movq(Operand(rax, Context::SlotOffset(Context::GLOBAL_INDEX)), rbx);
116 116
117 // Initialize the rest of the slots to undefined. 117 // Initialize the rest of the slots to undefined.
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 __ xorpd(xmm0, xmm0); 243 __ xorpd(xmm0, xmm0);
244 __ ucomisd(xmm0, FieldOperand(rax, HeapNumber::kValueOffset)); 244 __ ucomisd(xmm0, FieldOperand(rax, HeapNumber::kValueOffset));
245 __ j(zero, &false_result); 245 __ j(zero, &false_result);
246 // Fall through to |true_result|. 246 // Fall through to |true_result|.
247 247
248 // Return 1/0 for true/false in rax. 248 // Return 1/0 for true/false in rax.
249 __ bind(&true_result); 249 __ bind(&true_result);
250 __ movq(rax, Immediate(1)); 250 __ movq(rax, Immediate(1));
251 __ ret(1 * kPointerSize); 251 __ ret(1 * kPointerSize);
252 __ bind(&false_result); 252 __ bind(&false_result);
253 __ xor_(rax, rax); 253 __ Set(rax, 0);
254 __ ret(1 * kPointerSize); 254 __ ret(1 * kPointerSize);
255 } 255 }
256 256
257 257
258 const char* GenericBinaryOpStub::GetName() { 258 const char* GenericBinaryOpStub::GetName() {
259 if (name_ != NULL) return name_; 259 if (name_ != NULL) return name_;
260 const int kMaxNameLength = 100; 260 const int kMaxNameLength = 100;
261 name_ = Bootstrapper::AllocateAutoDeletedArray(kMaxNameLength); 261 name_ = Bootstrapper::AllocateAutoDeletedArray(kMaxNameLength);
262 if (name_ == NULL) return "OOM"; 262 if (name_ == NULL) return "OOM";
263 const char* op_name = Token::Name(op_); 263 const char* op_name = Token::Name(op_);
(...skipping 2305 matching lines...) Expand 10 before | Expand all | Expand 10 after
2569 __ movq(kScratchRegister, handler_address); 2569 __ movq(kScratchRegister, handler_address);
2570 __ movq(rsp, Operand(kScratchRegister, 0)); 2570 __ movq(rsp, Operand(kScratchRegister, 0));
2571 // get next in chain 2571 // get next in chain
2572 __ pop(rcx); 2572 __ pop(rcx);
2573 __ movq(Operand(kScratchRegister, 0), rcx); 2573 __ movq(Operand(kScratchRegister, 0), rcx);
2574 __ pop(rbp); // pop frame pointer 2574 __ pop(rbp); // pop frame pointer
2575 __ pop(rdx); // remove state 2575 __ pop(rdx); // remove state
2576 2576
2577 // Before returning we restore the context from the frame pointer if not NULL. 2577 // Before returning we restore the context from the frame pointer if not NULL.
2578 // The frame pointer is NULL in the exception handler of a JS entry frame. 2578 // The frame pointer is NULL in the exception handler of a JS entry frame.
2579 __ xor_(rsi, rsi); // tentatively set context pointer to NULL 2579 __ Set(rsi, 0); // Tentatively set context pointer to NULL
2580 NearLabel skip; 2580 NearLabel skip;
2581 __ cmpq(rbp, Immediate(0)); 2581 __ cmpq(rbp, Immediate(0));
2582 __ j(equal, &skip); 2582 __ j(equal, &skip);
2583 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 2583 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
2584 __ bind(&skip); 2584 __ bind(&skip);
2585 __ ret(0); 2585 __ ret(0);
2586 } 2586 }
2587 2587
2588 2588
2589 void CEntryStub::GenerateCore(MacroAssembler* masm, 2589 void CEntryStub::GenerateCore(MacroAssembler* masm,
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2753 __ movq(rax, Immediate(false)); 2753 __ movq(rax, Immediate(false));
2754 __ store_rax(external_caught); 2754 __ store_rax(external_caught);
2755 2755
2756 // Set pending exception and rax to out of memory exception. 2756 // Set pending exception and rax to out of memory exception.
2757 ExternalReference pending_exception(Top::k_pending_exception_address); 2757 ExternalReference pending_exception(Top::k_pending_exception_address);
2758 __ movq(rax, Failure::OutOfMemoryException(), RelocInfo::NONE); 2758 __ movq(rax, Failure::OutOfMemoryException(), RelocInfo::NONE);
2759 __ store_rax(pending_exception); 2759 __ store_rax(pending_exception);
2760 } 2760 }
2761 2761
2762 // Clear the context pointer. 2762 // Clear the context pointer.
2763 __ xor_(rsi, rsi); 2763 __ Set(rsi, 0);
2764 2764
2765 // Restore registers from handler. 2765 // Restore registers from handler.
2766 STATIC_ASSERT(StackHandlerConstants::kNextOffset + kPointerSize == 2766 STATIC_ASSERT(StackHandlerConstants::kNextOffset + kPointerSize ==
2767 StackHandlerConstants::kFPOffset); 2767 StackHandlerConstants::kFPOffset);
2768 __ pop(rbp); // FP 2768 __ pop(rbp); // FP
2769 STATIC_ASSERT(StackHandlerConstants::kFPOffset + kPointerSize == 2769 STATIC_ASSERT(StackHandlerConstants::kFPOffset + kPointerSize ==
2770 StackHandlerConstants::kStateOffset); 2770 StackHandlerConstants::kStateOffset);
2771 __ pop(rdx); // State 2771 __ pop(rdx); // State
2772 2772
2773 STATIC_ASSERT(StackHandlerConstants::kStateOffset + kPointerSize == 2773 STATIC_ASSERT(StackHandlerConstants::kStateOffset + kPointerSize ==
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after
4105 4105
4106 void ICCompareStub::GenerateMiss(MacroAssembler* masm) { 4106 void ICCompareStub::GenerateMiss(MacroAssembler* masm) {
4107 UNIMPLEMENTED(); 4107 UNIMPLEMENTED();
4108 } 4108 }
4109 4109
4110 #undef __ 4110 #undef __
4111 4111
4112 } } // namespace v8::internal 4112 } } // namespace v8::internal
4113 4113
4114 #endif // V8_TARGET_ARCH_X64 4114 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.h ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698