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

Side by Side Diff: src/arm/simulator-arm.h

Issue 242014: Adds an API for setting the stack limit per-thread. (Closed)
Patch Set: Leaves the limits of pending interrupts alone instead of reestablishing them." Created 11 years, 2 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/api.cc ('k') | src/execution.h » ('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 24 matching lines...) Expand all
35 35
36 #ifndef V8_ARM_SIMULATOR_ARM_H_ 36 #ifndef V8_ARM_SIMULATOR_ARM_H_
37 #define V8_ARM_SIMULATOR_ARM_H_ 37 #define V8_ARM_SIMULATOR_ARM_H_
38 38
39 #if defined(__arm__) 39 #if defined(__arm__)
40 40
41 // When running without a simulator we call the entry directly. 41 // When running without a simulator we call the entry directly.
42 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ 42 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
43 (entry(p0, p1, p2, p3, p4)) 43 (entry(p0, p1, p2, p3, p4))
44 44
45 // Calculated the stack limit beyond which we will throw stack overflow errors. 45 // The stack limit beyond which we will throw stack overflow errors in
46 // This macro must be called from a C++ method. It relies on being able to take 46 // generated code. Because generated code on arm uses the C stack, we
47 // the address of "this" to get a value on the current execution stack and then 47 // just use the C stack limit.
48 // calculates the stack limit based on that value. 48 #define GENERATED_CODE_STACK_LIMIT(c_limit) \
49 #define GENERATED_CODE_STACK_LIMIT(limit) \ 49 (c_limit)
50 (reinterpret_cast<uintptr_t>(this) - limit)
51 50
52 51
53 // Call the generated regexp code directly. The entry function pointer should 52 // Call the generated regexp code directly. The entry function pointer should
54 // expect seven int/pointer sized arguments and return an int. 53 // expect seven int/pointer sized arguments and return an int.
55 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \ 54 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
56 entry(p0, p1, p2, p3, p4, p5, p6) 55 entry(p0, p1, p2, p3, p4, p5, p6)
57 56
58 #else // defined(__arm__) 57 #else // defined(__arm__)
59 58
60 // When running with the simulator transition into simulated execution at this 59 // When running with the simulator transition into simulated execution at this
61 // point. 60 // point.
62 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ 61 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
63 reinterpret_cast<Object*>( \ 62 reinterpret_cast<Object*>( \
64 assembler::arm::Simulator::current()->Call(FUNCTION_ADDR(entry), 5, \ 63 assembler::arm::Simulator::current()->Call(FUNCTION_ADDR(entry), 5, \
65 p0, p1, p2, p3, p4)) 64 p0, p1, p2, p3, p4))
66 65
67 // The simulator has its own stack. Thus it has a different stack limit from 66 // The simulator has its own stack. Thus it has a different stack limit from
68 // the C-based native code. 67 // the C-based native code.
69 #define GENERATED_CODE_STACK_LIMIT(limit) \ 68 #define GENERATED_CODE_STACK_LIMIT(c_limit) \
70 (assembler::arm::Simulator::current()->StackLimit()) 69 (assembler::arm::Simulator::current()->StackLimit())
71 70
72 71
73 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \ 72 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
74 assembler::arm::Simulator::current()->Call( \ 73 assembler::arm::Simulator::current()->Call( \
75 FUNCTION_ADDR(entry), 7, p0, p1, p2, p3, p4, p5, p6) 74 FUNCTION_ADDR(entry), 7, p0, p1, p2, p3, p4, p5, p6)
76 75
77 #include "constants-arm.h" 76 #include "constants-arm.h"
78 77
79 78
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 // registered breakpoints 214 // registered breakpoints
216 Instr* break_pc_; 215 Instr* break_pc_;
217 instr_t break_instr_; 216 instr_t break_instr_;
218 }; 217 };
219 218
220 } } // namespace assembler::arm 219 } } // namespace assembler::arm
221 220
222 #endif // defined(__arm__) 221 #endif // defined(__arm__)
223 222
224 #endif // V8_ARM_SIMULATOR_ARM_H_ 223 #endif // V8_ARM_SIMULATOR_ARM_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/execution.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698