| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 const ParameterCount& actual, | 128 const ParameterCount& actual, |
| 129 RelocInfo::Mode rmode, | 129 RelocInfo::Mode rmode, |
| 130 InvokeFlag flag); | 130 InvokeFlag flag); |
| 131 | 131 |
| 132 // Invoke the JavaScript function in the given register. Changes the | 132 // Invoke the JavaScript function in the given register. Changes the |
| 133 // current context to the context in the function before invoking. | 133 // current context to the context in the function before invoking. |
| 134 void InvokeFunction(Register function, | 134 void InvokeFunction(Register function, |
| 135 const ParameterCount& actual, | 135 const ParameterCount& actual, |
| 136 InvokeFlag flag); | 136 InvokeFlag flag); |
| 137 | 137 |
| 138 void InvokeFunction(JSFunction* function, |
| 139 const ParameterCount& actual, |
| 140 InvokeFlag flag); |
| 141 |
| 138 | 142 |
| 139 #ifdef ENABLE_DEBUGGER_SUPPORT | 143 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 140 // --------------------------------------------------------------------------- | 144 // --------------------------------------------------------------------------- |
| 141 // Debugger Support | 145 // Debugger Support |
| 142 | 146 |
| 143 void SaveRegistersToMemory(RegList regs); | 147 void SaveRegistersToMemory(RegList regs); |
| 144 void RestoreRegistersFromMemory(RegList regs); | 148 void RestoreRegistersFromMemory(RegList regs); |
| 145 void CopyRegistersFromMemoryToStack(Register base, RegList regs); | 149 void CopyRegistersFromMemoryToStack(Register base, RegList regs); |
| 146 void CopyRegistersFromStackToMemory(Register base, | 150 void CopyRegistersFromStackToMemory(Register base, |
| 147 Register scratch, | 151 Register scratch, |
| 148 RegList regs); | 152 RegList regs); |
| 153 void DebugBreak(); |
| 149 #endif | 154 #endif |
| 150 | 155 |
| 151 // --------------------------------------------------------------------------- | 156 // --------------------------------------------------------------------------- |
| 152 // Exception handling | 157 // Exception handling |
| 153 | 158 |
| 154 // Push a new try handler and link into try handler chain. | 159 // Push a new try handler and link into try handler chain. |
| 155 // The return address must be passed in register lr. | 160 // The return address must be passed in register lr. |
| 156 // On exit, r0 contains TOS (code slot). | 161 // On exit, r0 contains TOS (code slot). |
| 157 void PushTryHandler(CodeLocation try_location, HandlerType type); | 162 void PushTryHandler(CodeLocation try_location, HandlerType type); |
| 158 | 163 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 // Return from a code stub after popping its arguments. | 332 // Return from a code stub after popping its arguments. |
| 328 void StubReturn(int argc); | 333 void StubReturn(int argc); |
| 329 | 334 |
| 330 // Call a runtime routine. | 335 // Call a runtime routine. |
| 331 // Eventually this should be used for all C calls. | 336 // Eventually this should be used for all C calls. |
| 332 void CallRuntime(Runtime::Function* f, int num_arguments); | 337 void CallRuntime(Runtime::Function* f, int num_arguments); |
| 333 | 338 |
| 334 // Convenience function: Same as above, but takes the fid instead. | 339 // Convenience function: Same as above, but takes the fid instead. |
| 335 void CallRuntime(Runtime::FunctionId fid, int num_arguments); | 340 void CallRuntime(Runtime::FunctionId fid, int num_arguments); |
| 336 | 341 |
| 342 // Convenience function: call an external reference. |
| 343 void CallExternalReference(const ExternalReference& ext, |
| 344 int num_arguments); |
| 345 |
| 337 // Tail call of a runtime routine (jump). | 346 // Tail call of a runtime routine (jump). |
| 338 // Like JumpToRuntime, but also takes care of passing the number | 347 // Like JumpToRuntime, but also takes care of passing the number |
| 339 // of parameters. | 348 // of parameters. |
| 340 void TailCallRuntime(const ExternalReference& ext, | 349 void TailCallRuntime(const ExternalReference& ext, |
| 341 int num_arguments, | 350 int num_arguments, |
| 342 int result_size); | 351 int result_size); |
| 343 | 352 |
| 344 // Jump to a runtime routine. | 353 // Jump to a runtime routine. |
| 345 void JumpToRuntime(const ExternalReference& builtin); | 354 void JumpToRuntime(const ExternalReference& builtin); |
| 346 | 355 |
| 347 // Invoke specified builtin JavaScript function. Adds an entry to | 356 // Invoke specified builtin JavaScript function. Adds an entry to |
| 348 // the unresolved list if the name does not resolve. | 357 // the unresolved list if the name does not resolve. |
| 349 void InvokeBuiltin(Builtins::JavaScript id, InvokeJSFlags flags); | 358 void InvokeBuiltin(Builtins::JavaScript id, InvokeJSFlags flags); |
| 350 | 359 |
| 351 // Store the code object for the given builtin in the target register and | 360 // Store the code object for the given builtin in the target register and |
| 352 // setup the function in r1. | 361 // setup the function in r1. |
| 353 void GetBuiltinEntry(Register target, Builtins::JavaScript id); | 362 void GetBuiltinEntry(Register target, Builtins::JavaScript id); |
| 354 | 363 |
| 355 struct Unresolved { | |
| 356 int pc; | |
| 357 uint32_t flags; // see Bootstrapper::FixupFlags decoders/encoders. | |
| 358 const char* name; | |
| 359 }; | |
| 360 List<Unresolved>* unresolved() { return &unresolved_; } | |
| 361 | |
| 362 Handle<Object> CodeObject() { return code_object_; } | 364 Handle<Object> CodeObject() { return code_object_; } |
| 363 | 365 |
| 364 | 366 |
| 365 // --------------------------------------------------------------------------- | 367 // --------------------------------------------------------------------------- |
| 366 // StatsCounter support | 368 // StatsCounter support |
| 367 | 369 |
| 368 void SetCounter(StatsCounter* counter, int value, | 370 void SetCounter(StatsCounter* counter, int value, |
| 369 Register scratch1, Register scratch2); | 371 Register scratch1, Register scratch2); |
| 370 void IncrementCounter(StatsCounter* counter, int value, | 372 void IncrementCounter(StatsCounter* counter, int value, |
| 371 Register scratch1, Register scratch2); | 373 Register scratch1, Register scratch2); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 void Call(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); | 426 void Call(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); |
| 425 | 427 |
| 426 // Helper functions for generating invokes. | 428 // Helper functions for generating invokes. |
| 427 void InvokePrologue(const ParameterCount& expected, | 429 void InvokePrologue(const ParameterCount& expected, |
| 428 const ParameterCount& actual, | 430 const ParameterCount& actual, |
| 429 Handle<Code> code_constant, | 431 Handle<Code> code_constant, |
| 430 Register code_reg, | 432 Register code_reg, |
| 431 Label* done, | 433 Label* done, |
| 432 InvokeFlag flag); | 434 InvokeFlag flag); |
| 433 | 435 |
| 434 // Prepares for a call or jump to a builtin by doing two things: | |
| 435 // 1. Emits code that fetches the builtin's function object from the context | |
| 436 // at runtime, and puts it in the register rdi. | |
| 437 // 2. Fetches the builtin's code object, and returns it in a handle, at | |
| 438 // compile time, so that later code can emit instructions to jump or call | |
| 439 // the builtin directly. If the code object has not yet been created, it | |
| 440 // returns the builtin code object for IllegalFunction, and sets the | |
| 441 // output parameter "resolved" to false. Code that uses the return value | |
| 442 // should then add the address and the builtin name to the list of fixups | |
| 443 // called unresolved_, which is fixed up by the bootstrapper. | |
| 444 Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved); | |
| 445 | |
| 446 // Activation support. | 436 // Activation support. |
| 447 void EnterFrame(StackFrame::Type type); | 437 void EnterFrame(StackFrame::Type type); |
| 448 void LeaveFrame(StackFrame::Type type); | 438 void LeaveFrame(StackFrame::Type type); |
| 449 | 439 |
| 450 List<Unresolved> unresolved_; | |
| 451 bool generating_stub_; | 440 bool generating_stub_; |
| 452 bool allow_stub_calls_; | 441 bool allow_stub_calls_; |
| 453 // This handle will be patched with the code object on installation. | 442 // This handle will be patched with the code object on installation. |
| 454 Handle<Object> code_object_; | 443 Handle<Object> code_object_; |
| 455 }; | 444 }; |
| 456 | 445 |
| 457 | 446 |
| 458 #ifdef ENABLE_DEBUGGER_SUPPORT | 447 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 459 // The code patcher is used to patch (typically) small parts of code e.g. for | 448 // The code patcher is used to patch (typically) small parts of code e.g. for |
| 460 // debugging and other types of instrumentation. When using the code patcher | 449 // debugging and other types of instrumentation. When using the code patcher |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 482 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
| 494 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 483 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
| 495 #else | 484 #else |
| 496 #define ACCESS_MASM(masm) masm-> | 485 #define ACCESS_MASM(masm) masm-> |
| 497 #endif | 486 #endif |
| 498 | 487 |
| 499 | 488 |
| 500 } } // namespace v8::internal | 489 } } // namespace v8::internal |
| 501 | 490 |
| 502 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 491 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
| OLD | NEW |