OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/debug.h" | 10 #include "src/debug.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // -- sp[4 * (argc - 1)] : first argument (argc == x0) | 59 // -- sp[4 * (argc - 1)] : first argument (argc == x0) |
60 // -- sp[4 * argc] : receiver | 60 // -- sp[4 * argc] : receiver |
61 // ----------------------------------- | 61 // ----------------------------------- |
62 | 62 |
63 // Insert extra arguments. | 63 // Insert extra arguments. |
64 int num_extra_args = 0; | 64 int num_extra_args = 0; |
65 if (extra_args == NEEDS_CALLED_FUNCTION) { | 65 if (extra_args == NEEDS_CALLED_FUNCTION) { |
66 num_extra_args = 1; | 66 num_extra_args = 1; |
67 __ Push(x1); | 67 __ Push(x1); |
68 } else { | 68 } else { |
69 ASSERT(extra_args == NO_EXTRA_ARGUMENTS); | 69 DCHECK(extra_args == NO_EXTRA_ARGUMENTS); |
70 } | 70 } |
71 | 71 |
72 // JumpToExternalReference expects x0 to contain the number of arguments | 72 // JumpToExternalReference expects x0 to contain the number of arguments |
73 // including the receiver and the extra arguments. | 73 // including the receiver and the extra arguments. |
74 __ Add(x0, x0, num_extra_args + 1); | 74 __ Add(x0, x0, num_extra_args + 1); |
75 __ JumpToExternalReference(ExternalReference(id, masm->isolate())); | 75 __ JumpToExternalReference(ExternalReference(id, masm->isolate())); |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) { | 79 void Builtins::Generate_InternalArrayCode(MacroAssembler* masm) { |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 // ----------- S t a t e ------------- | 308 // ----------- S t a t e ------------- |
309 // -- x0 : number of arguments | 309 // -- x0 : number of arguments |
310 // -- x1 : constructor function | 310 // -- x1 : constructor function |
311 // -- x2 : allocation site or undefined | 311 // -- x2 : allocation site or undefined |
312 // -- lr : return address | 312 // -- lr : return address |
313 // -- sp[...]: constructor arguments | 313 // -- sp[...]: constructor arguments |
314 // ----------------------------------- | 314 // ----------------------------------- |
315 | 315 |
316 ASM_LOCATION("Builtins::Generate_JSConstructStubHelper"); | 316 ASM_LOCATION("Builtins::Generate_JSConstructStubHelper"); |
317 // Should never create mementos for api functions. | 317 // Should never create mementos for api functions. |
318 ASSERT(!is_api_function || !create_memento); | 318 DCHECK(!is_api_function || !create_memento); |
319 | 319 |
320 Isolate* isolate = masm->isolate(); | 320 Isolate* isolate = masm->isolate(); |
321 | 321 |
322 // Enter a construct frame. | 322 // Enter a construct frame. |
323 { | 323 { |
324 FrameScope scope(masm, StackFrame::CONSTRUCT); | 324 FrameScope scope(masm, StackFrame::CONSTRUCT); |
325 | 325 |
326 // Preserve the three incoming parameters on the stack. | 326 // Preserve the three incoming parameters on the stack. |
327 if (create_memento) { | 327 if (create_memento) { |
328 __ AssertUndefinedOrAllocationSite(x2, x10); | 328 __ AssertUndefinedOrAllocationSite(x2, x10); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 __ LoadRoot(filler, Heap::kOnePointerFillerMapRootIndex); | 458 __ LoadRoot(filler, Heap::kOnePointerFillerMapRootIndex); |
459 __ Sub(prop_fields, prop_fields, prealloc_fields); | 459 __ Sub(prop_fields, prop_fields, prealloc_fields); |
460 | 460 |
461 __ bind(&no_inobject_slack_tracking); | 461 __ bind(&no_inobject_slack_tracking); |
462 } | 462 } |
463 if (create_memento) { | 463 if (create_memento) { |
464 // Fill the pre-allocated fields with undef. | 464 // Fill the pre-allocated fields with undef. |
465 __ FillFields(first_prop, prop_fields, filler); | 465 __ FillFields(first_prop, prop_fields, filler); |
466 __ Add(first_prop, new_obj, Operand(obj_size, LSL, kPointerSizeLog2)); | 466 __ Add(first_prop, new_obj, Operand(obj_size, LSL, kPointerSizeLog2)); |
467 __ LoadRoot(x14, Heap::kAllocationMementoMapRootIndex); | 467 __ LoadRoot(x14, Heap::kAllocationMementoMapRootIndex); |
468 ASSERT_EQ(0 * kPointerSize, AllocationMemento::kMapOffset); | 468 DCHECK_EQ(0 * kPointerSize, AllocationMemento::kMapOffset); |
469 __ Str(x14, MemOperand(first_prop, kPointerSize, PostIndex)); | 469 __ Str(x14, MemOperand(first_prop, kPointerSize, PostIndex)); |
470 // Load the AllocationSite | 470 // Load the AllocationSite |
471 __ Peek(x14, 2 * kXRegSize); | 471 __ Peek(x14, 2 * kXRegSize); |
472 ASSERT_EQ(1 * kPointerSize, AllocationMemento::kAllocationSiteOffset); | 472 DCHECK_EQ(1 * kPointerSize, AllocationMemento::kAllocationSiteOffset); |
473 __ Str(x14, MemOperand(first_prop, kPointerSize, PostIndex)); | 473 __ Str(x14, MemOperand(first_prop, kPointerSize, PostIndex)); |
474 first_prop = NoReg; | 474 first_prop = NoReg; |
475 } else { | 475 } else { |
476 // Fill all of the property fields with undef. | 476 // Fill all of the property fields with undef. |
477 __ FillFields(first_prop, prop_fields, filler); | 477 __ FillFields(first_prop, prop_fields, filler); |
478 first_prop = NoReg; | 478 first_prop = NoReg; |
479 prop_fields = NoReg; | 479 prop_fields = NoReg; |
480 } | 480 } |
481 | 481 |
482 // Add the object tag to make the JSObject real, so that we can continue | 482 // Add the object tag to make the JSObject real, so that we can continue |
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1556 __ Unreachable(); | 1556 __ Unreachable(); |
1557 } | 1557 } |
1558 } | 1558 } |
1559 | 1559 |
1560 | 1560 |
1561 #undef __ | 1561 #undef __ |
1562 | 1562 |
1563 } } // namespace v8::internal | 1563 } } // namespace v8::internal |
1564 | 1564 |
1565 #endif // V8_TARGET_ARCH_ARM | 1565 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |