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

Side by Side Diff: src/ppc/code-stubs-ppc.cc

Issue 2549773002: Internalize strings in-place (Closed)
Patch Set: forgot one Created 4 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #if V8_TARGET_ARCH_PPC 5 #if V8_TARGET_ARCH_PPC
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 // and go to (1). Otherwise bail out to runtime. 1364 // and go to (1). Otherwise bail out to runtime.
1365 // (4) Sequential string. Load regexp code according to encoding. 1365 // (4) Sequential string. Load regexp code according to encoding.
1366 // (E) Carry on. 1366 // (E) Carry on.
1367 /// [...] 1367 /// [...]
1368 1368
1369 // Deferred code at the end of the stub: 1369 // Deferred code at the end of the stub:
1370 // (5) Long external string? If not, go to (7). 1370 // (5) Long external string? If not, go to (7).
1371 // (6) External string. Make it, offset-wise, look like a sequential string. 1371 // (6) External string. Make it, offset-wise, look like a sequential string.
1372 // Go to (4). 1372 // Go to (4).
1373 // (7) Short external string or not a string? If yes, bail out to runtime. 1373 // (7) Short external string or not a string? If yes, bail out to runtime.
1374 // (8) Sliced string. Replace subject with parent. Go to (1). 1374 // (8) Sliced or thin string. Replace subject with parent. Go to (1).
1375 1375
1376 Label seq_string /* 4 */, external_string /* 6 */, check_underlying /* 1 */, 1376 Label seq_string /* 4 */, external_string /* 6 */, check_underlying /* 1 */,
1377 not_seq_nor_cons /* 5 */, not_long_external /* 7 */; 1377 not_seq_nor_cons /* 5 */, not_long_external /* 7 */;
1378 1378
1379 __ bind(&check_underlying); 1379 __ bind(&check_underlying);
1380 __ LoadP(r3, FieldMemOperand(subject, HeapObject::kMapOffset)); 1380 __ LoadP(r3, FieldMemOperand(subject, HeapObject::kMapOffset));
1381 __ lbz(r3, FieldMemOperand(r3, Map::kInstanceTypeOffset)); 1381 __ lbz(r3, FieldMemOperand(r3, Map::kInstanceTypeOffset));
1382 1382
1383 // (1) Sequential string? If yes, go to (4). 1383 // (1) Sequential string? If yes, go to (4).
1384 1384
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1661 __ subi(subject, subject, 1661 __ subi(subject, subject,
1662 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); 1662 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
1663 __ b(&seq_string); // Go to (4). 1663 __ b(&seq_string); // Go to (4).
1664 1664
1665 // (7) Short external string or not a string? If yes, bail out to runtime. 1665 // (7) Short external string or not a string? If yes, bail out to runtime.
1666 __ bind(&not_long_external); 1666 __ bind(&not_long_external);
1667 STATIC_ASSERT(kNotStringTag != 0 && kShortExternalStringTag != 0); 1667 STATIC_ASSERT(kNotStringTag != 0 && kShortExternalStringTag != 0);
1668 __ andi(r0, r4, Operand(kIsNotStringMask | kShortExternalStringMask)); 1668 __ andi(r0, r4, Operand(kIsNotStringMask | kShortExternalStringMask));
1669 __ bne(&runtime, cr0); 1669 __ bne(&runtime, cr0);
1670 1670
1671 // (8) Sliced string. Replace subject with parent. Go to (4). 1671 // (8) Sliced or thin string. Replace subject with parent. Go to (4).
1672 Label thin_string;
1673 __ cmpi(r4, Operand(kThinStringTag));
1674 __ beq(&thin_string);
1672 // Load offset into r11 and replace subject string with parent. 1675 // Load offset into r11 and replace subject string with parent.
1673 __ LoadP(r11, FieldMemOperand(subject, SlicedString::kOffsetOffset)); 1676 __ LoadP(r11, FieldMemOperand(subject, SlicedString::kOffsetOffset));
1674 __ SmiUntag(r11); 1677 __ SmiUntag(r11);
1675 __ LoadP(subject, FieldMemOperand(subject, SlicedString::kParentOffset)); 1678 __ LoadP(subject, FieldMemOperand(subject, SlicedString::kParentOffset));
1676 __ b(&check_underlying); // Go to (4). 1679 __ b(&check_underlying); // Go to (4).
1680
1681 __ bind(&thin_string);
1682 __ LoadP(subject, FieldMemOperand(subject, ThinString::kActualOffset));
1683 __ b(&check_underlying); // Go to (4).
1677 #endif // V8_INTERPRETED_REGEXP 1684 #endif // V8_INTERPRETED_REGEXP
1678 } 1685 }
1679 1686
1680 1687
1681 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) { 1688 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) {
1682 // r3 : number of arguments to the construct function 1689 // r3 : number of arguments to the construct function
1683 // r4 : the function to call 1690 // r4 : the function to call
1684 // r5 : feedback vector 1691 // r5 : feedback vector
1685 // r6 : slot in feedback vector (Smi) 1692 // r6 : slot in feedback vector (Smi)
1686 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); 1693 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
(...skipping 2887 matching lines...) Expand 10 before | Expand all | Expand 10 after
4574 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); 4581 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize);
4575 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 4582 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
4576 kStackUnwindSpace, NULL, return_value_operand, NULL); 4583 kStackUnwindSpace, NULL, return_value_operand, NULL);
4577 } 4584 }
4578 4585
4579 #undef __ 4586 #undef __
4580 } // namespace internal 4587 } // namespace internal
4581 } // namespace v8 4588 } // namespace v8
4582 4589
4583 #endif // V8_TARGET_ARCH_PPC 4590 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« src/objects-debug.cc ('K') | « src/objects-printer.cc ('k') | src/ppc/codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698