OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 __ Branch(&new_object, ne, a1, Operand(a3)); | 334 __ Branch(&new_object, ne, a1, Operand(a3)); |
335 | 335 |
336 // 5. Allocate a JSValue wrapper for the number. | 336 // 5. Allocate a JSValue wrapper for the number. |
337 __ AllocateJSValue(v0, a1, a0, a2, t1, &new_object); | 337 __ AllocateJSValue(v0, a1, a0, a2, t1, &new_object); |
338 __ jmp(&drop_frame_and_ret); | 338 __ jmp(&drop_frame_and_ret); |
339 | 339 |
340 // 6. Fallback to the runtime to create new object. | 340 // 6. Fallback to the runtime to create new object. |
341 __ bind(&new_object); | 341 __ bind(&new_object); |
342 { | 342 { |
343 FrameScope scope(masm, StackFrame::MANUAL); | 343 FrameScope scope(masm, StackFrame::MANUAL); |
344 FastNewObjectStub stub(masm->isolate()); | |
345 __ SmiTag(t0); | 344 __ SmiTag(t0); |
346 __ EnterBuiltinFrame(cp, a1, t0); | 345 __ EnterBuiltinFrame(cp, a1, t0); |
347 __ Push(a0); // first argument | 346 __ Push(a0); // first argument |
348 __ CallStub(&stub); | 347 __ Call(CodeFactory::FastNewObject(masm->isolate()).code(), |
| 348 RelocInfo::CODE_TARGET); |
349 __ Pop(a0); | 349 __ Pop(a0); |
350 __ LeaveBuiltinFrame(cp, a1, t0); | 350 __ LeaveBuiltinFrame(cp, a1, t0); |
351 __ SmiUntag(t0); | 351 __ SmiUntag(t0); |
352 } | 352 } |
353 __ sw(a0, FieldMemOperand(v0, JSValue::kValueOffset)); | 353 __ sw(a0, FieldMemOperand(v0, JSValue::kValueOffset)); |
354 | 354 |
355 __ bind(&drop_frame_and_ret); | 355 __ bind(&drop_frame_and_ret); |
356 { | 356 { |
357 __ Lsa(sp, sp, t0, kPointerSizeLog2); | 357 __ Lsa(sp, sp, t0, kPointerSizeLog2); |
358 __ DropAndRet(1); | 358 __ DropAndRet(1); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 __ Branch(&new_object, ne, a1, Operand(a3)); | 485 __ Branch(&new_object, ne, a1, Operand(a3)); |
486 | 486 |
487 // 5. Allocate a JSValue wrapper for the string. | 487 // 5. Allocate a JSValue wrapper for the string. |
488 __ AllocateJSValue(v0, a1, a0, a2, t1, &new_object); | 488 __ AllocateJSValue(v0, a1, a0, a2, t1, &new_object); |
489 __ jmp(&drop_frame_and_ret); | 489 __ jmp(&drop_frame_and_ret); |
490 | 490 |
491 // 6. Fallback to the runtime to create new object. | 491 // 6. Fallback to the runtime to create new object. |
492 __ bind(&new_object); | 492 __ bind(&new_object); |
493 { | 493 { |
494 FrameScope scope(masm, StackFrame::MANUAL); | 494 FrameScope scope(masm, StackFrame::MANUAL); |
495 FastNewObjectStub stub(masm->isolate()); | |
496 __ SmiTag(t0); | 495 __ SmiTag(t0); |
497 __ EnterBuiltinFrame(cp, a1, t0); | 496 __ EnterBuiltinFrame(cp, a1, t0); |
498 __ Push(a0); // first argument | 497 __ Push(a0); // first argument |
499 __ CallStub(&stub); | 498 __ Call(CodeFactory::FastNewObject(masm->isolate()).code(), |
| 499 RelocInfo::CODE_TARGET); |
500 __ Pop(a0); | 500 __ Pop(a0); |
501 __ LeaveBuiltinFrame(cp, a1, t0); | 501 __ LeaveBuiltinFrame(cp, a1, t0); |
502 __ SmiUntag(t0); | 502 __ SmiUntag(t0); |
503 } | 503 } |
504 __ sw(a0, FieldMemOperand(v0, JSValue::kValueOffset)); | 504 __ sw(a0, FieldMemOperand(v0, JSValue::kValueOffset)); |
505 | 505 |
506 __ bind(&drop_frame_and_ret); | 506 __ bind(&drop_frame_and_ret); |
507 { | 507 { |
508 __ Lsa(sp, sp, t0, kPointerSizeLog2); | 508 __ Lsa(sp, sp, t0, kPointerSizeLog2); |
509 __ DropAndRet(1); | 509 __ DropAndRet(1); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 { | 578 { |
579 FrameScope scope(masm, StackFrame::CONSTRUCT); | 579 FrameScope scope(masm, StackFrame::CONSTRUCT); |
580 | 580 |
581 // Preserve the incoming parameters on the stack. | 581 // Preserve the incoming parameters on the stack. |
582 __ SmiTag(a0); | 582 __ SmiTag(a0); |
583 __ Push(cp, a0); | 583 __ Push(cp, a0); |
584 | 584 |
585 if (create_implicit_receiver) { | 585 if (create_implicit_receiver) { |
586 // Allocate the new receiver object. | 586 // Allocate the new receiver object. |
587 __ Push(a1, a3); | 587 __ Push(a1, a3); |
588 FastNewObjectStub stub(masm->isolate()); | 588 __ Call(CodeFactory::FastNewObject(masm->isolate()).code(), |
589 __ CallStub(&stub); | 589 RelocInfo::CODE_TARGET); |
590 __ mov(t4, v0); | 590 __ mov(t4, v0); |
591 __ Pop(a1, a3); | 591 __ Pop(a1, a3); |
592 | 592 |
593 // ----------- S t a t e ------------- | 593 // ----------- S t a t e ------------- |
594 // -- a1: constructor function | 594 // -- a1: constructor function |
595 // -- a3: new target | 595 // -- a3: new target |
596 // -- t0: newly allocated object | 596 // -- t0: newly allocated object |
597 // ----------------------------------- | 597 // ----------------------------------- |
598 | 598 |
599 // Retrieve smi-tagged arguments count from the stack. | 599 // Retrieve smi-tagged arguments count from the stack. |
(...skipping 2371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2971 __ break_(0xCC); | 2971 __ break_(0xCC); |
2972 } | 2972 } |
2973 } | 2973 } |
2974 | 2974 |
2975 #undef __ | 2975 #undef __ |
2976 | 2976 |
2977 } // namespace internal | 2977 } // namespace internal |
2978 } // namespace v8 | 2978 } // namespace v8 |
2979 | 2979 |
2980 #endif // V8_TARGET_ARCH_MIPS | 2980 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |