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

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

Issue 246643014: CodeStubs contain their corresponding Isolate* now. (part 1) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Feedback. Rebased. 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
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/arm64/regexp-macro-assembler-arm64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 Drop(num_arguments); 1644 Drop(num_arguments);
1645 } 1645 }
1646 LoadRoot(x0, Heap::kUndefinedValueRootIndex); 1646 LoadRoot(x0, Heap::kUndefinedValueRootIndex);
1647 return; 1647 return;
1648 } 1648 }
1649 1649
1650 // Place the necessary arguments. 1650 // Place the necessary arguments.
1651 Mov(x0, num_arguments); 1651 Mov(x0, num_arguments);
1652 Mov(x1, ExternalReference(f, isolate())); 1652 Mov(x1, ExternalReference(f, isolate()));
1653 1653
1654 CEntryStub stub(1, save_doubles); 1654 CEntryStub stub(isolate(), 1, save_doubles);
1655 CallStub(&stub); 1655 CallStub(&stub);
1656 } 1656 }
1657 1657
1658 1658
1659 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) { 1659 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
1660 return ref0.address() - ref1.address(); 1660 return ref0.address() - ref1.address();
1661 } 1661 }
1662 1662
1663 1663
1664 void MacroAssembler::CallApiFunctionAndReturn( 1664 void MacroAssembler::CallApiFunctionAndReturn(
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 FrameScope frame(this, StackFrame::MANUAL); 1722 FrameScope frame(this, StackFrame::MANUAL);
1723 PushSafepointRegisters(); 1723 PushSafepointRegisters();
1724 Mov(x0, ExternalReference::isolate_address(isolate())); 1724 Mov(x0, ExternalReference::isolate_address(isolate()));
1725 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); 1725 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1);
1726 PopSafepointRegisters(); 1726 PopSafepointRegisters();
1727 } 1727 }
1728 1728
1729 // Native call returns to the DirectCEntry stub which redirects to the 1729 // Native call returns to the DirectCEntry stub which redirects to the
1730 // return address pushed on stack (could have moved after GC). 1730 // return address pushed on stack (could have moved after GC).
1731 // DirectCEntry stub itself is generated early and never moves. 1731 // DirectCEntry stub itself is generated early and never moves.
1732 DirectCEntryStub stub; 1732 DirectCEntryStub stub(isolate());
1733 stub.GenerateCall(this, x3); 1733 stub.GenerateCall(this, x3);
1734 1734
1735 if (FLAG_log_timer_events) { 1735 if (FLAG_log_timer_events) {
1736 FrameScope frame(this, StackFrame::MANUAL); 1736 FrameScope frame(this, StackFrame::MANUAL);
1737 PushSafepointRegisters(); 1737 PushSafepointRegisters();
1738 Mov(x0, ExternalReference::isolate_address(isolate())); 1738 Mov(x0, ExternalReference::isolate_address(isolate()));
1739 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); 1739 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1);
1740 PopSafepointRegisters(); 1740 PopSafepointRegisters();
1741 } 1741 }
1742 1742
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1806 Mov(x0, saved_result); 1806 Mov(x0, saved_result);
1807 B(&leave_exit_frame); 1807 B(&leave_exit_frame);
1808 } 1808 }
1809 1809
1810 1810
1811 void MacroAssembler::CallExternalReference(const ExternalReference& ext, 1811 void MacroAssembler::CallExternalReference(const ExternalReference& ext,
1812 int num_arguments) { 1812 int num_arguments) {
1813 Mov(x0, num_arguments); 1813 Mov(x0, num_arguments);
1814 Mov(x1, ext); 1814 Mov(x1, ext);
1815 1815
1816 CEntryStub stub(1); 1816 CEntryStub stub(isolate(), 1);
1817 CallStub(&stub); 1817 CallStub(&stub);
1818 } 1818 }
1819 1819
1820 1820
1821 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) { 1821 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) {
1822 Mov(x1, builtin); 1822 Mov(x1, builtin);
1823 CEntryStub stub(1); 1823 CEntryStub stub(isolate(), 1);
1824 Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); 1824 Jump(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
1825 } 1825 }
1826 1826
1827 1827
1828 void MacroAssembler::GetBuiltinFunction(Register target, 1828 void MacroAssembler::GetBuiltinFunction(Register target,
1829 Builtins::JavaScript id) { 1829 Builtins::JavaScript id) {
1830 // Load the builtins object into target register. 1830 // Load the builtins object into target register.
1831 Ldr(target, GlobalObjectMemOperand()); 1831 Ldr(target, GlobalObjectMemOperand());
1832 Ldr(target, FieldMemOperand(target, GlobalObject::kBuiltinsOffset)); 1832 Ldr(target, FieldMemOperand(target, GlobalObject::kBuiltinsOffset));
1833 // Load the JavaScript builtin function from the builtins object. 1833 // Load the JavaScript builtin function from the builtins object.
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
2912 ASSERT(jssp.Is(StackPointer())); 2912 ASSERT(jssp.Is(StackPointer()));
2913 2913
2914 // Try to convert the double to an int64. If successful, the bottom 32 bits 2914 // Try to convert the double to an int64. If successful, the bottom 32 bits
2915 // contain our truncated int32 result. 2915 // contain our truncated int32 result.
2916 TryConvertDoubleToInt64(result, double_input, &done); 2916 TryConvertDoubleToInt64(result, double_input, &done);
2917 2917
2918 // If we fell through then inline version didn't succeed - call stub instead. 2918 // If we fell through then inline version didn't succeed - call stub instead.
2919 Push(lr); 2919 Push(lr);
2920 Push(double_input); // Put input on stack. 2920 Push(double_input); // Put input on stack.
2921 2921
2922 DoubleToIStub stub(jssp, 2922 DoubleToIStub stub(isolate(),
2923 jssp,
2923 result, 2924 result,
2924 0, 2925 0,
2925 true, // is_truncating 2926 true, // is_truncating
2926 true); // skip_fastpath 2927 true); // skip_fastpath
2927 CallStub(&stub); // DoubleToIStub preserves any registers it needs to clobber 2928 CallStub(&stub); // DoubleToIStub preserves any registers it needs to clobber
2928 2929
2929 Drop(1, kDoubleSize); // Drop the double input on the stack. 2930 Drop(1, kDoubleSize); // Drop the double input on the stack.
2930 Pop(lr); 2931 Pop(lr);
2931 2932
2932 Bind(&done); 2933 Bind(&done);
2933 } 2934 }
2934 2935
2935 2936
2936 void MacroAssembler::TruncateHeapNumberToI(Register result, 2937 void MacroAssembler::TruncateHeapNumberToI(Register result,
2937 Register object) { 2938 Register object) {
2938 Label done; 2939 Label done;
2939 ASSERT(!result.is(object)); 2940 ASSERT(!result.is(object));
2940 ASSERT(jssp.Is(StackPointer())); 2941 ASSERT(jssp.Is(StackPointer()));
2941 2942
2942 Ldr(fp_scratch, FieldMemOperand(object, HeapNumber::kValueOffset)); 2943 Ldr(fp_scratch, FieldMemOperand(object, HeapNumber::kValueOffset));
2943 2944
2944 // Try to convert the double to an int64. If successful, the bottom 32 bits 2945 // Try to convert the double to an int64. If successful, the bottom 32 bits
2945 // contain our truncated int32 result. 2946 // contain our truncated int32 result.
2946 TryConvertDoubleToInt64(result, fp_scratch, &done); 2947 TryConvertDoubleToInt64(result, fp_scratch, &done);
2947 2948
2948 // If we fell through then inline version didn't succeed - call stub instead. 2949 // If we fell through then inline version didn't succeed - call stub instead.
2949 Push(lr); 2950 Push(lr);
2950 DoubleToIStub stub(object, 2951 DoubleToIStub stub(isolate(),
2952 object,
2951 result, 2953 result,
2952 HeapNumber::kValueOffset - kHeapObjectTag, 2954 HeapNumber::kValueOffset - kHeapObjectTag,
2953 true, // is_truncating 2955 true, // is_truncating
2954 true); // skip_fastpath 2956 true); // skip_fastpath
2955 CallStub(&stub); // DoubleToIStub preserves any registers it needs to clobber 2957 CallStub(&stub); // DoubleToIStub preserves any registers it needs to clobber
2956 Pop(lr); 2958 Pop(lr);
2957 2959
2958 Bind(&done); 2960 Bind(&done);
2959 } 2961 }
2960 2962
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
3181 // cannot be allowed to destroy the context in cp). 3183 // cannot be allowed to destroy the context in cp).
3182 Mov(dst, cp); 3184 Mov(dst, cp);
3183 } 3185 }
3184 } 3186 }
3185 3187
3186 3188
3187 #ifdef ENABLE_DEBUGGER_SUPPORT 3189 #ifdef ENABLE_DEBUGGER_SUPPORT
3188 void MacroAssembler::DebugBreak() { 3190 void MacroAssembler::DebugBreak() {
3189 Mov(x0, 0); 3191 Mov(x0, 0);
3190 Mov(x1, ExternalReference(Runtime::kDebugBreak, isolate())); 3192 Mov(x1, ExternalReference(Runtime::kDebugBreak, isolate()));
3191 CEntryStub ces(1); 3193 CEntryStub ces(isolate(), 1);
3192 ASSERT(AllowThisStubCall(&ces)); 3194 ASSERT(AllowThisStubCall(&ces));
3193 Call(ces.GetCode(isolate()), RelocInfo::DEBUG_BREAK); 3195 Call(ces.GetCode(isolate()), RelocInfo::DEBUG_BREAK);
3194 } 3196 }
3195 #endif 3197 #endif
3196 3198
3197 3199
3198 void MacroAssembler::PushTryHandler(StackHandler::Kind kind, 3200 void MacroAssembler::PushTryHandler(StackHandler::Kind kind,
3199 int handler_index) { 3201 int handler_index) {
3200 ASSERT(jssp.Is(StackPointer())); 3202 ASSERT(jssp.Is(StackPointer()));
3201 // Adjust this code if the asserts don't hold. 3203 // Adjust this code if the asserts don't hold.
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
4196 Tbz(scratch1, (14 + kPointerSizeLog2), &done); 4198 Tbz(scratch1, (14 + kPointerSizeLog2), &done);
4197 } else { 4199 } else {
4198 ASSERT(and_then == kReturnAtEnd); 4200 ASSERT(and_then == kReturnAtEnd);
4199 Tbnz(scratch1, (14 + kPointerSizeLog2), &store_buffer_overflow); 4201 Tbnz(scratch1, (14 + kPointerSizeLog2), &store_buffer_overflow);
4200 Ret(); 4202 Ret();
4201 } 4203 }
4202 4204
4203 Bind(&store_buffer_overflow); 4205 Bind(&store_buffer_overflow);
4204 Push(lr); 4206 Push(lr);
4205 StoreBufferOverflowStub store_buffer_overflow_stub = 4207 StoreBufferOverflowStub store_buffer_overflow_stub =
4206 StoreBufferOverflowStub(fp_mode); 4208 StoreBufferOverflowStub(isolate(), fp_mode);
4207 CallStub(&store_buffer_overflow_stub); 4209 CallStub(&store_buffer_overflow_stub);
4208 Pop(lr); 4210 Pop(lr);
4209 4211
4210 Bind(&done); 4212 Bind(&done);
4211 if (and_then == kReturnAtEnd) { 4213 if (and_then == kReturnAtEnd) {
4212 Ret(); 4214 Ret();
4213 } 4215 }
4214 } 4216 }
4215 4217
4216 4218
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
4389 &done); 4391 &done);
4390 CheckPageFlagClear(object, 4392 CheckPageFlagClear(object,
4391 value, // Used as scratch. 4393 value, // Used as scratch.
4392 MemoryChunk::kPointersFromHereAreInterestingMask, 4394 MemoryChunk::kPointersFromHereAreInterestingMask,
4393 &done); 4395 &done);
4394 4396
4395 // Record the actual write. 4397 // Record the actual write.
4396 if (lr_status == kLRHasNotBeenSaved) { 4398 if (lr_status == kLRHasNotBeenSaved) {
4397 Push(lr); 4399 Push(lr);
4398 } 4400 }
4399 RecordWriteStub stub(object, value, address, remembered_set_action, fp_mode); 4401 RecordWriteStub stub(isolate(), object, value, address, remembered_set_action,
4402 fp_mode);
4400 CallStub(&stub); 4403 CallStub(&stub);
4401 if (lr_status == kLRHasNotBeenSaved) { 4404 if (lr_status == kLRHasNotBeenSaved) {
4402 Pop(lr); 4405 Pop(lr);
4403 } 4406 }
4404 4407
4405 Bind(&done); 4408 Bind(&done);
4406 4409
4407 // Clobber clobbered registers when running with the debug-code flag 4410 // Clobber clobbered registers when running with the debug-code flag
4408 // turned on to provoke errors. 4411 // turned on to provoke errors.
4409 if (emit_debug_code()) { 4412 if (emit_debug_code()) {
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
5241 } 5244 }
5242 } 5245 }
5243 5246
5244 5247
5245 #undef __ 5248 #undef __
5246 5249
5247 5250
5248 } } // namespace v8::internal 5251 } } // namespace v8::internal
5249 5252
5250 #endif // V8_TARGET_ARCH_ARM64 5253 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/arm64/regexp-macro-assembler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698