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 | 5 |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_MIPS | 9 #if V8_TARGET_ARCH_MIPS |
10 | 10 |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 // a1: constructor function | 375 // a1: constructor function |
376 // a2: initial map | 376 // a2: initial map |
377 __ lbu(a3, FieldMemOperand(a2, Map::kInstanceTypeOffset)); | 377 __ lbu(a3, FieldMemOperand(a2, Map::kInstanceTypeOffset)); |
378 __ Branch(&rt_call, eq, a3, Operand(JS_FUNCTION_TYPE)); | 378 __ Branch(&rt_call, eq, a3, Operand(JS_FUNCTION_TYPE)); |
379 | 379 |
380 if (!is_api_function) { | 380 if (!is_api_function) { |
381 Label allocate; | 381 Label allocate; |
382 MemOperand bit_field3 = FieldMemOperand(a2, Map::kBitField3Offset); | 382 MemOperand bit_field3 = FieldMemOperand(a2, Map::kBitField3Offset); |
383 // Check if slack tracking is enabled. | 383 // Check if slack tracking is enabled. |
384 __ lw(t0, bit_field3); | 384 __ lw(t0, bit_field3); |
385 __ DecodeField<Map::ConstructionCount>(t2, t0); | 385 __ DecodeField<Map::Counter>(t2, t0); |
386 __ Branch(&allocate, eq, t2, Operand(JSFunction::kNoSlackTracking)); | 386 __ Branch(&allocate, lt, t2, Operand(Map::kSlackTrackingCounterEnd)); |
387 // Decrease generous allocation count. | 387 // Decrease generous allocation count. |
388 __ Subu(t0, t0, Operand(1 << Map::ConstructionCount::kShift)); | 388 __ Subu(t0, t0, Operand(1 << Map::Counter::kShift)); |
389 __ Branch(USE_DELAY_SLOT, | 389 __ Branch(USE_DELAY_SLOT, &allocate, ne, t2, |
390 &allocate, ne, t2, Operand(JSFunction::kFinishSlackTracking)); | 390 Operand(Map::kSlackTrackingCounterEnd)); |
391 __ sw(t0, bit_field3); // In delay slot. | 391 __ sw(t0, bit_field3); // In delay slot. |
392 | 392 |
393 __ Push(a1, a2, a1); // a1 = Constructor. | 393 __ Push(a1, a2, a1); // a1 = Constructor. |
394 __ CallRuntime(Runtime::kFinalizeInstanceSize, 1); | 394 __ CallRuntime(Runtime::kFinalizeInstanceSize, 1); |
395 | 395 |
396 __ Pop(a1, a2); | 396 __ Pop(a1, a2); |
397 // Slack tracking counter is kNoSlackTracking after runtime call. | 397 // Slack tracking counter is Map::kSlackTrackingCounterEnd after runtime |
398 DCHECK(JSFunction::kNoSlackTracking == 0); | 398 // call. |
399 __ mov(t2, zero_reg); | 399 __ li(t2, Map::kSlackTrackingCounterEnd); |
400 | 400 |
401 __ bind(&allocate); | 401 __ bind(&allocate); |
402 } | 402 } |
403 | 403 |
404 // Now allocate the JSObject on the heap. | 404 // Now allocate the JSObject on the heap. |
405 // a1: constructor function | 405 // a1: constructor function |
406 // a2: initial map | 406 // a2: initial map |
407 __ lbu(a3, FieldMemOperand(a2, Map::kInstanceSizeOffset)); | 407 __ lbu(a3, FieldMemOperand(a2, Map::kInstanceSizeOffset)); |
408 if (create_memento) { | 408 if (create_memento) { |
409 __ Addu(a3, a3, Operand(AllocationMemento::kSize / kPointerSize)); | 409 __ Addu(a3, a3, Operand(AllocationMemento::kSize / kPointerSize)); |
(...skipping 26 matching lines...) Expand all Loading... |
436 // t2: slack tracking counter (non-API function case) | 436 // t2: slack tracking counter (non-API function case) |
437 DCHECK_EQ(3 * kPointerSize, JSObject::kHeaderSize); | 437 DCHECK_EQ(3 * kPointerSize, JSObject::kHeaderSize); |
438 | 438 |
439 // Use t7 to hold undefined, which is used in several places below. | 439 // Use t7 to hold undefined, which is used in several places below. |
440 __ LoadRoot(t7, Heap::kUndefinedValueRootIndex); | 440 __ LoadRoot(t7, Heap::kUndefinedValueRootIndex); |
441 | 441 |
442 if (!is_api_function) { | 442 if (!is_api_function) { |
443 Label no_inobject_slack_tracking; | 443 Label no_inobject_slack_tracking; |
444 | 444 |
445 // Check if slack tracking is enabled. | 445 // Check if slack tracking is enabled. |
446 __ Branch(&no_inobject_slack_tracking, | 446 __ Branch(&no_inobject_slack_tracking, lt, t2, |
447 eq, t2, Operand(JSFunction::kNoSlackTracking)); | 447 Operand(Map::kSlackTrackingCounterEnd)); |
448 | 448 |
449 // Allocate object with a slack. | 449 // Allocate object with a slack. |
450 __ lbu(a0, FieldMemOperand(a2, Map::kPreAllocatedPropertyFieldsOffset)); | 450 __ lbu(a0, FieldMemOperand(a2, Map::kPreAllocatedPropertyFieldsOffset)); |
451 __ sll(at, a0, kPointerSizeLog2); | 451 __ sll(at, a0, kPointerSizeLog2); |
452 __ addu(a0, t5, at); | 452 __ addu(a0, t5, at); |
453 // a0: offset of first field after pre-allocated fields | 453 // a0: offset of first field after pre-allocated fields |
454 if (FLAG_debug_code) { | 454 if (FLAG_debug_code) { |
455 __ sll(at, a3, kPointerSizeLog2); | 455 __ sll(at, a3, kPointerSizeLog2); |
456 __ Addu(t6, t4, Operand(at)); // End of object. | 456 __ Addu(t6, t4, Operand(at)); // End of object. |
457 __ Assert(le, kUnexpectedNumberOfPreAllocatedPropertyFields, | 457 __ Assert(le, kUnexpectedNumberOfPreAllocatedPropertyFields, |
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1570 __ break_(0xCC); | 1570 __ break_(0xCC); |
1571 } | 1571 } |
1572 } | 1572 } |
1573 | 1573 |
1574 | 1574 |
1575 #undef __ | 1575 #undef __ |
1576 | 1576 |
1577 } } // namespace v8::internal | 1577 } } // namespace v8::internal |
1578 | 1578 |
1579 #endif // V8_TARGET_ARCH_MIPS | 1579 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |