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

Side by Side Diff: src/ppc/macro-assembler-ppc.cc

Issue 2783043002: PPC/s390: [cleanup] combine 3 ResumeGenerator stubs into one (Closed)
Patch Set: Created 3 years, 8 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 | « src/ppc/macro-assembler-ppc.h ('k') | src/s390/interface-descriptors-s390.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 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 #include <assert.h> // For assert 5 #include <assert.h> // For assert
6 #include <limits.h> // For LONG_MIN, LONG_MAX. 6 #include <limits.h> // For LONG_MIN, LONG_MAX.
7 7
8 #if V8_TARGET_ARCH_PPC 8 #if V8_TARGET_ARCH_PPC
9 9
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 2607 matching lines...) Expand 10 before | Expand all | Expand 10 after
2618 STATIC_ASSERT(kSmiTag == 0); 2618 STATIC_ASSERT(kSmiTag == 0);
2619 TestIfSmi(object, r0); 2619 TestIfSmi(object, r0);
2620 Check(ne, kOperandIsASmiAndNotABoundFunction, cr0); 2620 Check(ne, kOperandIsASmiAndNotABoundFunction, cr0);
2621 push(object); 2621 push(object);
2622 CompareObjectType(object, object, object, JS_BOUND_FUNCTION_TYPE); 2622 CompareObjectType(object, object, object, JS_BOUND_FUNCTION_TYPE);
2623 pop(object); 2623 pop(object);
2624 Check(eq, kOperandIsNotABoundFunction); 2624 Check(eq, kOperandIsNotABoundFunction);
2625 } 2625 }
2626 } 2626 }
2627 2627
2628 void MacroAssembler::AssertGeneratorObject(Register object) { 2628 void MacroAssembler::AssertGeneratorObject(Register object, Register flags) {
2629 if (emit_debug_code()) { 2629 // `flags` should be an untagged integer. See `SuspendFlags` in src/globals.h
2630 STATIC_ASSERT(kSmiTag == 0); 2630 if (!emit_debug_code()) return;
2631 TestIfSmi(object, r0); 2631 TestIfSmi(object, r0);
2632 Check(ne, kOperandIsASmiAndNotAGeneratorObject, cr0); 2632 Check(ne, kOperandIsASmiAndNotAGeneratorObject);
2633 push(object);
2634 CompareObjectType(object, object, object, JS_GENERATOR_OBJECT_TYPE);
2635 pop(object);
2636 Check(eq, kOperandIsNotAGeneratorObject);
2637 }
2638 }
2639 2633
2640 void MacroAssembler::AssertAsyncGeneratorObject(Register object) { 2634 // Load map
2641 if (emit_debug_code()) { 2635 Register map = object;
2642 STATIC_ASSERT(kSmiTag == 0); 2636 push(object);
2643 TestIfSmi(object, r0); 2637 LoadP(map, FieldMemOperand(object, HeapObject::kMapOffset));
2644 Check(ne, kOperandIsASmiAndNotAGeneratorObject); 2638
2645 push(object); 2639 Label async, do_check;
2646 CompareObjectType(object, object, object, JS_ASYNC_GENERATOR_OBJECT_TYPE); 2640 And(ip, flags, Operand(static_cast<int>(SuspendFlags::kGeneratorTypeMask)));
2647 pop(object); 2641 cmpi(ip, Operand(static_cast<int>(SuspendFlags::kGeneratorTypeMask)));
2648 Check(eq, kOperandIsNotAGeneratorObject); 2642 bne(&async);
2649 } 2643
2644 // Check if JSGeneratorObject
2645 CompareInstanceType(map, object, JS_GENERATOR_OBJECT_TYPE);
2646 b(&do_check);
2647
2648 bind(&async);
2649 // Check if JSAsyncGeneratorObject
2650 CompareInstanceType(map, object, JS_ASYNC_GENERATOR_OBJECT_TYPE);
2651
2652 bind(&do_check);
2653 // Restore generator object to register and perform assertion
2654 pop(object);
2655 Check(eq, kOperandIsNotAGeneratorObject);
2650 } 2656 }
2651 2657
2652 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, 2658 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object,
2653 Register scratch) { 2659 Register scratch) {
2654 if (emit_debug_code()) { 2660 if (emit_debug_code()) {
2655 Label done_checking; 2661 Label done_checking;
2656 AssertNotSmi(object); 2662 AssertNotSmi(object);
2657 CompareRoot(object, Heap::kUndefinedValueRootIndex); 2663 CompareRoot(object, Heap::kUndefinedValueRootIndex);
2658 beq(&done_checking); 2664 beq(&done_checking);
2659 LoadP(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); 2665 LoadP(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
(...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after
4251 } 4257 }
4252 if (mag.shift > 0) srawi(result, result, mag.shift); 4258 if (mag.shift > 0) srawi(result, result, mag.shift);
4253 ExtractBit(r0, dividend, 31); 4259 ExtractBit(r0, dividend, 31);
4254 add(result, result, r0); 4260 add(result, result, r0);
4255 } 4261 }
4256 4262
4257 } // namespace internal 4263 } // namespace internal
4258 } // namespace v8 4264 } // namespace v8
4259 4265
4260 #endif // V8_TARGET_ARCH_PPC 4266 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/ppc/macro-assembler-ppc.h ('k') | src/s390/interface-descriptors-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698