Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: src/mips/builtins-mips.cc

Issue 297093002: MIPS: Fix r21470 “Reland r21442 Inobject slack tracking is done on a per-closure basis instead of p… (Closed) Base URL: git@github.com:paul99/v8m-rb.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "v8.h" 7 #include "v8.h"
8 8
9 #if V8_TARGET_ARCH_MIPS 9 #if V8_TARGET_ARCH_MIPS
10 10
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 __ Branch(&rt_call, ne, t4, Operand(MAP_TYPE)); 372 __ Branch(&rt_call, ne, t4, Operand(MAP_TYPE));
373 373
374 // Check that the constructor is not constructing a JSFunction (see 374 // Check that the constructor is not constructing a JSFunction (see
375 // comments in Runtime_NewObject in runtime.cc). In which case the 375 // comments in Runtime_NewObject in runtime.cc). In which case the
376 // initial map's instance type would be JS_FUNCTION_TYPE. 376 // initial map's instance type would be JS_FUNCTION_TYPE.
377 // a1: constructor function 377 // a1: constructor function
378 // a2: initial map 378 // a2: initial map
379 __ lbu(a3, FieldMemOperand(a2, Map::kInstanceTypeOffset)); 379 __ lbu(a3, FieldMemOperand(a2, Map::kInstanceTypeOffset));
380 __ Branch(&rt_call, eq, a3, Operand(JS_FUNCTION_TYPE)); 380 __ Branch(&rt_call, eq, a3, Operand(JS_FUNCTION_TYPE));
381 381
382 // Use t7 to hold undefined, which is used in several places below.
383 __ LoadRoot(t7, Heap::kUndefinedValueRootIndex);
384
385 if (!is_api_function) { 382 if (!is_api_function) {
386 Label allocate; 383 Label allocate;
387 MemOperand bit_field3 = FieldMemOperand(a2, Map::kBitField3Offset); 384 MemOperand bit_field3 = FieldMemOperand(a2, Map::kBitField3Offset);
388 // Check if slack tracking is enabled. 385 // Check if slack tracking is enabled.
389 __ lw(t0, bit_field3); 386 __ lw(t0, bit_field3);
390 __ DecodeField<Map::ConstructionCount>(t2, t0); 387 __ DecodeField<Map::ConstructionCount>(t2, t0);
391 __ Branch(&allocate, eq, t2, Operand(JSFunction::kNoSlackTracking)); 388 __ Branch(&allocate, eq, t2, Operand(JSFunction::kNoSlackTracking));
392 // Decrease generous allocation count. 389 // Decrease generous allocation count.
393 __ Subu(t0, t0, Operand(1 << Map::ConstructionCount::kShift)); 390 __ Subu(t0, t0, Operand(1 << Map::ConstructionCount::kShift));
394 __ Branch(USE_DELAY_SLOT, 391 __ Branch(USE_DELAY_SLOT,
395 &allocate, ne, t2, Operand(JSFunction::kFinishSlackTracking)); 392 &allocate, ne, t2, Operand(JSFunction::kFinishSlackTracking));
396 __ sw(t0, bit_field3); // In delay slot. 393 __ sw(t0, bit_field3); // In delay slot.
397 394
398 __ Push(a1, a2, a1); // a1 = Constructor. 395 __ Push(a1, a2, a1); // a1 = Constructor.
399 __ CallRuntime(Runtime::kHiddenFinalizeInstanceSize, 1); 396 __ CallRuntime(Runtime::kHiddenFinalizeInstanceSize, 1);
400 397
401 __ Pop(a1, a2); 398 __ Pop(a1, a2);
399 ASSERT(JSFunction::kNoSlackTracking == 0);
400 __ mov(t2, zero_reg);
Paul Lind 2014/05/23 19:18:05 Can we add a comment here: // Slack tracking count
kilvadyb 2014/05/23 19:30:38 Done.
402 401
403 __ bind(&allocate); 402 __ bind(&allocate);
404 } 403 }
405 404
406 // Now allocate the JSObject on the heap. 405 // Now allocate the JSObject on the heap.
407 // a1: constructor function 406 // a1: constructor function
408 // a2: initial map 407 // a2: initial map
409 __ lbu(a3, FieldMemOperand(a2, Map::kInstanceSizeOffset)); 408 __ lbu(a3, FieldMemOperand(a2, Map::kInstanceSizeOffset));
410 if (create_memento) { 409 if (create_memento) {
411 __ Addu(a3, a3, Operand(AllocationMemento::kSize / kPointerSize)); 410 __ Addu(a3, a3, Operand(AllocationMemento::kSize / kPointerSize));
(...skipping 19 matching lines...) Expand all
431 430
432 // Fill all the in-object properties with appropriate filler. 431 // Fill all the in-object properties with appropriate filler.
433 // a1: constructor function 432 // a1: constructor function
434 // a2: initial map 433 // a2: initial map
435 // a3: object size (in words, including memento if create_memento) 434 // a3: object size (in words, including memento if create_memento)
436 // t4: JSObject (not tagged) 435 // t4: JSObject (not tagged)
437 // t5: First in-object property of JSObject (not tagged) 436 // t5: First in-object property of JSObject (not tagged)
438 // t2: slack tracking counter (non-API function case) 437 // t2: slack tracking counter (non-API function case)
439 ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize); 438 ASSERT_EQ(3 * kPointerSize, JSObject::kHeaderSize);
440 439
440 // Use t7 to hold undefined, which is used in several places below.
441 __ LoadRoot(t7, Heap::kUndefinedValueRootIndex);
442
441 if (!is_api_function) { 443 if (!is_api_function) {
442 Label no_inobject_slack_tracking; 444 Label no_inobject_slack_tracking;
443 445
444 // Check if slack tracking is enabled. 446 // Check if slack tracking is enabled.
445 __ Branch(&no_inobject_slack_tracking, 447 __ Branch(&no_inobject_slack_tracking,
446 eq, t2, Operand(JSFunction::kNoSlackTracking)); 448 eq, t2, Operand(JSFunction::kNoSlackTracking));
447 449
448 // Allocate object with a slack. 450 // Allocate object with a slack.
449 __ lbu(a0, FieldMemOperand(a2, Map::kPreAllocatedPropertyFieldsOffset)); 451 __ lbu(a0, FieldMemOperand(a2, Map::kPreAllocatedPropertyFieldsOffset));
450 __ sll(at, a0, kPointerSizeLog2); 452 __ sll(at, a0, kPointerSizeLog2);
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 __ break_(0xCC); 1570 __ break_(0xCC);
1569 } 1571 }
1570 } 1572 }
1571 1573
1572 1574
1573 #undef __ 1575 #undef __
1574 1576
1575 } } // namespace v8::internal 1577 } } // namespace v8::internal
1576 1578
1577 #endif // V8_TARGET_ARCH_MIPS 1579 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698