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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 void Ret(); | 378 void Ret(); |
379 | 379 |
380 // Emit code to discard a non-negative number of pointer-sized elements | 380 // Emit code to discard a non-negative number of pointer-sized elements |
381 // from the stack, clobbering only the esp register. | 381 // from the stack, clobbering only the esp register. |
382 void Drop(int element_count); | 382 void Drop(int element_count); |
383 | 383 |
384 void Call(Label* target) { call(target); } | 384 void Call(Label* target) { call(target); } |
385 | 385 |
386 void Move(Register target, Handle<Object> value); | 386 void Move(Register target, Handle<Object> value); |
387 | 387 |
388 struct Unresolved { | |
389 int pc; | |
390 uint32_t flags; // see Bootstrapper::FixupFlags decoders/encoders. | |
391 const char* name; | |
392 }; | |
393 List<Unresolved>* unresolved() { return &unresolved_; } | |
394 | |
395 Handle<Object> CodeObject() { return code_object_; } | 388 Handle<Object> CodeObject() { return code_object_; } |
396 | 389 |
397 | 390 |
398 // --------------------------------------------------------------------------- | 391 // --------------------------------------------------------------------------- |
399 // StatsCounter support | 392 // StatsCounter support |
400 | 393 |
401 void SetCounter(StatsCounter* counter, int value); | 394 void SetCounter(StatsCounter* counter, int value); |
402 void IncrementCounter(StatsCounter* counter, int value); | 395 void IncrementCounter(StatsCounter* counter, int value); |
403 void DecrementCounter(StatsCounter* counter, int value); | 396 void DecrementCounter(StatsCounter* counter, int value); |
404 void IncrementCounter(Condition cc, StatsCounter* counter, int value); | 397 void IncrementCounter(Condition cc, StatsCounter* counter, int value); |
(...skipping 24 matching lines...) Expand all Loading... |
429 | 422 |
430 // Checks if both objects are sequential ASCII strings, and jumps to label | 423 // Checks if both objects are sequential ASCII strings, and jumps to label |
431 // if either is not. | 424 // if either is not. |
432 void JumpIfNotBothSequentialAsciiStrings(Register object1, | 425 void JumpIfNotBothSequentialAsciiStrings(Register object1, |
433 Register object2, | 426 Register object2, |
434 Register scratch1, | 427 Register scratch1, |
435 Register scratch2, | 428 Register scratch2, |
436 Label *on_not_flat_ascii_strings); | 429 Label *on_not_flat_ascii_strings); |
437 | 430 |
438 private: | 431 private: |
439 List<Unresolved> unresolved_; | |
440 bool generating_stub_; | 432 bool generating_stub_; |
441 bool allow_stub_calls_; | 433 bool allow_stub_calls_; |
442 // This handle will be patched with the code object on installation. | 434 // This handle will be patched with the code object on installation. |
443 Handle<Object> code_object_; | 435 Handle<Object> code_object_; |
444 | 436 |
445 // Helper functions for generating invokes. | 437 // Helper functions for generating invokes. |
446 void InvokePrologue(const ParameterCount& expected, | 438 void InvokePrologue(const ParameterCount& expected, |
447 const ParameterCount& actual, | 439 const ParameterCount& actual, |
448 Handle<Code> code_constant, | 440 Handle<Code> code_constant, |
449 const Operand& code_operand, | 441 const Operand& code_operand, |
450 Label* done, | 442 Label* done, |
451 InvokeFlag flag); | 443 InvokeFlag flag); |
452 | 444 |
453 // Prepares for a call or jump to a builtin by doing two things: | |
454 // 1. Emits code that fetches the builtin's function object from the context | |
455 // at runtime, and puts it in the register rdi. | |
456 // 2. Fetches the builtin's code object, and returns it in a handle, at | |
457 // compile time, so that later code can emit instructions to jump or call | |
458 // the builtin directly. If the code object has not yet been created, it | |
459 // returns the builtin code object for IllegalFunction, and sets the | |
460 // output parameter "resolved" to false. Code that uses the return value | |
461 // should then add the address and the builtin name to the list of fixups | |
462 // called unresolved_, which is fixed up by the bootstrapper. | |
463 Handle<Code> ResolveBuiltin(Builtins::JavaScript id, bool* resolved); | |
464 | |
465 // Activation support. | 445 // Activation support. |
466 void EnterFrame(StackFrame::Type type); | 446 void EnterFrame(StackFrame::Type type); |
467 void LeaveFrame(StackFrame::Type type); | 447 void LeaveFrame(StackFrame::Type type); |
468 | 448 |
469 void EnterExitFramePrologue(ExitFrame::Mode mode); | 449 void EnterExitFramePrologue(ExitFrame::Mode mode); |
470 void EnterExitFrameEpilogue(ExitFrame::Mode mode, int argc); | 450 void EnterExitFrameEpilogue(ExitFrame::Mode mode, int argc); |
471 | 451 |
472 // Allocation support helpers. | 452 // Allocation support helpers. |
473 void LoadAllocationTopHelper(Register result, | 453 void LoadAllocationTopHelper(Register result, |
474 Register result_end, | 454 Register result_end, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 } \ | 521 } \ |
542 masm-> | 522 masm-> |
543 #else | 523 #else |
544 #define ACCESS_MASM(masm) masm-> | 524 #define ACCESS_MASM(masm) masm-> |
545 #endif | 525 #endif |
546 | 526 |
547 | 527 |
548 } } // namespace v8::internal | 528 } } // namespace v8::internal |
549 | 529 |
550 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 530 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |