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

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

Issue 7042031: MIPS: Minor fixes to simulator and builtins-mips. (Closed)
Patch Set: Rebased on r7964, updated for recent commits. Created 9 years, 7 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/mips/macro-assembler-mips.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // Running without a simulator on a native mips platform. 43 // Running without a simulator on a native mips platform.
44 44
45 namespace v8 { 45 namespace v8 {
46 namespace internal { 46 namespace internal {
47 47
48 // When running without a simulator we call the entry directly. 48 // When running without a simulator we call the entry directly.
49 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ 49 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
50 entry(p0, p1, p2, p3, p4) 50 entry(p0, p1, p2, p3, p4)
51 51
52 typedef int (*mips_regexp_matcher)(String*, int, const byte*, const byte*, 52 typedef int (*mips_regexp_matcher)(String*, int, const byte*, const byte*,
53 int*, Address, int, Isolate*); 53 void*, int*, Address, int, Isolate*);
54 54
55 55
56 // Call the generated regexp code directly. The code at the entry address 56 // Call the generated regexp code directly. The code at the entry address
57 // should act as a function matching the type arm_regexp_matcher. 57 // should act as a function matching the type arm_regexp_matcher.
58 // The fifth argument is a dummy that reserves the space used for 58 // The fifth argument is a dummy that reserves the space used for
59 // the return address added by the ExitFrame in native calls. 59 // the return address added by the ExitFrame in native calls.
60 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \ 60 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \
61 (FUNCTION_CAST<mips_regexp_matcher>(entry)(p0, p1, p2, p3, p4, p5, p6, p7)) 61 (FUNCTION_CAST<mips_regexp_matcher>(entry)( \
62 p0, p1, p2, p3, NULL, p4, p5, p6, p7))
62 63
63 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ 64 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
64 reinterpret_cast<TryCatch*>(try_catch_address) 65 reinterpret_cast<TryCatch*>(try_catch_address)
65 66
66 // The stack limit beyond which we will throw stack overflow errors in 67 // The stack limit beyond which we will throw stack overflow errors in
67 // generated code. Because generated code on mips uses the C stack, we 68 // generated code. Because generated code on mips uses the C stack, we
68 // just use the C stack limit. 69 // just use the C stack limit.
69 class SimulatorStack : public v8::internal::AllStatic { 70 class SimulatorStack : public v8::internal::AllStatic {
70 public: 71 public:
71 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate, 72 static inline uintptr_t JsLimitFromCLimit(Isolate* isolate,
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 355
355 356
356 // When running with the simulator transition into simulated execution at this 357 // When running with the simulator transition into simulated execution at this
357 // point. 358 // point.
358 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ 359 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
359 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \ 360 reinterpret_cast<Object*>(Simulator::current(Isolate::Current())->Call( \
360 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4)) 361 FUNCTION_ADDR(entry), 5, p0, p1, p2, p3, p4))
361 362
362 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \ 363 #define CALL_GENERATED_REGEXP_CODE(entry, p0, p1, p2, p3, p4, p5, p6, p7) \
363 Simulator::current(Isolate::Current())->Call( \ 364 Simulator::current(Isolate::Current())->Call( \
364 entry, 8, p0, p1, p2, p3, p4, p5, p6, p7) 365 entry, 9, p0, p1, p2, p3, NULL, p4, p5, p6, p7)
365 366
366 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \ 367 #define TRY_CATCH_FROM_ADDRESS(try_catch_address) \
367 try_catch_address == NULL ? \ 368 try_catch_address == NULL ? \
368 NULL : *(reinterpret_cast<TryCatch**>(try_catch_address)) 369 NULL : *(reinterpret_cast<TryCatch**>(try_catch_address))
369 370
370 371
371 // The simulator has its own stack. Thus it has a different stack limit from 372 // The simulator has its own stack. Thus it has a different stack limit from
372 // the C-based native code. Setting the c_limit to indicate a very small 373 // the C-based native code. Setting the c_limit to indicate a very small
373 // stack cause stack overflow errors, since the simulator ignores the input. 374 // stack cause stack overflow errors, since the simulator ignores the input.
374 // This is unlikely to be an issue in practice, though it might cause testing 375 // This is unlikely to be an issue in practice, though it might cause testing
(...skipping 13 matching lines...) Expand all
388 static inline void UnregisterCTryCatch() { 389 static inline void UnregisterCTryCatch() {
389 Simulator::current(Isolate::Current())->PopAddress(); 390 Simulator::current(Isolate::Current())->PopAddress();
390 } 391 }
391 }; 392 };
392 393
393 } } // namespace v8::internal 394 } } // namespace v8::internal
394 395
395 #endif // !defined(USE_SIMULATOR) 396 #endif // !defined(USE_SIMULATOR)
396 #endif // V8_MIPS_SIMULATOR_MIPS_H_ 397 #endif // V8_MIPS_SIMULATOR_MIPS_H_
397 398
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/mips/simulator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698