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

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

Issue 1542963002: [runtime] Introduce dedicated JSBoundFunction to represent bound functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@FunctionConstructor
Patch Set: arm port. Created 4 years, 12 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
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 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/division-by-constant.h" 8 #include "src/base/division-by-constant.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 test(object, Immediate(kSmiTagMask)); 814 test(object, Immediate(kSmiTagMask));
815 Check(not_equal, kOperandIsASmiAndNotAFunction); 815 Check(not_equal, kOperandIsASmiAndNotAFunction);
816 Push(object); 816 Push(object);
817 CmpObjectType(object, JS_FUNCTION_TYPE, object); 817 CmpObjectType(object, JS_FUNCTION_TYPE, object);
818 Pop(object); 818 Pop(object);
819 Check(equal, kOperandIsNotAFunction); 819 Check(equal, kOperandIsNotAFunction);
820 } 820 }
821 } 821 }
822 822
823 823
824 void MacroAssembler::AssertBoundFunction(Register object) {
825 if (emit_debug_code()) {
826 test(object, Immediate(kSmiTagMask));
827 Check(not_equal, kOperandIsASmiAndNotABoundFunction);
828 Push(object);
829 CmpObjectType(object, JS_BOUND_FUNCTION_TYPE, object);
830 Pop(object);
831 Check(equal, kOperandIsNotABoundFunction);
832 }
833 }
834
835
824 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object) { 836 void MacroAssembler::AssertUndefinedOrAllocationSite(Register object) {
825 if (emit_debug_code()) { 837 if (emit_debug_code()) {
826 Label done_checking; 838 Label done_checking;
827 AssertNotSmi(object); 839 AssertNotSmi(object);
828 cmp(object, isolate()->factory()->undefined_value()); 840 cmp(object, isolate()->factory()->undefined_value());
829 j(equal, &done_checking); 841 j(equal, &done_checking);
830 cmp(FieldOperand(object, 0), 842 cmp(FieldOperand(object, 0),
831 Immediate(isolate()->factory()->allocation_site_map())); 843 Immediate(isolate()->factory()->allocation_site_map()));
832 Assert(equal, kExpectedUndefinedOrCell); 844 Assert(equal, kExpectedUndefinedOrCell);
833 bind(&done_checking); 845 bind(&done_checking);
(...skipping 2335 matching lines...) Expand 10 before | Expand all | Expand 10 after
3169 mov(eax, dividend); 3181 mov(eax, dividend);
3170 shr(eax, 31); 3182 shr(eax, 31);
3171 add(edx, eax); 3183 add(edx, eax);
3172 } 3184 }
3173 3185
3174 3186
3175 } // namespace internal 3187 } // namespace internal
3176 } // namespace v8 3188 } // namespace v8
3177 3189
3178 #endif // V8_TARGET_ARCH_IA32 3190 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/js/v8natives.js » ('j') | src/objects-debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698