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

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

Issue 12317141: Added Isolate parameter to CodeStub::GetCode(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed whitespace. Rebased. Created 7 years, 9 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/full-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 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 4020 matching lines...) Expand 10 before | Expand all | Expand 10 after
4031 4031
4032 bool CEntryStub::IsPregenerated() { 4032 bool CEntryStub::IsPregenerated() {
4033 #ifdef _WIN64 4033 #ifdef _WIN64
4034 return result_size_ == 1; 4034 return result_size_ == 1;
4035 #else 4035 #else
4036 return true; 4036 return true;
4037 #endif 4037 #endif
4038 } 4038 }
4039 4039
4040 4040
4041 void CodeStub::GenerateStubsAheadOfTime() { 4041 void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) {
4042 CEntryStub::GenerateAheadOfTime(); 4042 CEntryStub::GenerateAheadOfTime(isolate);
4043 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(); 4043 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(isolate);
4044 // It is important that the store buffer overflow stubs are generated first. 4044 // It is important that the store buffer overflow stubs are generated first.
4045 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(); 4045 RecordWriteStub::GenerateFixedRegStubsAheadOfTime(isolate);
4046 } 4046 }
4047 4047
4048 4048
4049 void CodeStub::GenerateFPStubs() { 4049 void CodeStub::GenerateFPStubs(Isolate* isolate) {
4050 } 4050 }
4051 4051
4052 4052
4053 void CEntryStub::GenerateAheadOfTime() { 4053 void CEntryStub::GenerateAheadOfTime(Isolate* isolate) {
4054 CEntryStub stub(1, kDontSaveFPRegs); 4054 CEntryStub stub(1, kDontSaveFPRegs);
4055 stub.GetCode()->set_is_pregenerated(true); 4055 stub.GetCode(isolate)->set_is_pregenerated(true);
4056 CEntryStub save_doubles(1, kSaveFPRegs); 4056 CEntryStub save_doubles(1, kSaveFPRegs);
4057 save_doubles.GetCode()->set_is_pregenerated(true); 4057 save_doubles.GetCode(isolate)->set_is_pregenerated(true);
4058 } 4058 }
4059 4059
4060 4060
4061 static void JumpIfOOM(MacroAssembler* masm, 4061 static void JumpIfOOM(MacroAssembler* masm,
4062 Register value, 4062 Register value,
4063 Register scratch, 4063 Register scratch,
4064 Label* oom_label) { 4064 Label* oom_label) {
4065 __ movq(scratch, value); 4065 __ movq(scratch, value);
4066 STATIC_ASSERT(Failure::OUT_OF_MEMORY_EXCEPTION == 3); 4066 STATIC_ASSERT(Failure::OUT_OF_MEMORY_EXCEPTION == 3);
4067 STATIC_ASSERT(kFailureTag == 3); 4067 STATIC_ASSERT(kFailureTag == 3);
(...skipping 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after
5801 __ movl(rax, Immediate(0)); 5801 __ movl(rax, Immediate(0));
5802 __ movl(rcx, Immediate(0)); 5802 __ movl(rcx, Immediate(0));
5803 __ setcc(above, rax); // Add one to zero if carry clear and not equal. 5803 __ setcc(above, rax); // Add one to zero if carry clear and not equal.
5804 __ sbbq(rax, rcx); // Subtract one if below (aka. carry set). 5804 __ sbbq(rax, rcx); // Subtract one if below (aka. carry set).
5805 __ ret(0); 5805 __ ret(0);
5806 5806
5807 __ bind(&unordered); 5807 __ bind(&unordered);
5808 __ bind(&generic_stub); 5808 __ bind(&generic_stub);
5809 ICCompareStub stub(op_, CompareIC::GENERIC, CompareIC::GENERIC, 5809 ICCompareStub stub(op_, CompareIC::GENERIC, CompareIC::GENERIC,
5810 CompareIC::GENERIC); 5810 CompareIC::GENERIC);
5811 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); 5811 __ jmp(stub.GetCode(masm->isolate()), RelocInfo::CODE_TARGET);
5812 5812
5813 __ bind(&maybe_undefined1); 5813 __ bind(&maybe_undefined1);
5814 if (Token::IsOrderedRelationalCompareOp(op_)) { 5814 if (Token::IsOrderedRelationalCompareOp(op_)) {
5815 __ Cmp(rax, masm->isolate()->factory()->undefined_value()); 5815 __ Cmp(rax, masm->isolate()->factory()->undefined_value());
5816 __ j(not_equal, &miss); 5816 __ j(not_equal, &miss);
5817 __ JumpIfSmi(rdx, &unordered); 5817 __ JumpIfSmi(rdx, &unordered);
5818 __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rcx); 5818 __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rcx);
5819 __ j(not_equal, &maybe_undefined2, Label::kNear); 5819 __ j(not_equal, &maybe_undefined2, Label::kNear);
5820 __ jmp(&unordered); 5820 __ jmp(&unordered);
5821 } 5821 }
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
6292 address_.is(entry->address) && 6292 address_.is(entry->address) &&
6293 remembered_set_action_ == entry->action && 6293 remembered_set_action_ == entry->action &&
6294 save_fp_regs_mode_ == kDontSaveFPRegs) { 6294 save_fp_regs_mode_ == kDontSaveFPRegs) {
6295 return true; 6295 return true;
6296 } 6296 }
6297 } 6297 }
6298 return false; 6298 return false;
6299 } 6299 }
6300 6300
6301 6301
6302 void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime() { 6302 void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(
6303 Isolate* isolate) {
6303 StoreBufferOverflowStub stub1(kDontSaveFPRegs); 6304 StoreBufferOverflowStub stub1(kDontSaveFPRegs);
6304 stub1.GetCode()->set_is_pregenerated(true); 6305 stub1.GetCode(isolate)->set_is_pregenerated(true);
6305 StoreBufferOverflowStub stub2(kSaveFPRegs); 6306 StoreBufferOverflowStub stub2(kSaveFPRegs);
6306 stub2.GetCode()->set_is_pregenerated(true); 6307 stub2.GetCode(isolate)->set_is_pregenerated(true);
6307 } 6308 }
6308 6309
6309 6310
6310 void RecordWriteStub::GenerateFixedRegStubsAheadOfTime() { 6311 void RecordWriteStub::GenerateFixedRegStubsAheadOfTime(Isolate* isolate) {
6311 for (AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; 6312 for (AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime;
6312 !entry->object.is(no_reg); 6313 !entry->object.is(no_reg);
6313 entry++) { 6314 entry++) {
6314 RecordWriteStub stub(entry->object, 6315 RecordWriteStub stub(entry->object,
6315 entry->value, 6316 entry->value,
6316 entry->address, 6317 entry->address,
6317 entry->action, 6318 entry->action,
6318 kDontSaveFPRegs); 6319 kDontSaveFPRegs);
6319 stub.GetCode()->set_is_pregenerated(true); 6320 stub.GetCode(isolate)->set_is_pregenerated(true);
6320 } 6321 }
6321 } 6322 }
6322 6323
6323 6324
6324 bool CodeStub::CanUseFPRegisters() { 6325 bool CodeStub::CanUseFPRegisters() {
6325 return true; // Always have SSE2 on x64. 6326 return true; // Always have SSE2 on x64.
6326 } 6327 }
6327 6328
6328 6329
6329 // Takes the input in 3 registers: address_ value_ and object_. A pointer to 6330 // Takes the input in 3 registers: address_ value_ and object_. A pointer to
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
6608 r11, 6609 r11,
6609 xmm0, 6610 xmm0,
6610 &slow_elements); 6611 &slow_elements);
6611 __ ret(0); 6612 __ ret(0);
6612 } 6613 }
6613 6614
6614 6615
6615 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { 6616 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
6616 ASSERT(!Serializer::enabled()); 6617 ASSERT(!Serializer::enabled());
6617 CEntryStub ces(1, kSaveFPRegs); 6618 CEntryStub ces(1, kSaveFPRegs);
6618 __ Call(ces.GetCode(), RelocInfo::CODE_TARGET); 6619 __ Call(ces.GetCode(masm->isolate()), RelocInfo::CODE_TARGET);
6619 int parameter_count_offset = 6620 int parameter_count_offset =
6620 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; 6621 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
6621 __ movq(rbx, MemOperand(rbp, parameter_count_offset)); 6622 __ movq(rbx, MemOperand(rbp, parameter_count_offset));
6622 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); 6623 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE);
6623 __ pop(rcx); 6624 __ pop(rcx);
6624 __ lea(rsp, MemOperand(rsp, rbx, times_pointer_size, 6625 __ lea(rsp, MemOperand(rsp, rbx, times_pointer_size,
6625 extra_expression_stack_count_ * kPointerSize)); 6626 extra_expression_stack_count_ * kPointerSize));
6626 __ jmp(rcx); // Return to IC Miss stub, continuation still on stack. 6627 __ jmp(rcx); // Return to IC Miss stub, continuation still on stack.
6627 } 6628 }
6628 6629
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
6692 #endif 6693 #endif
6693 6694
6694 __ Ret(); 6695 __ Ret();
6695 } 6696 }
6696 6697
6697 #undef __ 6698 #undef __
6698 6699
6699 } } // namespace v8::internal 6700 } } // namespace v8::internal
6700 6701
6701 #endif // V8_TARGET_ARCH_X64 6702 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698