OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_S390 | 5 #if V8_TARGET_ARCH_S390 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 } | 260 } |
261 | 261 |
262 { | 262 { |
263 // Drop all arguments including the receiver. | 263 // Drop all arguments including the receiver. |
264 __ Drop(r4); | 264 __ Drop(r4); |
265 __ Ret(1); | 265 __ Ret(1); |
266 } | 266 } |
267 | 267 |
268 // 2b. No arguments, return +0. | 268 // 2b. No arguments, return +0. |
269 __ bind(&no_arguments); | 269 __ bind(&no_arguments); |
270 __ LoadSmiLiteral(r2, Smi::kZero); | 270 __ LoadSmiLiteral(r2, Smi::FromInt(0)); |
271 __ Ret(1); | 271 __ Ret(1); |
272 } | 272 } |
273 | 273 |
274 // static | 274 // static |
275 void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) { | 275 void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) { |
276 // ----------- S t a t e ------------- | 276 // ----------- S t a t e ------------- |
277 // -- r2 : number of arguments | 277 // -- r2 : number of arguments |
278 // -- r3 : constructor function | 278 // -- r3 : constructor function |
279 // -- r5 : new target | 279 // -- r5 : new target |
280 // -- lr : return address | 280 // -- lr : return address |
281 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) | 281 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) |
282 // -- sp[argc * 4] : receiver | 282 // -- sp[argc * 4] : receiver |
283 // ----------------------------------- | 283 // ----------------------------------- |
284 | 284 |
285 // 1. Make sure we operate in the context of the called function. | 285 // 1. Make sure we operate in the context of the called function. |
286 __ LoadP(cp, FieldMemOperand(r3, JSFunction::kContextOffset)); | 286 __ LoadP(cp, FieldMemOperand(r3, JSFunction::kContextOffset)); |
287 | 287 |
288 // 2. Load the first argument into r4. | 288 // 2. Load the first argument into r4. |
289 { | 289 { |
290 Label no_arguments, done; | 290 Label no_arguments, done; |
291 __ LoadRR(r8, r2); // Store argc in r8. | 291 __ LoadRR(r8, r2); // Store argc in r8. |
292 __ CmpP(r2, Operand::Zero()); | 292 __ CmpP(r2, Operand::Zero()); |
293 __ beq(&no_arguments); | 293 __ beq(&no_arguments); |
294 __ SubP(r2, r2, Operand(1)); | 294 __ SubP(r2, r2, Operand(1)); |
295 __ ShiftLeftP(r4, r2, Operand(kPointerSizeLog2)); | 295 __ ShiftLeftP(r4, r2, Operand(kPointerSizeLog2)); |
296 __ LoadP(r4, MemOperand(sp, r4)); | 296 __ LoadP(r4, MemOperand(sp, r4)); |
297 __ b(&done); | 297 __ b(&done); |
298 __ bind(&no_arguments); | 298 __ bind(&no_arguments); |
299 __ LoadSmiLiteral(r4, Smi::kZero); | 299 __ LoadSmiLiteral(r4, Smi::FromInt(0)); |
300 __ bind(&done); | 300 __ bind(&done); |
301 } | 301 } |
302 | 302 |
303 // 3. Make sure r4 is a number. | 303 // 3. Make sure r4 is a number. |
304 { | 304 { |
305 Label done_convert; | 305 Label done_convert; |
306 __ JumpIfSmi(r4, &done_convert); | 306 __ JumpIfSmi(r4, &done_convert); |
307 __ CompareObjectType(r4, r6, r6, HEAP_NUMBER_TYPE); | 307 __ CompareObjectType(r4, r6, r6, HEAP_NUMBER_TYPE); |
308 __ beq(&done_convert); | 308 __ beq(&done_convert); |
309 { | 309 { |
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 // Unreachable Code. | 1350 // Unreachable Code. |
1351 __ bkpt(0); | 1351 __ bkpt(0); |
1352 } | 1352 } |
1353 } | 1353 } |
1354 | 1354 |
1355 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { | 1355 void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
1356 // Set the return address to the correct point in the interpreter entry | 1356 // Set the return address to the correct point in the interpreter entry |
1357 // trampoline. | 1357 // trampoline. |
1358 Smi* interpreter_entry_return_pc_offset( | 1358 Smi* interpreter_entry_return_pc_offset( |
1359 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); | 1359 masm->isolate()->heap()->interpreter_entry_return_pc_offset()); |
1360 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::kZero); | 1360 DCHECK_NE(interpreter_entry_return_pc_offset, Smi::FromInt(0)); |
1361 __ Move(r4, masm->isolate()->builtins()->InterpreterEntryTrampoline()); | 1361 __ Move(r4, masm->isolate()->builtins()->InterpreterEntryTrampoline()); |
1362 __ AddP(r14, r4, Operand(interpreter_entry_return_pc_offset->value() + | 1362 __ AddP(r14, r4, Operand(interpreter_entry_return_pc_offset->value() + |
1363 Code::kHeaderSize - kHeapObjectTag)); | 1363 Code::kHeaderSize - kHeapObjectTag)); |
1364 | 1364 |
1365 // Initialize the dispatch table register. | 1365 // Initialize the dispatch table register. |
1366 __ mov(kInterpreterDispatchTableRegister, | 1366 __ mov(kInterpreterDispatchTableRegister, |
1367 Operand(ExternalReference::interpreter_dispatch_table_address( | 1367 Operand(ExternalReference::interpreter_dispatch_table_address( |
1368 masm->isolate()))); | 1368 masm->isolate()))); |
1369 | 1369 |
1370 // Get the bytecode array pointer from the frame. | 1370 // Get the bytecode array pointer from the frame. |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1888 | 1888 |
1889 { | 1889 { |
1890 FrameScope scope(masm, StackFrame::INTERNAL); | 1890 FrameScope scope(masm, StackFrame::INTERNAL); |
1891 // Pass function as argument. | 1891 // Pass function as argument. |
1892 __ push(r2); | 1892 __ push(r2); |
1893 __ CallRuntime(Runtime::kCompileForOnStackReplacement); | 1893 __ CallRuntime(Runtime::kCompileForOnStackReplacement); |
1894 } | 1894 } |
1895 | 1895 |
1896 // If the code object is null, just return to the caller. | 1896 // If the code object is null, just return to the caller. |
1897 Label skip; | 1897 Label skip; |
1898 __ CmpSmiLiteral(r2, Smi::kZero, r0); | 1898 __ CmpSmiLiteral(r2, Smi::FromInt(0), r0); |
1899 __ bne(&skip); | 1899 __ bne(&skip); |
1900 __ Ret(); | 1900 __ Ret(); |
1901 | 1901 |
1902 __ bind(&skip); | 1902 __ bind(&skip); |
1903 | 1903 |
1904 // Drop any potential handler frame that is be sitting on top of the actual | 1904 // Drop any potential handler frame that is be sitting on top of the actual |
1905 // JavaScript frame. This is the case then OSR is triggered from bytecode. | 1905 // JavaScript frame. This is the case then OSR is triggered from bytecode. |
1906 if (has_handler_frame) { | 1906 if (has_handler_frame) { |
1907 __ LeaveFrame(StackFrame::STUB); | 1907 __ LeaveFrame(StackFrame::STUB); |
1908 } | 1908 } |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2858 } | 2858 } |
2859 | 2859 |
2860 // static | 2860 // static |
2861 void Builtins::Generate_AllocateInNewSpace(MacroAssembler* masm) { | 2861 void Builtins::Generate_AllocateInNewSpace(MacroAssembler* masm) { |
2862 // ----------- S t a t e ------------- | 2862 // ----------- S t a t e ------------- |
2863 // -- r3 : requested object size (untagged) | 2863 // -- r3 : requested object size (untagged) |
2864 // -- lr : return address | 2864 // -- lr : return address |
2865 // ----------------------------------- | 2865 // ----------------------------------- |
2866 __ SmiTag(r3); | 2866 __ SmiTag(r3); |
2867 __ Push(r3); | 2867 __ Push(r3); |
2868 __ LoadSmiLiteral(cp, Smi::kZero); | 2868 __ LoadSmiLiteral(cp, Smi::FromInt(0)); |
2869 __ TailCallRuntime(Runtime::kAllocateInNewSpace); | 2869 __ TailCallRuntime(Runtime::kAllocateInNewSpace); |
2870 } | 2870 } |
2871 | 2871 |
2872 // static | 2872 // static |
2873 void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) { | 2873 void Builtins::Generate_AllocateInOldSpace(MacroAssembler* masm) { |
2874 // ----------- S t a t e ------------- | 2874 // ----------- S t a t e ------------- |
2875 // -- r3 : requested object size (untagged) | 2875 // -- r3 : requested object size (untagged) |
2876 // -- lr : return address | 2876 // -- lr : return address |
2877 // ----------------------------------- | 2877 // ----------------------------------- |
2878 __ SmiTag(r3); | 2878 __ SmiTag(r3); |
2879 __ LoadSmiLiteral(r4, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); | 2879 __ LoadSmiLiteral(r4, Smi::FromInt(AllocateTargetSpace::encode(OLD_SPACE))); |
2880 __ Push(r3, r4); | 2880 __ Push(r3, r4); |
2881 __ LoadSmiLiteral(cp, Smi::kZero); | 2881 __ LoadSmiLiteral(cp, Smi::FromInt(0)); |
2882 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); | 2882 __ TailCallRuntime(Runtime::kAllocateInTargetSpace); |
2883 } | 2883 } |
2884 | 2884 |
2885 // static | 2885 // static |
2886 void Builtins::Generate_Abort(MacroAssembler* masm) { | 2886 void Builtins::Generate_Abort(MacroAssembler* masm) { |
2887 // ----------- S t a t e ------------- | 2887 // ----------- S t a t e ------------- |
2888 // -- r3 : message_id as Smi | 2888 // -- r3 : message_id as Smi |
2889 // -- lr : return address | 2889 // -- lr : return address |
2890 // ----------------------------------- | 2890 // ----------------------------------- |
2891 __ push(r3); | 2891 __ push(r3); |
2892 __ LoadSmiLiteral(cp, Smi::kZero); | 2892 __ LoadSmiLiteral(cp, Smi::FromInt(0)); |
2893 __ TailCallRuntime(Runtime::kAbort); | 2893 __ TailCallRuntime(Runtime::kAbort); |
2894 } | 2894 } |
2895 | 2895 |
2896 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { | 2896 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
2897 // ----------- S t a t e ------------- | 2897 // ----------- S t a t e ------------- |
2898 // -- r2 : actual number of arguments | 2898 // -- r2 : actual number of arguments |
2899 // -- r3 : function (passed through to callee) | 2899 // -- r3 : function (passed through to callee) |
2900 // -- r4 : expected number of arguments | 2900 // -- r4 : expected number of arguments |
2901 // -- r5 : new target (passed through to callee) | 2901 // -- r5 : new target (passed through to callee) |
2902 // ----------------------------------- | 2902 // ----------------------------------- |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3023 __ bkpt(0); | 3023 __ bkpt(0); |
3024 } | 3024 } |
3025 } | 3025 } |
3026 | 3026 |
3027 #undef __ | 3027 #undef __ |
3028 | 3028 |
3029 } // namespace internal | 3029 } // namespace internal |
3030 } // namespace v8 | 3030 } // namespace v8 |
3031 | 3031 |
3032 #endif // V8_TARGET_ARCH_S390 | 3032 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |