| 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 void JumpToRuntime(const ExternalReference& builtin); | 346 void JumpToRuntime(const ExternalReference& builtin); |
| 347 | 347 |
| 348 // Invoke specified builtin JavaScript function. Adds an entry to | 348 // Invoke specified builtin JavaScript function. Adds an entry to |
| 349 // the unresolved list if the name does not resolve. | 349 // the unresolved list if the name does not resolve. |
| 350 void InvokeBuiltin(Builtins::JavaScript id, InvokeJSFlags flags); | 350 void InvokeBuiltin(Builtins::JavaScript id, InvokeJSFlags flags); |
| 351 | 351 |
| 352 // Store the code object for the given builtin in the target register and | 352 // Store the code object for the given builtin in the target register and |
| 353 // setup the function in r1. | 353 // setup the function in r1. |
| 354 void GetBuiltinEntry(Register target, Builtins::JavaScript id); | 354 void GetBuiltinEntry(Register target, Builtins::JavaScript id); |
| 355 | 355 |
| 356 struct Unresolved { | |
| 357 int pc; | |
| 358 uint32_t flags; // see Bootstrapper::FixupFlags decoders/encoders. | |
| 359 const char* name; | |
| 360 }; | |
| 361 List<Unresolved>* unresolved() { return &unresolved_; } | |
| 362 | |
| 363 Handle<Object> CodeObject() { return code_object_; } | 356 Handle<Object> CodeObject() { return code_object_; } |
| 364 | 357 |
| 365 | 358 |
| 366 // --------------------------------------------------------------------------- | 359 // --------------------------------------------------------------------------- |
| 367 // StatsCounter support | 360 // StatsCounter support |
| 368 | 361 |
| 369 void SetCounter(StatsCounter* counter, int value, | 362 void SetCounter(StatsCounter* counter, int value, |
| 370 Register scratch1, Register scratch2); | 363 Register scratch1, Register scratch2); |
| 371 void IncrementCounter(StatsCounter* counter, int value, | 364 void IncrementCounter(StatsCounter* counter, int value, |
| 372 Register scratch1, Register scratch2); | 365 Register scratch1, Register scratch2); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 void Call(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); | 418 void Call(intptr_t target, RelocInfo::Mode rmode, Condition cond = al); |
| 426 | 419 |
| 427 // Helper functions for generating invokes. | 420 // Helper functions for generating invokes. |
| 428 void InvokePrologue(const ParameterCount& expected, | 421 void InvokePrologue(const ParameterCount& expected, |
| 429 const ParameterCount& actual, | 422 const ParameterCount& actual, |
| 430 Handle<Code> code_constant, | 423 Handle<Code> code_constant, |
| 431 Register code_reg, | 424 Register code_reg, |
| 432 Label* done, | 425 Label* done, |
| 433 InvokeFlag flag); | 426 InvokeFlag flag); |
| 434 | 427 |
| 435 // Prepares for a call or jump to a builtin by doing two things: | |
| 436 // 1. Emits code that fetches the builtin's function object from the context | |
| 437 // at runtime, and puts it in the register rdi. | |
| 438 // 2. Fetches the builtin's code object, and returns it in a handle, at | |
| 439 // compile time, so that later code can emit instructions to jump or call | |
| 440 // the builtin directly. If the code object has not yet been created, it | |
| 441 // returns the builtin code object for IllegalFunction, and sets the | |
| 442 // output parameter "resolved" to false. Code that uses the return value | |
| 443 // should then add the address and the builtin name to the list of fixups | |
| 444 // called unresolved_, which is fixed up by the bootstrapper. | |
| 445 Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved); | |
| 446 | |
| 447 // Activation support. | 428 // Activation support. |
| 448 void EnterFrame(StackFrame::Type type); | 429 void EnterFrame(StackFrame::Type type); |
| 449 void LeaveFrame(StackFrame::Type type); | 430 void LeaveFrame(StackFrame::Type type); |
| 450 | 431 |
| 451 List<Unresolved> unresolved_; | |
| 452 bool generating_stub_; | 432 bool generating_stub_; |
| 453 bool allow_stub_calls_; | 433 bool allow_stub_calls_; |
| 454 // This handle will be patched with the code object on installation. | 434 // This handle will be patched with the code object on installation. |
| 455 Handle<Object> code_object_; | 435 Handle<Object> code_object_; |
| 456 }; | 436 }; |
| 457 | 437 |
| 458 | 438 |
| 459 #ifdef ENABLE_DEBUGGER_SUPPORT | 439 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 460 // The code patcher is used to patch (typically) small parts of code e.g. for | 440 // The code patcher is used to patch (typically) small parts of code e.g. for |
| 461 // debugging and other types of instrumentation. When using the code patcher | 441 // debugging and other types of instrumentation. When using the code patcher |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 474 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
| 495 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 475 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
| 496 #else | 476 #else |
| 497 #define ACCESS_MASM(masm) masm-> | 477 #define ACCESS_MASM(masm) masm-> |
| 498 #endif | 478 #endif |
| 499 | 479 |
| 500 | 480 |
| 501 } } // namespace v8::internal | 481 } } // namespace v8::internal |
| 502 | 482 |
| 503 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 483 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
| OLD | NEW |