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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // parameter to a number first using the ToNumber builtin if necessary. | 158 // parameter to a number first using the ToNumber builtin if necessary. |
159 Label convert, convert_smi, convert_number, done_convert; | 159 Label convert, convert_smi, convert_number, done_convert; |
160 __ bind(&convert); | 160 __ bind(&convert); |
161 __ JumpIfSmi(r4, &convert_smi); | 161 __ JumpIfSmi(r4, &convert_smi); |
162 __ LoadP(r5, FieldMemOperand(r4, HeapObject::kMapOffset)); | 162 __ LoadP(r5, FieldMemOperand(r4, HeapObject::kMapOffset)); |
163 __ JumpIfRoot(r5, Heap::kHeapNumberMapRootIndex, &convert_number); | 163 __ JumpIfRoot(r5, Heap::kHeapNumberMapRootIndex, &convert_number); |
164 { | 164 { |
165 // Parameter is not a Number, use the ToNumber builtin to convert it. | 165 // Parameter is not a Number, use the ToNumber builtin to convert it. |
166 DCHECK(!FLAG_enable_embedded_constant_pool); | 166 DCHECK(!FLAG_enable_embedded_constant_pool); |
167 FrameScope scope(masm, StackFrame::MANUAL); | 167 FrameScope scope(masm, StackFrame::MANUAL); |
168 __ PushStandardFrame(r3); | |
169 __ SmiTag(r2); | 168 __ SmiTag(r2); |
170 __ SmiTag(r6); | 169 __ SmiTag(r6); |
171 __ Push(r2, r6, r7); | 170 __ EnterBuiltinFrame(cp, r3, r2); |
| 171 __ Push(r6, r7); |
172 __ LoadRR(r2, r4); | 172 __ LoadRR(r2, r4); |
173 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); | 173 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); |
174 __ LoadRR(r4, r2); | 174 __ LoadRR(r4, r2); |
175 __ Pop(r2, r6, r7); | 175 __ Pop(r6, r7); |
| 176 __ LeaveBuiltinFrame(cp, r3, r2); |
| 177 __ SmiUntag(r6); |
| 178 __ SmiUntag(r2); |
176 { | 179 { |
177 // Restore the double accumulator value (d1). | 180 // Restore the double accumulator value (d1). |
178 Label done_restore; | 181 Label done_restore; |
179 __ SmiToDouble(d1, r7); | 182 __ SmiToDouble(d1, r7); |
180 __ JumpIfSmi(r7, &done_restore); | 183 __ JumpIfSmi(r7, &done_restore); |
181 __ LoadDouble(d1, FieldMemOperand(r7, HeapNumber::kValueOffset)); | 184 __ LoadDouble(d1, FieldMemOperand(r7, HeapNumber::kValueOffset)); |
182 __ bind(&done_restore); | 185 __ bind(&done_restore); |
183 } | 186 } |
184 __ SmiUntag(r6); | |
185 __ SmiUntag(r2); | |
186 __ Pop(r14, fp, cp, r3); | |
187 } | 187 } |
188 __ b(&convert); | 188 __ b(&convert); |
189 __ bind(&convert_number); | 189 __ bind(&convert_number); |
190 __ LoadDouble(d2, FieldMemOperand(r4, HeapNumber::kValueOffset)); | 190 __ LoadDouble(d2, FieldMemOperand(r4, HeapNumber::kValueOffset)); |
191 __ b(&done_convert); | 191 __ b(&done_convert); |
192 __ bind(&convert_smi); | 192 __ bind(&convert_smi); |
193 __ SmiToDouble(d2, r4); | 193 __ SmiToDouble(d2, r4); |
194 __ bind(&done_convert); | 194 __ bind(&done_convert); |
195 | 195 |
196 // Perform the actual comparison with the accumulator value on the left hand | 196 // Perform the actual comparison with the accumulator value on the left hand |
(...skipping 28 matching lines...) Expand all Loading... |
225 __ Drop(r2); | 225 __ Drop(r2); |
226 __ LoadRR(r2, r7); | 226 __ LoadRR(r2, r7); |
227 __ Ret(); | 227 __ Ret(); |
228 } | 228 } |
229 | 229 |
230 // static | 230 // static |
231 void Builtins::Generate_NumberConstructor(MacroAssembler* masm) { | 231 void Builtins::Generate_NumberConstructor(MacroAssembler* masm) { |
232 // ----------- S t a t e ------------- | 232 // ----------- S t a t e ------------- |
233 // -- r2 : number of arguments | 233 // -- r2 : number of arguments |
234 // -- r3 : constructor function | 234 // -- r3 : constructor function |
| 235 // -- cp : context |
235 // -- lr : return address | 236 // -- lr : return address |
236 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) | 237 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) |
237 // -- sp[argc * 4] : receiver | 238 // -- sp[argc * 4] : receiver |
238 // ----------------------------------- | 239 // ----------------------------------- |
239 | 240 |
240 // 1. Load the first argument into r2 and get rid of the rest (including the | 241 // 1. Load the first argument into r2. |
241 // receiver). | |
242 Label no_arguments; | 242 Label no_arguments; |
243 { | 243 { |
| 244 __ LoadRR(r4, r2); // Store argc in r4. |
244 __ CmpP(r2, Operand::Zero()); | 245 __ CmpP(r2, Operand::Zero()); |
245 __ beq(&no_arguments); | 246 __ beq(&no_arguments); |
246 __ SubP(r2, r2, Operand(1)); | 247 __ SubP(r2, r2, Operand(1)); |
247 __ ShiftLeftP(r2, r2, Operand(kPointerSizeLog2)); | 248 __ ShiftLeftP(r2, r2, Operand(kPointerSizeLog2)); |
248 __ la(sp, MemOperand(sp, r2)); | 249 __ LoadP(r2, MemOperand(sp, r2)); |
249 __ LoadP(r2, MemOperand(sp)); | |
250 __ Drop(2); | |
251 } | 250 } |
252 | 251 |
253 // 2a. Convert the first argument to a number. | 252 // 2a. Convert the first argument to a number. |
254 __ Jump(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); | 253 { |
| 254 FrameScope scope(masm, StackFrame::MANUAL); |
| 255 __ SmiTag(r4); |
| 256 __ EnterBuiltinFrame(cp, r3, r4); |
| 257 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); |
| 258 __ LeaveBuiltinFrame(cp, r3, r4); |
| 259 __ SmiUntag(r4); |
| 260 } |
| 261 |
| 262 { |
| 263 // Drop all arguments including the receiver. |
| 264 __ Drop(r4); |
| 265 __ Ret(1); |
| 266 } |
255 | 267 |
256 // 2b. No arguments, return +0. | 268 // 2b. No arguments, return +0. |
257 __ bind(&no_arguments); | 269 __ bind(&no_arguments); |
258 __ LoadSmiLiteral(r2, Smi::FromInt(0)); | 270 __ LoadSmiLiteral(r2, Smi::FromInt(0)); |
259 __ Ret(1); | 271 __ Ret(1); |
260 } | 272 } |
261 | 273 |
262 // static | 274 // static |
263 void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) { | 275 void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) { |
264 // ----------- S t a t e ------------- | 276 // ----------- S t a t e ------------- |
265 // -- r2 : number of arguments | 277 // -- r2 : number of arguments |
266 // -- r3 : constructor function | 278 // -- r3 : constructor function |
267 // -- r5 : new target | 279 // -- r5 : new target |
268 // -- lr : return address | 280 // -- lr : return address |
269 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) | 281 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) |
270 // -- sp[argc * 4] : receiver | 282 // -- sp[argc * 4] : receiver |
271 // ----------------------------------- | 283 // ----------------------------------- |
272 | 284 |
273 // 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. |
274 __ LoadP(cp, FieldMemOperand(r3, JSFunction::kContextOffset)); | 286 __ LoadP(cp, FieldMemOperand(r3, JSFunction::kContextOffset)); |
275 | 287 |
276 // 2. Load the first argument into r4 and get rid of the rest (including the | 288 // 2. Load the first argument into r4. |
277 // receiver). | |
278 { | 289 { |
279 Label no_arguments, done; | 290 Label no_arguments, done; |
| 291 __ LoadRR(r8, r2); // Store argc in r8. |
280 __ CmpP(r2, Operand::Zero()); | 292 __ CmpP(r2, Operand::Zero()); |
281 __ beq(&no_arguments); | 293 __ beq(&no_arguments); |
282 __ SubP(r2, r2, Operand(1)); | 294 __ SubP(r2, r2, Operand(1)); |
283 __ ShiftLeftP(r4, r2, Operand(kPointerSizeLog2)); | 295 __ ShiftLeftP(r4, r2, Operand(kPointerSizeLog2)); |
284 __ la(sp, MemOperand(sp, r4)); | 296 __ LoadP(r4, MemOperand(sp, r4)); |
285 __ LoadP(r4, MemOperand(sp)); | |
286 __ Drop(2); | |
287 __ b(&done); | 297 __ b(&done); |
288 __ bind(&no_arguments); | 298 __ bind(&no_arguments); |
289 __ LoadSmiLiteral(r4, Smi::FromInt(0)); | 299 __ LoadSmiLiteral(r4, Smi::FromInt(0)); |
290 __ Drop(1); | |
291 __ bind(&done); | 300 __ bind(&done); |
292 } | 301 } |
293 | 302 |
294 // 3. Make sure r4 is a number. | 303 // 3. Make sure r4 is a number. |
295 { | 304 { |
296 Label done_convert; | 305 Label done_convert; |
297 __ JumpIfSmi(r4, &done_convert); | 306 __ JumpIfSmi(r4, &done_convert); |
298 __ CompareObjectType(r4, r6, r6, HEAP_NUMBER_TYPE); | 307 __ CompareObjectType(r4, r6, r6, HEAP_NUMBER_TYPE); |
299 __ beq(&done_convert); | 308 __ beq(&done_convert); |
300 { | 309 { |
301 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 310 FrameScope scope(masm, StackFrame::MANUAL); |
302 __ Push(r3, r5); | 311 __ SmiTag(r8); |
| 312 __ EnterBuiltinFrame(cp, r3, r8); |
| 313 __ Push(r5); |
303 __ LoadRR(r2, r4); | 314 __ LoadRR(r2, r4); |
304 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); | 315 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); |
305 __ LoadRR(r4, r2); | 316 __ LoadRR(r4, r2); |
306 __ Pop(r3, r5); | 317 __ Pop(r5); |
| 318 __ LeaveBuiltinFrame(cp, r3, r8); |
| 319 __ SmiUntag(r8); |
307 } | 320 } |
308 __ bind(&done_convert); | 321 __ bind(&done_convert); |
309 } | 322 } |
310 | 323 |
311 // 4. Check if new target and constructor differ. | 324 // 4. Check if new target and constructor differ. |
312 Label new_object; | 325 Label drop_frame_and_ret, new_object; |
313 __ CmpP(r3, r5); | 326 __ CmpP(r3, r5); |
314 __ bne(&new_object); | 327 __ bne(&new_object); |
315 | 328 |
316 // 5. Allocate a JSValue wrapper for the number. | 329 // 5. Allocate a JSValue wrapper for the number. |
317 __ AllocateJSValue(r2, r3, r4, r6, r7, &new_object); | 330 __ AllocateJSValue(r2, r3, r4, r6, r7, &new_object); |
318 __ Ret(); | 331 __ b(&drop_frame_and_ret); |
319 | 332 |
320 // 6. Fallback to the runtime to create new object. | 333 // 6. Fallback to the runtime to create new object. |
321 __ bind(&new_object); | 334 __ bind(&new_object); |
322 { | 335 { |
323 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 336 FrameScope scope(masm, StackFrame::MANUAL); |
| 337 FastNewObjectStub stub(masm->isolate()); |
| 338 __ SmiTag(r8); |
| 339 __ EnterBuiltinFrame(cp, r3, r8); |
324 __ Push(r4); // first argument | 340 __ Push(r4); // first argument |
325 FastNewObjectStub stub(masm->isolate()); | |
326 __ CallStub(&stub); | 341 __ CallStub(&stub); |
327 __ Pop(r4); | 342 __ Pop(r4); |
| 343 __ LeaveBuiltinFrame(cp, r3, r8); |
| 344 __ SmiUntag(r8); |
328 } | 345 } |
329 __ StoreP(r4, FieldMemOperand(r2, JSValue::kValueOffset), r0); | 346 __ StoreP(r4, FieldMemOperand(r2, JSValue::kValueOffset), r0); |
330 __ Ret(); | 347 |
| 348 __ bind(&drop_frame_and_ret); |
| 349 { |
| 350 __ Drop(r8); |
| 351 __ Ret(1); |
| 352 } |
331 } | 353 } |
332 | 354 |
333 // static | 355 // static |
334 void Builtins::Generate_StringConstructor(MacroAssembler* masm) { | 356 void Builtins::Generate_StringConstructor(MacroAssembler* masm) { |
335 // ----------- S t a t e ------------- | 357 // ----------- S t a t e ------------- |
336 // -- r2 : number of arguments | 358 // -- r2 : number of arguments |
337 // -- r3 : constructor function | 359 // -- r3 : constructor function |
| 360 // -- cp : context |
338 // -- lr : return address | 361 // -- lr : return address |
339 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) | 362 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) |
340 // -- sp[argc * 4] : receiver | 363 // -- sp[argc * 4] : receiver |
341 // ----------------------------------- | 364 // ----------------------------------- |
342 // 1. Load the first argument into r2 and get rid of the rest (including the | 365 // 1. Load the first argument into r2. |
343 // receiver). | |
344 Label no_arguments; | 366 Label no_arguments; |
345 { | 367 { |
| 368 __ LoadRR(r4, r2); // Store argc in r4 |
346 __ CmpP(r2, Operand::Zero()); | 369 __ CmpP(r2, Operand::Zero()); |
347 __ beq(&no_arguments); | 370 __ beq(&no_arguments); |
348 __ SubP(r2, r2, Operand(1)); | 371 __ SubP(r2, r2, Operand(1)); |
349 __ ShiftLeftP(r2, r2, Operand(kPointerSizeLog2)); | 372 __ ShiftLeftP(r2, r2, Operand(kPointerSizeLog2)); |
350 __ lay(sp, MemOperand(sp, r2)); | 373 __ LoadP(r2, MemOperand(sp, r2)); |
351 __ LoadP(r2, MemOperand(sp)); | |
352 __ Drop(2); | |
353 } | 374 } |
354 | 375 |
355 // 2a. At least one argument, return r2 if it's a string, otherwise | 376 // 2a. At least one argument, return r2 if it's a string, otherwise |
356 // dispatch to appropriate conversion. | 377 // dispatch to appropriate conversion. |
357 Label to_string, symbol_descriptive_string; | 378 Label drop_frame_and_ret, to_string, symbol_descriptive_string; |
358 { | 379 { |
359 __ JumpIfSmi(r2, &to_string); | 380 __ JumpIfSmi(r2, &to_string); |
360 STATIC_ASSERT(FIRST_NONSTRING_TYPE == SYMBOL_TYPE); | 381 STATIC_ASSERT(FIRST_NONSTRING_TYPE == SYMBOL_TYPE); |
361 __ CompareObjectType(r2, r3, r3, FIRST_NONSTRING_TYPE); | 382 __ CompareObjectType(r2, r5, r5, FIRST_NONSTRING_TYPE); |
362 __ bgt(&to_string); | 383 __ bgt(&to_string); |
363 __ beq(&symbol_descriptive_string); | 384 __ beq(&symbol_descriptive_string); |
364 __ Ret(); | 385 __ b(&drop_frame_and_ret); |
365 } | 386 } |
366 | 387 |
367 // 2b. No arguments, return the empty string (and pop the receiver). | 388 // 2b. No arguments, return the empty string (and pop the receiver). |
368 __ bind(&no_arguments); | 389 __ bind(&no_arguments); |
369 { | 390 { |
370 __ LoadRoot(r2, Heap::kempty_stringRootIndex); | 391 __ LoadRoot(r2, Heap::kempty_stringRootIndex); |
371 __ Ret(1); | 392 __ Ret(1); |
372 } | 393 } |
373 | 394 |
374 // 3a. Convert r2 to a string. | 395 // 3a. Convert r2 to a string. |
375 __ bind(&to_string); | 396 __ bind(&to_string); |
376 { | 397 { |
| 398 FrameScope scope(masm, StackFrame::MANUAL); |
377 ToStringStub stub(masm->isolate()); | 399 ToStringStub stub(masm->isolate()); |
378 __ TailCallStub(&stub); | 400 __ SmiTag(r4); |
| 401 __ EnterBuiltinFrame(cp, r3, r4); |
| 402 __ CallStub(&stub); |
| 403 __ LeaveBuiltinFrame(cp, r3, r4); |
| 404 __ SmiUntag(r4); |
379 } | 405 } |
| 406 __ b(&drop_frame_and_ret); |
380 // 3b. Convert symbol in r2 to a string. | 407 // 3b. Convert symbol in r2 to a string. |
381 __ bind(&symbol_descriptive_string); | 408 __ bind(&symbol_descriptive_string); |
382 { | 409 { |
| 410 __ Drop(r4); |
| 411 __ Drop(1); |
383 __ Push(r2); | 412 __ Push(r2); |
384 __ TailCallRuntime(Runtime::kSymbolDescriptiveString); | 413 __ TailCallRuntime(Runtime::kSymbolDescriptiveString); |
385 } | 414 } |
| 415 |
| 416 __ bind(&drop_frame_and_ret); |
| 417 { |
| 418 __ Drop(r4); |
| 419 __ Ret(1); |
| 420 } |
386 } | 421 } |
387 | 422 |
388 // static | 423 // static |
389 void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) { | 424 void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) { |
390 // ----------- S t a t e ------------- | 425 // ----------- S t a t e ------------- |
391 // -- r2 : number of arguments | 426 // -- r2 : number of arguments |
392 // -- r3 : constructor function | 427 // -- r3 : constructor function |
393 // -- r5 : new target | 428 // -- r5 : new target |
| 429 // -- cp : context |
394 // -- lr : return address | 430 // -- lr : return address |
395 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) | 431 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) |
396 // -- sp[argc * 4] : receiver | 432 // -- sp[argc * 4] : receiver |
397 // ----------------------------------- | 433 // ----------------------------------- |
398 | 434 |
399 // 1. Make sure we operate in the context of the called function. | 435 // 1. Make sure we operate in the context of the called function. |
400 __ LoadP(cp, FieldMemOperand(r3, JSFunction::kContextOffset)); | 436 __ LoadP(cp, FieldMemOperand(r3, JSFunction::kContextOffset)); |
401 | 437 |
402 // 2. Load the first argument into r4 and get rid of the rest (including the | 438 // 2. Load the first argument into r4. |
403 // receiver). | |
404 { | 439 { |
405 Label no_arguments, done; | 440 Label no_arguments, done; |
| 441 __ LoadRR(r8, r2); // Store argc in r8. |
406 __ CmpP(r2, Operand::Zero()); | 442 __ CmpP(r2, Operand::Zero()); |
407 __ beq(&no_arguments); | 443 __ beq(&no_arguments); |
408 __ SubP(r2, r2, Operand(1)); | 444 __ SubP(r2, r2, Operand(1)); |
409 __ ShiftLeftP(r4, r2, Operand(kPointerSizeLog2)); | 445 __ ShiftLeftP(r4, r2, Operand(kPointerSizeLog2)); |
410 __ lay(sp, MemOperand(sp, r4)); | 446 __ LoadP(r4, MemOperand(sp, r4)); |
411 __ LoadP(r4, MemOperand(sp)); | |
412 __ Drop(2); | |
413 __ b(&done); | 447 __ b(&done); |
414 __ bind(&no_arguments); | 448 __ bind(&no_arguments); |
415 __ LoadRoot(r4, Heap::kempty_stringRootIndex); | 449 __ LoadRoot(r4, Heap::kempty_stringRootIndex); |
416 __ Drop(1); | |
417 __ bind(&done); | 450 __ bind(&done); |
418 } | 451 } |
419 | 452 |
420 // 3. Make sure r4 is a string. | 453 // 3. Make sure r4 is a string. |
421 { | 454 { |
422 Label convert, done_convert; | 455 Label convert, done_convert; |
423 __ JumpIfSmi(r4, &convert); | 456 __ JumpIfSmi(r4, &convert); |
424 __ CompareObjectType(r4, r6, r6, FIRST_NONSTRING_TYPE); | 457 __ CompareObjectType(r4, r6, r6, FIRST_NONSTRING_TYPE); |
425 __ blt(&done_convert); | 458 __ blt(&done_convert); |
426 __ bind(&convert); | 459 __ bind(&convert); |
427 { | 460 { |
428 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 461 FrameScope scope(masm, StackFrame::MANUAL); |
429 ToStringStub stub(masm->isolate()); | 462 ToStringStub stub(masm->isolate()); |
430 __ Push(r3, r5); | 463 __ SmiTag(r8); |
| 464 __ EnterBuiltinFrame(cp, r3, r8); |
| 465 __ Push(r5); |
431 __ LoadRR(r2, r4); | 466 __ LoadRR(r2, r4); |
432 __ CallStub(&stub); | 467 __ CallStub(&stub); |
433 __ LoadRR(r4, r2); | 468 __ LoadRR(r4, r2); |
434 __ Pop(r3, r5); | 469 __ Pop(r5); |
| 470 __ LeaveBuiltinFrame(cp, r3, r8); |
| 471 __ SmiUntag(r8); |
435 } | 472 } |
436 __ bind(&done_convert); | 473 __ bind(&done_convert); |
437 } | 474 } |
438 | 475 |
439 // 4. Check if new target and constructor differ. | 476 // 4. Check if new target and constructor differ. |
440 Label new_object; | 477 Label drop_frame_and_ret, new_object; |
441 __ CmpP(r3, r5); | 478 __ CmpP(r3, r5); |
442 __ bne(&new_object); | 479 __ bne(&new_object); |
443 | 480 |
444 // 5. Allocate a JSValue wrapper for the string. | 481 // 5. Allocate a JSValue wrapper for the string. |
445 __ AllocateJSValue(r2, r3, r4, r6, r7, &new_object); | 482 __ AllocateJSValue(r2, r3, r4, r6, r7, &new_object); |
446 __ Ret(); | 483 __ b(&drop_frame_and_ret); |
447 | 484 |
448 // 6. Fallback to the runtime to create new object. | 485 // 6. Fallback to the runtime to create new object. |
449 __ bind(&new_object); | 486 __ bind(&new_object); |
450 { | 487 { |
451 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 488 FrameScope scope(masm, StackFrame::MANUAL); |
| 489 FastNewObjectStub stub(masm->isolate()); |
| 490 __ SmiTag(r8); |
| 491 __ EnterBuiltinFrame(cp, r3, r8); |
452 __ Push(r4); // first argument | 492 __ Push(r4); // first argument |
453 FastNewObjectStub stub(masm->isolate()); | |
454 __ CallStub(&stub); | 493 __ CallStub(&stub); |
455 __ Pop(r4); | 494 __ Pop(r4); |
| 495 __ LeaveBuiltinFrame(cp, r3, r8); |
| 496 __ SmiUntag(r8); |
456 } | 497 } |
457 __ StoreP(r4, FieldMemOperand(r2, JSValue::kValueOffset), r0); | 498 __ StoreP(r4, FieldMemOperand(r2, JSValue::kValueOffset), r0); |
458 __ Ret(); | 499 |
| 500 __ bind(&drop_frame_and_ret); |
| 501 { |
| 502 __ Drop(r8); |
| 503 __ Ret(1); |
| 504 } |
459 } | 505 } |
460 | 506 |
461 static void GenerateTailCallToSharedCode(MacroAssembler* masm) { | 507 static void GenerateTailCallToSharedCode(MacroAssembler* masm) { |
462 __ LoadP(ip, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); | 508 __ LoadP(ip, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset)); |
463 __ LoadP(ip, FieldMemOperand(ip, SharedFunctionInfo::kCodeOffset)); | 509 __ LoadP(ip, FieldMemOperand(ip, SharedFunctionInfo::kCodeOffset)); |
464 __ AddP(ip, Operand(Code::kHeaderSize - kHeapObjectTag)); | 510 __ AddP(ip, Operand(Code::kHeaderSize - kHeapObjectTag)); |
465 __ JumpToJSEntry(ip); | 511 __ JumpToJSEntry(ip); |
466 } | 512 } |
467 | 513 |
468 static void GenerateTailCallToReturnedCode(MacroAssembler* masm, | 514 static void GenerateTailCallToReturnedCode(MacroAssembler* masm, |
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1785 __ CallCFunction( | 1831 __ CallCFunction( |
1786 ExternalReference::get_date_field_function(masm->isolate()), 2); | 1832 ExternalReference::get_date_field_function(masm->isolate()), 2); |
1787 } | 1833 } |
1788 __ Ret(); | 1834 __ Ret(); |
1789 | 1835 |
1790 // 3. Raise a TypeError if the receiver is not a date. | 1836 // 3. Raise a TypeError if the receiver is not a date. |
1791 __ bind(&receiver_not_date); | 1837 __ bind(&receiver_not_date); |
1792 { | 1838 { |
1793 FrameScope scope(masm, StackFrame::MANUAL); | 1839 FrameScope scope(masm, StackFrame::MANUAL); |
1794 __ push(r2); | 1840 __ push(r2); |
1795 __ PushStandardFrame(r3); | 1841 __ LoadSmiLiteral(r2, Smi::FromInt(0)); |
1796 __ LoadSmiLiteral(r6, Smi::FromInt(0)); | 1842 __ EnterBuiltinFrame(cp, r3, r2); |
1797 __ push(r6); | |
1798 __ CallRuntime(Runtime::kThrowNotDateError); | 1843 __ CallRuntime(Runtime::kThrowNotDateError); |
1799 } | 1844 } |
1800 } | 1845 } |
1801 | 1846 |
1802 // static | 1847 // static |
1803 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { | 1848 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { |
1804 // ----------- S t a t e ------------- | 1849 // ----------- S t a t e ------------- |
1805 // -- r2 : argc | 1850 // -- r2 : argc |
1806 // -- sp[0] : argArray | 1851 // -- sp[0] : argArray |
1807 // -- sp[4] : thisArg | 1852 // -- sp[4] : thisArg |
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2962 __ bkpt(0); | 3007 __ bkpt(0); |
2963 } | 3008 } |
2964 } | 3009 } |
2965 | 3010 |
2966 #undef __ | 3011 #undef __ |
2967 | 3012 |
2968 } // namespace internal | 3013 } // namespace internal |
2969 } // namespace v8 | 3014 } // namespace v8 |
2970 | 3015 |
2971 #endif // V8_TARGET_ARCH_S390 | 3016 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |