| 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_MIPS64 | 9 #if V8_TARGET_ARCH_MIPS64 |
| 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 __ lwu(a4, bit_field3); | 384 __ lwu(a4, bit_field3); |
| 385 __ DecodeField<Map::ConstructionCount>(a6, a4); | 385 __ DecodeField<Map::Counter>(a6, a4); |
| 386 __ Branch(&allocate, | 386 __ Branch(&allocate, lt, a6, |
| 387 eq, | 387 Operand(static_cast<int64_t>(Map::kSlackTrackingCounterEnd))); |
| 388 a6, | |
| 389 Operand(static_cast<int64_t>(JSFunction::kNoSlackTracking))); | |
| 390 // Decrease generous allocation count. | 388 // Decrease generous allocation count. |
| 391 __ Dsubu(a4, a4, Operand(1 << Map::ConstructionCount::kShift)); | 389 __ Dsubu(a4, a4, Operand(1 << Map::Counter::kShift)); |
| 392 __ Branch(USE_DELAY_SLOT, | 390 __ Branch(USE_DELAY_SLOT, &allocate, ne, a6, |
| 393 &allocate, ne, a6, Operand(JSFunction::kFinishSlackTracking)); | 391 Operand(Map::kSlackTrackingCounterEnd)); |
| 394 __ sw(a4, bit_field3); // In delay slot. | 392 __ sw(a4, bit_field3); // In delay slot. |
| 395 | 393 |
| 396 __ Push(a1, a2, a1); // a1 = Constructor. | 394 __ Push(a1, a2, a1); // a1 = Constructor. |
| 397 __ CallRuntime(Runtime::kFinalizeInstanceSize, 1); | 395 __ CallRuntime(Runtime::kFinalizeInstanceSize, 1); |
| 398 | 396 |
| 399 __ Pop(a1, a2); | 397 __ Pop(a1, a2); |
| 400 // Slack tracking counter is kNoSlackTracking after runtime call. | 398 // Slack tracking counter is kNoSlackTracking after runtime call. |
| 401 DCHECK(JSFunction::kNoSlackTracking == 0); | 399 DCHECK(JSFunction::kNoSlackTracking == 0); |
| 402 __ mov(a6, zero_reg); | 400 __ mov(a6, zero_reg); |
| 403 | 401 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 // a6: slack tracking counter (non-API function case) | 437 // a6: slack tracking counter (non-API function case) |
| 440 DCHECK_EQ(3 * kPointerSize, JSObject::kHeaderSize); | 438 DCHECK_EQ(3 * kPointerSize, JSObject::kHeaderSize); |
| 441 | 439 |
| 442 // Use t3 to hold undefined, which is used in several places below. | 440 // Use t3 to hold undefined, which is used in several places below. |
| 443 __ LoadRoot(t3, Heap::kUndefinedValueRootIndex); | 441 __ LoadRoot(t3, Heap::kUndefinedValueRootIndex); |
| 444 | 442 |
| 445 if (!is_api_function) { | 443 if (!is_api_function) { |
| 446 Label no_inobject_slack_tracking; | 444 Label no_inobject_slack_tracking; |
| 447 | 445 |
| 448 // Check if slack tracking is enabled. | 446 // Check if slack tracking is enabled. |
| 449 __ Branch(&no_inobject_slack_tracking, | 447 __ Branch(&no_inobject_slack_tracking, lt, a6, |
| 450 eq, | 448 Operand(static_cast<int64_t>(Map::kSlackTrackingCounterEnd))); |
| 451 a6, | |
| 452 Operand(static_cast<int64_t>(JSFunction::kNoSlackTracking))); | |
| 453 | 449 |
| 454 // Allocate object with a slack. | 450 // Allocate object with a slack. |
| 455 __ lwu(a0, FieldMemOperand(a2, Map::kInstanceSizesOffset)); | 451 __ lwu(a0, FieldMemOperand(a2, Map::kInstanceSizesOffset)); |
| 456 __ Ext(a0, a0, Map::kPreAllocatedPropertyFieldsByte * kBitsPerByte, | 452 __ Ext(a0, a0, Map::kPreAllocatedPropertyFieldsByte * kBitsPerByte, |
| 457 kBitsPerByte); | 453 kBitsPerByte); |
| 458 __ dsll(at, a0, kPointerSizeLog2); | 454 __ dsll(at, a0, kPointerSizeLog2); |
| 459 __ daddu(a0, t1, at); | 455 __ daddu(a0, t1, at); |
| 460 // a0: offset of first field after pre-allocated fields | 456 // a0: offset of first field after pre-allocated fields |
| 461 if (FLAG_debug_code) { | 457 if (FLAG_debug_code) { |
| 462 __ dsll(at, a3, kPointerSizeLog2); | 458 __ dsll(at, a3, kPointerSizeLog2); |
| (...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1580 __ break_(0xCC); | 1576 __ break_(0xCC); |
| 1581 } | 1577 } |
| 1582 } | 1578 } |
| 1583 | 1579 |
| 1584 | 1580 |
| 1585 #undef __ | 1581 #undef __ |
| 1586 | 1582 |
| 1587 } } // namespace v8::internal | 1583 } } // namespace v8::internal |
| 1588 | 1584 |
| 1589 #endif // V8_TARGET_ARCH_MIPS64 | 1585 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |