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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // Load the double value of the parameter into d2, maybe converting the | 165 // Load the double value of the parameter into d2, maybe converting the |
166 // parameter to a number first using the ToNumber builtin if necessary. | 166 // parameter to a number first using the ToNumber builtin if necessary. |
167 Label convert, convert_smi, convert_number, done_convert; | 167 Label convert, convert_smi, convert_number, done_convert; |
168 __ bind(&convert); | 168 __ bind(&convert); |
169 __ JumpIfSmi(r5, &convert_smi); | 169 __ JumpIfSmi(r5, &convert_smi); |
170 __ LoadP(r6, FieldMemOperand(r5, HeapObject::kMapOffset)); | 170 __ LoadP(r6, FieldMemOperand(r5, HeapObject::kMapOffset)); |
171 __ JumpIfRoot(r6, Heap::kHeapNumberMapRootIndex, &convert_number); | 171 __ JumpIfRoot(r6, Heap::kHeapNumberMapRootIndex, &convert_number); |
172 { | 172 { |
173 // Parameter is not a Number, use the ToNumber builtin to convert it. | 173 // Parameter is not a Number, use the ToNumber builtin to convert it. |
174 FrameScope scope(masm, StackFrame::MANUAL); | 174 FrameScope scope(masm, StackFrame::MANUAL); |
175 __ PushStandardFrame(r4); | |
176 __ SmiTag(r3); | 175 __ SmiTag(r3); |
177 __ SmiTag(r7); | 176 __ SmiTag(r7); |
178 __ Push(r3, r7, r8); | 177 __ EnterBuiltinFrame(cp, r4, r3); |
| 178 __ Push(r7, r8); |
179 __ mr(r3, r5); | 179 __ mr(r3, r5); |
180 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); | 180 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); |
181 __ mr(r5, r3); | 181 __ mr(r5, r3); |
182 __ Pop(r3, r7, r8); | 182 __ Pop(r7, r8); |
| 183 __ LeaveBuiltinFrame(cp, r4, r3); |
| 184 __ SmiUntag(r7); |
| 185 __ SmiUntag(r3); |
183 { | 186 { |
184 // Restore the double accumulator value (d1). | 187 // Restore the double accumulator value (d1). |
185 Label done_restore; | 188 Label done_restore; |
186 __ SmiToDouble(d1, r8); | 189 __ SmiToDouble(d1, r8); |
187 __ JumpIfSmi(r8, &done_restore); | 190 __ JumpIfSmi(r8, &done_restore); |
188 __ lfd(d1, FieldMemOperand(r8, HeapNumber::kValueOffset)); | 191 __ lfd(d1, FieldMemOperand(r8, HeapNumber::kValueOffset)); |
189 __ bind(&done_restore); | 192 __ bind(&done_restore); |
190 } | 193 } |
191 __ SmiUntag(r7); | |
192 __ SmiUntag(r3); | |
193 // TODO(Jaideep): Add macro furtion for PopStandardFrame | |
194 if (FLAG_enable_embedded_constant_pool) { | |
195 __ Pop(r0, fp, kConstantPoolRegister, cp, r4); | |
196 } else { | |
197 __ Pop(r0, fp, cp, r4); | |
198 } | |
199 __ mtlr(r0); | |
200 } | 194 } |
201 __ b(&convert); | 195 __ b(&convert); |
202 __ bind(&convert_number); | 196 __ bind(&convert_number); |
203 __ lfd(d2, FieldMemOperand(r5, HeapNumber::kValueOffset)); | 197 __ lfd(d2, FieldMemOperand(r5, HeapNumber::kValueOffset)); |
204 __ b(&done_convert); | 198 __ b(&done_convert); |
205 __ bind(&convert_smi); | 199 __ bind(&convert_smi); |
206 __ SmiToDouble(d2, r5); | 200 __ SmiToDouble(d2, r5); |
207 __ bind(&done_convert); | 201 __ bind(&done_convert); |
208 | 202 |
209 // Perform the actual comparison with the accumulator value on the left hand | 203 // Perform the actual comparison with the accumulator value on the left hand |
(...skipping 28 matching lines...) Expand all Loading... |
238 __ Drop(r3); | 232 __ Drop(r3); |
239 __ mr(r3, r8); | 233 __ mr(r3, r8); |
240 __ Ret(); | 234 __ Ret(); |
241 } | 235 } |
242 | 236 |
243 // static | 237 // static |
244 void Builtins::Generate_NumberConstructor(MacroAssembler* masm) { | 238 void Builtins::Generate_NumberConstructor(MacroAssembler* masm) { |
245 // ----------- S t a t e ------------- | 239 // ----------- S t a t e ------------- |
246 // -- r3 : number of arguments | 240 // -- r3 : number of arguments |
247 // -- r4 : constructor function | 241 // -- r4 : constructor function |
| 242 // -- cp : context |
248 // -- lr : return address | 243 // -- lr : return address |
249 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) | 244 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) |
250 // -- sp[argc * 4] : receiver | 245 // -- sp[argc * 4] : receiver |
251 // ----------------------------------- | 246 // ----------------------------------- |
252 | 247 |
253 // 1. Load the first argument into r3 and get rid of the rest (including the | 248 // 1. Load the first argument into r3. |
254 // receiver). | |
255 Label no_arguments; | 249 Label no_arguments; |
256 { | 250 { |
| 251 __ mr(r5, r3); // Store argc in r5. |
257 __ cmpi(r3, Operand::Zero()); | 252 __ cmpi(r3, Operand::Zero()); |
258 __ beq(&no_arguments); | 253 __ beq(&no_arguments); |
259 __ subi(r3, r3, Operand(1)); | 254 __ subi(r3, r3, Operand(1)); |
260 __ ShiftLeftImm(r3, r3, Operand(kPointerSizeLog2)); | 255 __ ShiftLeftImm(r3, r3, Operand(kPointerSizeLog2)); |
261 __ LoadPUX(r3, MemOperand(sp, r3)); | 256 __ LoadPX(r3, MemOperand(sp, r3)); |
262 __ Drop(2); | |
263 } | 257 } |
264 | 258 |
265 // 2a. Convert the first argument to a number. | 259 // 2a. Convert the first argument to a number. |
266 __ Jump(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); | 260 { |
| 261 FrameScope scope(masm, StackFrame::MANUAL); |
| 262 __ SmiTag(r5); |
| 263 __ EnterBuiltinFrame(cp, r4, r5); |
| 264 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); |
| 265 __ LeaveBuiltinFrame(cp, r4, r5); |
| 266 __ SmiUntag(r5); |
| 267 } |
| 268 |
| 269 { |
| 270 // Drop all arguments including the receiver. |
| 271 __ Drop(r5); |
| 272 __ Ret(1); |
| 273 } |
267 | 274 |
268 // 2b. No arguments, return +0. | 275 // 2b. No arguments, return +0. |
269 __ bind(&no_arguments); | 276 __ bind(&no_arguments); |
270 __ LoadSmiLiteral(r3, Smi::FromInt(0)); | 277 __ LoadSmiLiteral(r3, Smi::FromInt(0)); |
271 __ Ret(1); | 278 __ Ret(1); |
272 } | 279 } |
273 | 280 |
274 | 281 |
275 // static | 282 // static |
276 void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) { | 283 void Builtins::Generate_NumberConstructor_ConstructStub(MacroAssembler* masm) { |
277 // ----------- S t a t e ------------- | 284 // ----------- S t a t e ------------- |
278 // -- r3 : number of arguments | 285 // -- r3 : number of arguments |
279 // -- r4 : constructor function | 286 // -- r4 : constructor function |
280 // -- r6 : new target | 287 // -- r6 : new target |
| 288 // -- cp : context |
281 // -- lr : return address | 289 // -- lr : return address |
282 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) | 290 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) |
283 // -- sp[argc * 4] : receiver | 291 // -- sp[argc * 4] : receiver |
284 // ----------------------------------- | 292 // ----------------------------------- |
285 | 293 |
286 // 1. Make sure we operate in the context of the called function. | 294 // 1. Make sure we operate in the context of the called function. |
287 __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); | 295 __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); |
288 | 296 |
289 // 2. Load the first argument into r5 and get rid of the rest (including the | 297 // 2. Load the first argument into r5. |
290 // receiver). | |
291 { | 298 { |
292 Label no_arguments, done; | 299 Label no_arguments, done; |
| 300 __ mr(r9, r3); // Store argc in r9. |
293 __ cmpi(r3, Operand::Zero()); | 301 __ cmpi(r3, Operand::Zero()); |
294 __ beq(&no_arguments); | 302 __ beq(&no_arguments); |
295 __ subi(r3, r3, Operand(1)); | 303 __ subi(r3, r3, Operand(1)); |
296 __ ShiftLeftImm(r5, r3, Operand(kPointerSizeLog2)); | 304 __ ShiftLeftImm(r5, r3, Operand(kPointerSizeLog2)); |
297 __ LoadPUX(r5, MemOperand(sp, r5)); | 305 __ LoadPX(r5, MemOperand(sp, r5)); |
298 __ Drop(2); | |
299 __ b(&done); | 306 __ b(&done); |
300 __ bind(&no_arguments); | 307 __ bind(&no_arguments); |
301 __ LoadSmiLiteral(r5, Smi::FromInt(0)); | 308 __ LoadSmiLiteral(r5, Smi::FromInt(0)); |
302 __ Drop(1); | |
303 __ bind(&done); | 309 __ bind(&done); |
304 } | 310 } |
305 | 311 |
306 // 3. Make sure r5 is a number. | 312 // 3. Make sure r5 is a number. |
307 { | 313 { |
308 Label done_convert; | 314 Label done_convert; |
309 __ JumpIfSmi(r5, &done_convert); | 315 __ JumpIfSmi(r5, &done_convert); |
310 __ CompareObjectType(r5, r7, r7, HEAP_NUMBER_TYPE); | 316 __ CompareObjectType(r5, r7, r7, HEAP_NUMBER_TYPE); |
311 __ beq(&done_convert); | 317 __ beq(&done_convert); |
312 { | 318 { |
313 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 319 FrameScope scope(masm, StackFrame::MANUAL); |
314 __ Push(r4, r6); | 320 __ SmiTag(r9); |
| 321 __ EnterBuiltinFrame(cp, r4, r9); |
| 322 __ Push(r6); |
315 __ mr(r3, r5); | 323 __ mr(r3, r5); |
316 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); | 324 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET); |
317 __ mr(r5, r3); | 325 __ mr(r5, r3); |
318 __ Pop(r4, r6); | 326 __ Pop(r6); |
| 327 __ LeaveBuiltinFrame(cp, r4, r9); |
| 328 __ SmiUntag(r9); |
319 } | 329 } |
320 __ bind(&done_convert); | 330 __ bind(&done_convert); |
321 } | 331 } |
322 | 332 |
323 // 4. Check if new target and constructor differ. | 333 // 4. Check if new target and constructor differ. |
324 Label new_object; | 334 Label drop_frame_and_ret, new_object; |
325 __ cmp(r4, r6); | 335 __ cmp(r4, r6); |
326 __ bne(&new_object); | 336 __ bne(&new_object); |
327 | 337 |
328 // 5. Allocate a JSValue wrapper for the number. | 338 // 5. Allocate a JSValue wrapper for the number. |
329 __ AllocateJSValue(r3, r4, r5, r7, r8, &new_object); | 339 __ AllocateJSValue(r3, r4, r5, r7, r8, &new_object); |
330 __ Ret(); | 340 __ b(&drop_frame_and_ret); |
331 | 341 |
332 // 6. Fallback to the runtime to create new object. | 342 // 6. Fallback to the runtime to create new object. |
333 __ bind(&new_object); | 343 __ bind(&new_object); |
334 { | 344 { |
335 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 345 FrameScope scope(masm, StackFrame::MANUAL); |
| 346 __ SmiTag(r9); |
| 347 __ EnterBuiltinFrame(cp, r4, r9); |
336 __ Push(r5); // first argument | 348 __ Push(r5); // first argument |
337 FastNewObjectStub stub(masm->isolate()); | 349 FastNewObjectStub stub(masm->isolate()); |
338 __ CallStub(&stub); | 350 __ CallStub(&stub); |
339 __ Pop(r5); | 351 __ Pop(r5); |
| 352 __ LeaveBuiltinFrame(cp, r4, r9); |
| 353 __ SmiUntag(r9); |
340 } | 354 } |
341 __ StoreP(r5, FieldMemOperand(r3, JSValue::kValueOffset), r0); | 355 __ StoreP(r5, FieldMemOperand(r3, JSValue::kValueOffset), r0); |
342 __ Ret(); | 356 |
| 357 __ bind(&drop_frame_and_ret); |
| 358 { |
| 359 __ Drop(r9); |
| 360 __ Ret(1); |
| 361 } |
343 } | 362 } |
344 | 363 |
345 | 364 |
346 // static | 365 // static |
347 void Builtins::Generate_StringConstructor(MacroAssembler* masm) { | 366 void Builtins::Generate_StringConstructor(MacroAssembler* masm) { |
348 // ----------- S t a t e ------------- | 367 // ----------- S t a t e ------------- |
349 // -- r3 : number of arguments | 368 // -- r3 : number of arguments |
350 // -- r4 : constructor function | 369 // -- r4 : constructor function |
| 370 // -- cp : context |
351 // -- lr : return address | 371 // -- lr : return address |
352 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) | 372 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) |
353 // -- sp[argc * 4] : receiver | 373 // -- sp[argc * 4] : receiver |
354 // ----------------------------------- | 374 // ----------------------------------- |
355 | 375 |
356 // 1. Load the first argument into r3 and get rid of the rest (including the | 376 // 1. Load the first argument into r3. |
357 // receiver). | |
358 Label no_arguments; | 377 Label no_arguments; |
359 { | 378 { |
| 379 __ mr(r5, r3); // Store argc in r5. |
360 __ cmpi(r3, Operand::Zero()); | 380 __ cmpi(r3, Operand::Zero()); |
361 __ beq(&no_arguments); | 381 __ beq(&no_arguments); |
362 __ subi(r3, r3, Operand(1)); | 382 __ subi(r3, r3, Operand(1)); |
363 __ ShiftLeftImm(r3, r3, Operand(kPointerSizeLog2)); | 383 __ ShiftLeftImm(r3, r3, Operand(kPointerSizeLog2)); |
364 __ LoadPUX(r3, MemOperand(sp, r3)); | 384 __ LoadPX(r3, MemOperand(sp, r3)); |
365 __ Drop(2); | |
366 } | 385 } |
367 | 386 |
368 // 2a. At least one argument, return r3 if it's a string, otherwise | 387 // 2a. At least one argument, return r3 if it's a string, otherwise |
369 // dispatch to appropriate conversion. | 388 // dispatch to appropriate conversion. |
370 Label to_string, symbol_descriptive_string; | 389 Label drop_frame_and_ret, to_string, symbol_descriptive_string; |
371 { | 390 { |
372 __ JumpIfSmi(r3, &to_string); | 391 __ JumpIfSmi(r3, &to_string); |
373 STATIC_ASSERT(FIRST_NONSTRING_TYPE == SYMBOL_TYPE); | 392 STATIC_ASSERT(FIRST_NONSTRING_TYPE == SYMBOL_TYPE); |
374 __ CompareObjectType(r3, r4, r4, FIRST_NONSTRING_TYPE); | 393 __ CompareObjectType(r3, r6, r6, FIRST_NONSTRING_TYPE); |
375 __ bgt(&to_string); | 394 __ bgt(&to_string); |
376 __ beq(&symbol_descriptive_string); | 395 __ beq(&symbol_descriptive_string); |
377 __ Ret(); | 396 __ b(&drop_frame_and_ret); |
378 } | 397 } |
379 | 398 |
380 // 2b. No arguments, return the empty string (and pop the receiver). | 399 // 2b. No arguments, return the empty string (and pop the receiver). |
381 __ bind(&no_arguments); | 400 __ bind(&no_arguments); |
382 { | 401 { |
383 __ LoadRoot(r3, Heap::kempty_stringRootIndex); | 402 __ LoadRoot(r3, Heap::kempty_stringRootIndex); |
384 __ Ret(1); | 403 __ Ret(1); |
385 } | 404 } |
386 | 405 |
387 // 3a. Convert r3 to a string. | 406 // 3a. Convert r3 to a string. |
388 __ bind(&to_string); | 407 __ bind(&to_string); |
389 { | 408 { |
| 409 FrameScope scope(masm, StackFrame::MANUAL); |
390 ToStringStub stub(masm->isolate()); | 410 ToStringStub stub(masm->isolate()); |
391 __ TailCallStub(&stub); | 411 __ SmiTag(r5); |
| 412 __ EnterBuiltinFrame(cp, r4, r5); |
| 413 __ CallStub(&stub); |
| 414 __ LeaveBuiltinFrame(cp, r4, r5); |
| 415 __ SmiUntag(r5); |
392 } | 416 } |
| 417 __ b(&drop_frame_and_ret); |
393 | 418 |
394 // 3b. Convert symbol in r3 to a string. | 419 // 3b. Convert symbol in r3 to a string. |
395 __ bind(&symbol_descriptive_string); | 420 __ bind(&symbol_descriptive_string); |
396 { | 421 { |
| 422 __ Drop(r5); |
| 423 __ Drop(1); |
397 __ Push(r3); | 424 __ Push(r3); |
398 __ TailCallRuntime(Runtime::kSymbolDescriptiveString); | 425 __ TailCallRuntime(Runtime::kSymbolDescriptiveString); |
399 } | 426 } |
| 427 |
| 428 __ bind(&drop_frame_and_ret); |
| 429 { |
| 430 __ Drop(r5); |
| 431 __ Ret(1); |
| 432 } |
400 } | 433 } |
401 | 434 |
402 | |
403 // static | 435 // static |
404 void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) { | 436 void Builtins::Generate_StringConstructor_ConstructStub(MacroAssembler* masm) { |
405 // ----------- S t a t e ------------- | 437 // ----------- S t a t e ------------- |
406 // -- r3 : number of arguments | 438 // -- r3 : number of arguments |
407 // -- r4 : constructor function | 439 // -- r4 : constructor function |
408 // -- r6 : new target | 440 // -- r6 : new target |
| 441 // -- cp : context |
409 // -- lr : return address | 442 // -- lr : return address |
410 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) | 443 // -- sp[(argc - n - 1) * 4] : arg[n] (zero based) |
411 // -- sp[argc * 4] : receiver | 444 // -- sp[argc * 4] : receiver |
412 // ----------------------------------- | 445 // ----------------------------------- |
413 | 446 |
414 // 1. Make sure we operate in the context of the called function. | 447 // 1. Make sure we operate in the context of the called function. |
415 __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); | 448 __ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); |
416 | 449 |
417 // 2. Load the first argument into r5 and get rid of the rest (including the | 450 // 2. Load the first argument into r5. |
418 // receiver). | |
419 { | 451 { |
420 Label no_arguments, done; | 452 Label no_arguments, done; |
| 453 __ mr(r9, r3); // Store argc in r9. |
421 __ cmpi(r3, Operand::Zero()); | 454 __ cmpi(r3, Operand::Zero()); |
422 __ beq(&no_arguments); | 455 __ beq(&no_arguments); |
423 __ subi(r3, r3, Operand(1)); | 456 __ subi(r3, r3, Operand(1)); |
424 __ ShiftLeftImm(r5, r3, Operand(kPointerSizeLog2)); | 457 __ ShiftLeftImm(r5, r3, Operand(kPointerSizeLog2)); |
425 __ LoadPUX(r5, MemOperand(sp, r5)); | 458 __ LoadPX(r5, MemOperand(sp, r5)); |
426 __ Drop(2); | |
427 __ b(&done); | 459 __ b(&done); |
428 __ bind(&no_arguments); | 460 __ bind(&no_arguments); |
429 __ LoadRoot(r5, Heap::kempty_stringRootIndex); | 461 __ LoadRoot(r5, Heap::kempty_stringRootIndex); |
430 __ Drop(1); | |
431 __ bind(&done); | 462 __ bind(&done); |
432 } | 463 } |
433 | 464 |
434 // 3. Make sure r5 is a string. | 465 // 3. Make sure r5 is a string. |
435 { | 466 { |
436 Label convert, done_convert; | 467 Label convert, done_convert; |
437 __ JumpIfSmi(r5, &convert); | 468 __ JumpIfSmi(r5, &convert); |
438 __ CompareObjectType(r5, r7, r7, FIRST_NONSTRING_TYPE); | 469 __ CompareObjectType(r5, r7, r7, FIRST_NONSTRING_TYPE); |
439 __ blt(&done_convert); | 470 __ blt(&done_convert); |
440 __ bind(&convert); | 471 __ bind(&convert); |
441 { | 472 { |
442 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 473 FrameScope scope(masm, StackFrame::MANUAL); |
443 ToStringStub stub(masm->isolate()); | 474 ToStringStub stub(masm->isolate()); |
444 __ Push(r4, r6); | 475 __ SmiTag(r9); |
| 476 __ EnterBuiltinFrame(cp, r4, r9); |
| 477 __ Push(r6); |
445 __ mr(r3, r5); | 478 __ mr(r3, r5); |
446 __ CallStub(&stub); | 479 __ CallStub(&stub); |
447 __ mr(r5, r3); | 480 __ mr(r5, r3); |
448 __ Pop(r4, r6); | 481 __ Pop(r6); |
| 482 __ LeaveBuiltinFrame(cp, r4, r9); |
| 483 __ SmiUntag(r9); |
449 } | 484 } |
450 __ bind(&done_convert); | 485 __ bind(&done_convert); |
451 } | 486 } |
452 | 487 |
453 // 4. Check if new target and constructor differ. | 488 // 4. Check if new target and constructor differ. |
454 Label new_object; | 489 Label drop_frame_and_ret, new_object; |
455 __ cmp(r4, r6); | 490 __ cmp(r4, r6); |
456 __ bne(&new_object); | 491 __ bne(&new_object); |
457 | 492 |
458 // 5. Allocate a JSValue wrapper for the string. | 493 // 5. Allocate a JSValue wrapper for the string. |
459 __ AllocateJSValue(r3, r4, r5, r7, r8, &new_object); | 494 __ AllocateJSValue(r3, r4, r5, r7, r8, &new_object); |
460 __ Ret(); | 495 __ b(&drop_frame_and_ret); |
461 | 496 |
462 // 6. Fallback to the runtime to create new object. | 497 // 6. Fallback to the runtime to create new object. |
463 __ bind(&new_object); | 498 __ bind(&new_object); |
464 { | 499 { |
465 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 500 FrameScope scope(masm, StackFrame::MANUAL); |
| 501 __ SmiTag(r9); |
| 502 __ EnterBuiltinFrame(cp, r4, r9); |
466 __ Push(r5); // first argument | 503 __ Push(r5); // first argument |
467 FastNewObjectStub stub(masm->isolate()); | 504 FastNewObjectStub stub(masm->isolate()); |
468 __ CallStub(&stub); | 505 __ CallStub(&stub); |
469 __ Pop(r5); | 506 __ Pop(r5); |
| 507 __ LeaveBuiltinFrame(cp, r4, r9); |
| 508 __ SmiUntag(r9); |
470 } | 509 } |
471 __ StoreP(r5, FieldMemOperand(r3, JSValue::kValueOffset), r0); | 510 __ StoreP(r5, FieldMemOperand(r3, JSValue::kValueOffset), r0); |
472 __ Ret(); | 511 |
| 512 __ bind(&drop_frame_and_ret); |
| 513 { |
| 514 __ Drop(r9); |
| 515 __ Ret(1); |
| 516 } |
473 } | 517 } |
474 | 518 |
475 | 519 |
476 static void GenerateTailCallToSharedCode(MacroAssembler* masm) { | 520 static void GenerateTailCallToSharedCode(MacroAssembler* masm) { |
477 __ LoadP(ip, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); | 521 __ LoadP(ip, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
478 __ LoadP(ip, FieldMemOperand(ip, SharedFunctionInfo::kCodeOffset)); | 522 __ LoadP(ip, FieldMemOperand(ip, SharedFunctionInfo::kCodeOffset)); |
479 __ addi(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); | 523 __ addi(ip, ip, Operand(Code::kHeaderSize - kHeapObjectTag)); |
480 __ JumpToJSEntry(ip); | 524 __ JumpToJSEntry(ip); |
481 } | 525 } |
482 | 526 |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1820 __ CallCFunction( | 1864 __ CallCFunction( |
1821 ExternalReference::get_date_field_function(masm->isolate()), 2); | 1865 ExternalReference::get_date_field_function(masm->isolate()), 2); |
1822 } | 1866 } |
1823 __ Ret(); | 1867 __ Ret(); |
1824 | 1868 |
1825 // 3. Raise a TypeError if the receiver is not a date. | 1869 // 3. Raise a TypeError if the receiver is not a date. |
1826 __ bind(&receiver_not_date); | 1870 __ bind(&receiver_not_date); |
1827 { | 1871 { |
1828 FrameScope scope(masm, StackFrame::MANUAL); | 1872 FrameScope scope(masm, StackFrame::MANUAL); |
1829 __ push(r3); | 1873 __ push(r3); |
1830 __ PushStandardFrame(r4); | 1874 __ LoadSmiLiteral(r3, Smi::FromInt(0)); |
1831 __ LoadSmiLiteral(r7, Smi::FromInt(0)); | 1875 __ EnterBuiltinFrame(cp, r4, r3); |
1832 __ push(r7); | |
1833 __ CallRuntime(Runtime::kThrowNotDateError); | 1876 __ CallRuntime(Runtime::kThrowNotDateError); |
1834 } | 1877 } |
1835 } | 1878 } |
1836 | 1879 |
1837 // static | 1880 // static |
1838 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { | 1881 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { |
1839 // ----------- S t a t e ------------- | 1882 // ----------- S t a t e ------------- |
1840 // -- r3 : argc | 1883 // -- r3 : argc |
1841 // -- sp[0] : argArray | 1884 // -- sp[0] : argArray |
1842 // -- sp[4] : thisArg | 1885 // -- sp[4] : thisArg |
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3003 __ bkpt(0); | 3046 __ bkpt(0); |
3004 } | 3047 } |
3005 } | 3048 } |
3006 | 3049 |
3007 | 3050 |
3008 #undef __ | 3051 #undef __ |
3009 } // namespace internal | 3052 } // namespace internal |
3010 } // namespace v8 | 3053 } // namespace v8 |
3011 | 3054 |
3012 #endif // V8_TARGET_ARCH_PPC | 3055 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |