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

Side by Side Diff: src/arm/regexp-macro-assembler-arm.cc

Issue 660078: Adding 'static const' for arg numbers used with CallCFunction. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/ia32/codegen-ia32.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 } 758 }
759 759
760 // Backtrack stack overflow code. 760 // Backtrack stack overflow code.
761 if (stack_overflow_label_.is_linked()) { 761 if (stack_overflow_label_.is_linked()) {
762 SafeCallTarget(&stack_overflow_label_); 762 SafeCallTarget(&stack_overflow_label_);
763 // Reached if the backtrack-stack limit has been hit. 763 // Reached if the backtrack-stack limit has been hit.
764 764
765 Label grow_failed; 765 Label grow_failed;
766 766
767 // Call GrowStack(backtrack_stackpointer()) 767 // Call GrowStack(backtrack_stackpointer())
768 int num_arguments = 2; 768 static const int num_arguments = 2;
769 FrameAlign(num_arguments, r0); 769 FrameAlign(num_arguments, r0);
770 __ mov(r0, backtrack_stackpointer()); 770 __ mov(r0, backtrack_stackpointer());
771 __ add(r1, frame_pointer(), Operand(kStackHighEnd)); 771 __ add(r1, frame_pointer(), Operand(kStackHighEnd));
772 ExternalReference grow_stack = 772 ExternalReference grow_stack =
773 ExternalReference::re_grow_stack(); 773 ExternalReference::re_grow_stack();
774 CallCFunction(grow_stack, num_arguments); 774 CallCFunction(grow_stack, num_arguments);
775 // If return NULL, we have failed to grow the stack, and 775 // If return NULL, we have failed to grow the stack, and
776 // must exit with a stack-overflow exception. 776 // must exit with a stack-overflow exception.
777 __ cmp(r0, Operand(0)); 777 __ cmp(r0, Operand(0));
778 __ b(eq, &exit_with_exception); 778 __ b(eq, &exit_with_exception);
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 void RegExpMacroAssemblerARM::WriteStackPointerToRegister(int reg) { 959 void RegExpMacroAssemblerARM::WriteStackPointerToRegister(int reg) {
960 __ ldr(r1, MemOperand(frame_pointer(), kStackHighEnd)); 960 __ ldr(r1, MemOperand(frame_pointer(), kStackHighEnd));
961 __ sub(r0, backtrack_stackpointer(), r1); 961 __ sub(r0, backtrack_stackpointer(), r1);
962 __ str(r0, register_location(reg)); 962 __ str(r0, register_location(reg));
963 } 963 }
964 964
965 965
966 // Private methods: 966 // Private methods:
967 967
968 void RegExpMacroAssemblerARM::CallCheckStackGuardState(Register scratch) { 968 void RegExpMacroAssemblerARM::CallCheckStackGuardState(Register scratch) {
969 int num_arguments = 3; 969 static const int num_arguments = 3;
970 FrameAlign(num_arguments, scratch); 970 FrameAlign(num_arguments, scratch);
971 // RegExp code frame pointer. 971 // RegExp code frame pointer.
972 __ mov(r2, frame_pointer()); 972 __ mov(r2, frame_pointer());
973 // Code* of self. 973 // Code* of self.
974 __ mov(r1, Operand(masm_->CodeObject())); 974 __ mov(r1, Operand(masm_->CodeObject()));
975 // r0 becomes return address pointer. 975 // r0 becomes return address pointer.
976 ExternalReference stack_guard_check = 976 ExternalReference stack_guard_check =
977 ExternalReference::re_check_stack_guard_state(); 977 ExternalReference::re_check_stack_guard_state();
978 CallCFunctionUsingStub(stack_guard_check, num_arguments); 978 CallCFunctionUsingStub(stack_guard_check, num_arguments);
979 } 979 }
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 __ mov(r0, sp); 1257 __ mov(r0, sp);
1258 __ Call(r5); 1258 __ Call(r5);
1259 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); 1259 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex));
1260 } 1260 }
1261 1261
1262 #undef __ 1262 #undef __
1263 1263
1264 #endif // V8_NATIVE_REGEXP 1264 #endif // V8_NATIVE_REGEXP
1265 1265
1266 }} // namespace v8::internal 1266 }} // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698