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

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

Issue 3825001: Added USE_SIMULATOR macro that explicitly indicates that we wish to use the s... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/simulator-arm.cc ('k') | src/mips/simulator-mips.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 20 matching lines...) Expand all
31 // on regular desktop machines. 31 // on regular desktop machines.
32 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro, 32 // V8 calls into generated code by "calling" the CALL_GENERATED_CODE macro,
33 // which will start execution in the Simulator or forwards to the real entry 33 // which will start execution in the Simulator or forwards to the real entry
34 // on a MIPS HW platform. 34 // on a MIPS HW platform.
35 35
36 #ifndef V8_MIPS_SIMULATOR_MIPS_H_ 36 #ifndef V8_MIPS_SIMULATOR_MIPS_H_
37 #define V8_MIPS_SIMULATOR_MIPS_H_ 37 #define V8_MIPS_SIMULATOR_MIPS_H_
38 38
39 #include "allocation.h" 39 #include "allocation.h"
40 40
41 #if defined(__mips) 41 #if defined(__mips) && !defined(USE_SIMULATOR)
42 42
43 // When running without a simulator we call the entry directly. 43 // When running without a simulator we call the entry directly.
44 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ 44 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
45 entry(p0, p1, p2, p3, p4); 45 entry(p0, p1, p2, p3, p4);
46 46
47 // The stack limit beyond which we will throw stack overflow errors in 47 // The stack limit beyond which we will throw stack overflow errors in
48 // generated code. Because generated code on mips uses the C stack, we 48 // generated code. Because generated code on mips uses the C stack, we
49 // just use the C stack limit. 49 // just use the C stack limit.
50 class SimulatorStack : public v8::internal::AllStatic { 50 class SimulatorStack : public v8::internal::AllStatic {
51 public: 51 public:
(...skipping 20 matching lines...) Expand all
72 72
73 // Call the generated regexp code directly. The entry function pointer should 73 // Call the generated regexp code directly. The entry function pointer should
74 // expect seven int/pointer sized arguments and return an int. 74 // expect seven int/pointer sized arguments and return an int.
75 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \ 75 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
76 entry(p0, p1, p2, p3, p4, p5, p6) 76 entry(p0, p1, p2, p3, p4, p5, p6)
77 77
78 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ 78 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
79 reinterpret_cast<TryCatch*>(try_catch_address) 79 reinterpret_cast<TryCatch*>(try_catch_address)
80 80
81 81
82 #else // #if defined(__mips) 82 #else // #if !defined(__mips) || defined(USE_SIMULATOR)
83 83
84 // When running with the simulator transition into simulated execution at this 84 // When running with the simulator transition into simulated execution at this
85 // point. 85 // point.
86 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ 86 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
87 reinterpret_cast<Object*>(\ 87 reinterpret_cast<Object*>(\
88 assembler::mips::Simulator::current()->Call(FUNCTION_ADDR(entry), 5, \ 88 assembler::mips::Simulator::current()->Call(FUNCTION_ADDR(entry), 5, \
89 p0, p1, p2, p3, p4)) 89 p0, p1, p2, p3, p4))
90 90
91 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \ 91 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6) \
92 assembler::mips::Simulator::current()->Call(\ 92 assembler::mips::Simulator::current()->Call(\
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 static inline uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) { 298 static inline uintptr_t RegisterCTryCatch(uintptr_t try_catch_address) {
299 assembler::mips::Simulator* sim = assembler::mips::Simulator::current(); 299 assembler::mips::Simulator* sim = assembler::mips::Simulator::current();
300 return sim->PushAddress(try_catch_address); 300 return sim->PushAddress(try_catch_address);
301 } 301 }
302 302
303 static inline void UnregisterCTryCatch() { 303 static inline void UnregisterCTryCatch() {
304 assembler::mips::Simulator::current()->PopAddress(); 304 assembler::mips::Simulator::current()->PopAddress();
305 } 305 }
306 }; 306 };
307 307
308 #endif // defined(__mips) 308 #endif // !defined(__mips) || defined(USE_SIMULATOR)
309 309
310 #endif // V8_MIPS_SIMULATOR_MIPS_H_ 310 #endif // V8_MIPS_SIMULATOR_MIPS_H_
311 311
OLDNEW
« no previous file with comments | « src/arm/simulator-arm.cc ('k') | src/mips/simulator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698