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

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

Issue 767253002: Refactor Map::ConstructionCount. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix assert Created 6 years 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 | src/arm64/builtins-arm64.cc » ('j') | 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/debug.h" 10 #include "src/debug.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 // r1: constructor function 365 // r1: constructor function
366 // r2: initial map 366 // r2: initial map
367 __ CompareInstanceType(r2, r3, JS_FUNCTION_TYPE); 367 __ CompareInstanceType(r2, r3, JS_FUNCTION_TYPE);
368 __ b(eq, &rt_call); 368 __ b(eq, &rt_call);
369 369
370 if (!is_api_function) { 370 if (!is_api_function) {
371 Label allocate; 371 Label allocate;
372 MemOperand bit_field3 = FieldMemOperand(r2, Map::kBitField3Offset); 372 MemOperand bit_field3 = FieldMemOperand(r2, Map::kBitField3Offset);
373 // Check if slack tracking is enabled. 373 // Check if slack tracking is enabled.
374 __ ldr(r4, bit_field3); 374 __ ldr(r4, bit_field3);
375 __ DecodeField<Map::ConstructionCount>(r3, r4); 375 __ DecodeField<Map::Counter>(r3, r4);
376 __ cmp(r3, Operand(JSFunction::kNoSlackTracking)); 376 __ cmp(r3, Operand(Map::kSlackTrackingCounterEnd));
377 __ b(eq, &allocate); 377 __ b(lt, &allocate);
378 // Decrease generous allocation count. 378 // Decrease generous allocation count.
379 __ sub(r4, r4, Operand(1 << Map::ConstructionCount::kShift)); 379 __ sub(r4, r4, Operand(1 << Map::Counter::kShift));
380 __ str(r4, bit_field3); 380 __ str(r4, bit_field3);
381 __ cmp(r3, Operand(JSFunction::kFinishSlackTracking)); 381 __ cmp(r3, Operand(Map::kSlackTrackingCounterEnd));
382 __ b(ne, &allocate); 382 __ b(ne, &allocate);
383 383
384 __ push(r1); 384 __ push(r1);
385 385
386 __ Push(r2, r1); // r1 = constructor 386 __ Push(r2, r1); // r1 = constructor
387 __ CallRuntime(Runtime::kFinalizeInstanceSize, 1); 387 __ CallRuntime(Runtime::kFinalizeInstanceSize, 1);
388 388
389 __ pop(r2); 389 __ pop(r2);
390 __ pop(r1); 390 __ pop(r1);
391 391
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 // r4: JSObject (not tagged) 424 // r4: JSObject (not tagged)
425 // r5: First in-object property of JSObject (not tagged) 425 // r5: First in-object property of JSObject (not tagged)
426 DCHECK_EQ(3 * kPointerSize, JSObject::kHeaderSize); 426 DCHECK_EQ(3 * kPointerSize, JSObject::kHeaderSize);
427 __ LoadRoot(r6, Heap::kUndefinedValueRootIndex); 427 __ LoadRoot(r6, Heap::kUndefinedValueRootIndex);
428 428
429 if (!is_api_function) { 429 if (!is_api_function) {
430 Label no_inobject_slack_tracking; 430 Label no_inobject_slack_tracking;
431 431
432 // Check if slack tracking is enabled. 432 // Check if slack tracking is enabled.
433 __ ldr(ip, FieldMemOperand(r2, Map::kBitField3Offset)); 433 __ ldr(ip, FieldMemOperand(r2, Map::kBitField3Offset));
434 __ DecodeField<Map::ConstructionCount>(ip); 434 __ DecodeField<Map::Counter>(ip);
435 __ cmp(ip, Operand(JSFunction::kNoSlackTracking)); 435 __ cmp(ip, Operand(Map::kSlackTrackingCounterEnd));
436 __ b(eq, &no_inobject_slack_tracking); 436 __ b(lt, &no_inobject_slack_tracking);
437 437
438 // Allocate object with a slack. 438 // Allocate object with a slack.
439 __ ldr(r0, FieldMemOperand(r2, Map::kInstanceSizesOffset)); 439 __ ldr(r0, FieldMemOperand(r2, Map::kInstanceSizesOffset));
440 __ Ubfx(r0, r0, Map::kPreAllocatedPropertyFieldsByte * kBitsPerByte, 440 __ Ubfx(r0, r0, Map::kPreAllocatedPropertyFieldsByte * kBitsPerByte,
441 kBitsPerByte); 441 kBitsPerByte);
442 __ add(r0, r5, Operand(r0, LSL, kPointerSizeLog2)); 442 __ add(r0, r5, Operand(r0, LSL, kPointerSizeLog2));
443 // r0: offset of first field after pre-allocated fields 443 // r0: offset of first field after pre-allocated fields
444 if (FLAG_debug_code) { 444 if (FLAG_debug_code) {
445 __ add(ip, r4, Operand(r3, LSL, kPointerSizeLog2)); // End of object. 445 __ add(ip, r4, Operand(r3, LSL, kPointerSizeLog2)); // End of object.
446 __ cmp(r0, ip); 446 __ cmp(r0, ip);
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 __ bkpt(0); 1544 __ bkpt(0);
1545 } 1545 }
1546 } 1546 }
1547 1547
1548 1548
1549 #undef __ 1549 #undef __
1550 1550
1551 } } // namespace v8::internal 1551 } } // namespace v8::internal
1552 1552
1553 #endif // V8_TARGET_ARCH_ARM 1553 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698