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

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

Issue 255543003: CodeStubs contain their corresponding Isolate* now. (part 2) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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
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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 } else { 538 } else {
539 CallRuntime(Runtime::kAbort, 1); 539 CallRuntime(Runtime::kAbort, 1);
540 } 540 }
541 // Control will not return here. 541 // Control will not return here.
542 int3(); 542 int3();
543 } 543 }
544 544
545 545
546 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) { 546 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) {
547 ASSERT(AllowThisStubCall(stub)); // Calls are not allowed in some stubs 547 ASSERT(AllowThisStubCall(stub)); // Calls are not allowed in some stubs
548 Call(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, ast_id); 548 Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id);
549 } 549 }
550 550
551 551
552 void MacroAssembler::TailCallStub(CodeStub* stub) { 552 void MacroAssembler::TailCallStub(CodeStub* stub) {
553 Jump(stub->GetCode(isolate()), RelocInfo::CODE_TARGET); 553 Jump(stub->GetCode(), RelocInfo::CODE_TARGET);
554 } 554 }
555 555
556 556
557 void MacroAssembler::StubReturn(int argc) { 557 void MacroAssembler::StubReturn(int argc) {
558 ASSERT(argc >= 1 && generating_stub()); 558 ASSERT(argc >= 1 && generating_stub());
559 ret((argc - 1) * kPointerSize); 559 ret((argc - 1) * kPointerSize);
560 } 560 }
561 561
562 562
563 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { 563 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) {
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 movp(rax, prev_limit_reg); 822 movp(rax, prev_limit_reg);
823 jmp(&leave_exit_frame); 823 jmp(&leave_exit_frame);
824 } 824 }
825 825
826 826
827 void MacroAssembler::JumpToExternalReference(const ExternalReference& ext, 827 void MacroAssembler::JumpToExternalReference(const ExternalReference& ext,
828 int result_size) { 828 int result_size) {
829 // Set the entry point and jump to the C entry runtime stub. 829 // Set the entry point and jump to the C entry runtime stub.
830 LoadAddress(rbx, ext); 830 LoadAddress(rbx, ext);
831 CEntryStub ces(isolate(), result_size); 831 CEntryStub ces(isolate(), result_size);
832 jmp(ces.GetCode(isolate()), RelocInfo::CODE_TARGET); 832 jmp(ces.GetCode(), RelocInfo::CODE_TARGET);
833 } 833 }
834 834
835 835
836 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, 836 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id,
837 InvokeFlag flag, 837 InvokeFlag flag,
838 const CallWrapper& call_wrapper) { 838 const CallWrapper& call_wrapper) {
839 // You can't call a builtin without a valid frame. 839 // You can't call a builtin without a valid frame.
840 ASSERT(flag == JUMP_FUNCTION || has_frame()); 840 ASSERT(flag == JUMP_FUNCTION || has_frame());
841 841
842 // Rely on the assertion to check that the number of provided 842 // Rely on the assertion to check that the number of provided
(...skipping 2454 matching lines...) Expand 10 before | Expand all | Expand 10 after
3297 Assert(below_equal, kInputGPRIsExpectedToHaveUpper32Cleared); 3297 Assert(below_equal, kInputGPRIsExpectedToHaveUpper32Cleared);
3298 } 3298 }
3299 cvtqsi2sd(dst, src); 3299 cvtqsi2sd(dst, src);
3300 } 3300 }
3301 3301
3302 3302
3303 void MacroAssembler::SlowTruncateToI(Register result_reg, 3303 void MacroAssembler::SlowTruncateToI(Register result_reg,
3304 Register input_reg, 3304 Register input_reg,
3305 int offset) { 3305 int offset) {
3306 DoubleToIStub stub(isolate(), input_reg, result_reg, offset, true); 3306 DoubleToIStub stub(isolate(), input_reg, result_reg, offset, true);
3307 call(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); 3307 call(stub.GetCode(), RelocInfo::CODE_TARGET);
3308 } 3308 }
3309 3309
3310 3310
3311 void MacroAssembler::TruncateHeapNumberToI(Register result_reg, 3311 void MacroAssembler::TruncateHeapNumberToI(Register result_reg,
3312 Register input_reg) { 3312 Register input_reg) {
3313 Label done; 3313 Label done;
3314 movsd(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset)); 3314 movsd(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset));
3315 cvttsd2siq(result_reg, xmm0); 3315 cvttsd2siq(result_reg, xmm0);
3316 cmpq(result_reg, Immediate(1)); 3316 cmpq(result_reg, Immediate(1));
3317 j(no_overflow, &done, Label::kNear); 3317 j(no_overflow, &done, Label::kNear);
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
3691 } 3691 }
3692 } 3692 }
3693 3693
3694 3694
3695 #ifdef ENABLE_DEBUGGER_SUPPORT 3695 #ifdef ENABLE_DEBUGGER_SUPPORT
3696 void MacroAssembler::DebugBreak() { 3696 void MacroAssembler::DebugBreak() {
3697 Set(rax, 0); // No arguments. 3697 Set(rax, 0); // No arguments.
3698 LoadAddress(rbx, ExternalReference(Runtime::kDebugBreak, isolate())); 3698 LoadAddress(rbx, ExternalReference(Runtime::kDebugBreak, isolate()));
3699 CEntryStub ces(isolate(), 1); 3699 CEntryStub ces(isolate(), 1);
3700 ASSERT(AllowThisStubCall(&ces)); 3700 ASSERT(AllowThisStubCall(&ces));
3701 Call(ces.GetCode(isolate()), RelocInfo::DEBUG_BREAK); 3701 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
3702 } 3702 }
3703 #endif // ENABLE_DEBUGGER_SUPPORT 3703 #endif // ENABLE_DEBUGGER_SUPPORT
3704 3704
3705 3705
3706 void MacroAssembler::InvokeCode(Register code, 3706 void MacroAssembler::InvokeCode(Register code,
3707 const ParameterCount& expected, 3707 const ParameterCount& expected,
3708 const ParameterCount& actual, 3708 const ParameterCount& actual,
3709 InvokeFlag flag, 3709 InvokeFlag flag,
3710 const CallWrapper& call_wrapper) { 3710 const CallWrapper& call_wrapper) {
3711 // You can't call a function without a valid frame. 3711 // You can't call a function without a valid frame.
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
5204 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); 5204 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift()));
5205 movl(rax, dividend); 5205 movl(rax, dividend);
5206 shrl(rax, Immediate(31)); 5206 shrl(rax, Immediate(31));
5207 addl(rdx, rax); 5207 addl(rdx, rax);
5208 } 5208 }
5209 5209
5210 5210
5211 } } // namespace v8::internal 5211 } } // namespace v8::internal
5212 5212
5213 #endif // V8_TARGET_ARCH_X64 5213 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698