| 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 30 matching lines...) Expand all Loading... |
| 41 class JumpTarget; | 41 class JumpTarget; |
| 42 | 42 |
| 43 // MacroAssembler implements a collection of frequently used macros. | 43 // MacroAssembler implements a collection of frequently used macros. |
| 44 class MacroAssembler: public Assembler { | 44 class MacroAssembler: public Assembler { |
| 45 public: | 45 public: |
| 46 MacroAssembler(void* buffer, int size); | 46 MacroAssembler(void* buffer, int size); |
| 47 | 47 |
| 48 // --------------------------------------------------------------------------- | 48 // --------------------------------------------------------------------------- |
| 49 // GC Support | 49 // GC Support |
| 50 | 50 |
| 51 |
| 52 void RecordWriteHelper(Register object, |
| 53 Register addr, |
| 54 Register scratch); |
| 55 |
| 56 // Check if object is in new space. |
| 57 // scratch can be object itself, but it will be clobbered. |
| 58 void InNewSpace(Register object, |
| 59 Register scratch, |
| 60 Condition cc, // equal for new space, not_equal otherwise. |
| 61 Label* branch); |
| 62 |
| 51 // Set the remembered set bit for [object+offset]. | 63 // Set the remembered set bit for [object+offset]. |
| 52 // object is the object being stored into, value is the object being stored. | 64 // object is the object being stored into, value is the object being stored. |
| 53 // If offset is zero, then the scratch register contains the array index into | 65 // If offset is zero, then the scratch register contains the array index into |
| 54 // the elements array represented as a Smi. | 66 // the elements array represented as a Smi. |
| 55 // All registers are clobbered by the operation. | 67 // All registers are clobbered by the operation. |
| 56 void RecordWrite(Register object, | 68 void RecordWrite(Register object, |
| 57 int offset, | 69 int offset, |
| 58 Register value, | 70 Register value, |
| 59 Register scratch); | 71 Register scratch); |
| 60 | 72 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 Register map, | 175 Register map, |
| 164 Register instance_type); | 176 Register instance_type); |
| 165 | 177 |
| 166 // FCmp is similar to integer cmp, but requires unsigned | 178 // FCmp is similar to integer cmp, but requires unsigned |
| 167 // jcc instructions (je, ja, jae, jb, jbe, je, and jz). | 179 // jcc instructions (je, ja, jae, jb, jbe, je, and jz). |
| 168 void FCmp(); | 180 void FCmp(); |
| 169 | 181 |
| 170 // Smi tagging support. | 182 // Smi tagging support. |
| 171 void SmiTag(Register reg) { | 183 void SmiTag(Register reg) { |
| 172 ASSERT(kSmiTag == 0); | 184 ASSERT(kSmiTag == 0); |
| 173 shl(reg, kSmiTagSize); | 185 ASSERT(kSmiTagSize == 1); |
| 186 add(reg, Operand(reg)); |
| 174 } | 187 } |
| 175 void SmiUntag(Register reg) { | 188 void SmiUntag(Register reg) { |
| 176 sar(reg, kSmiTagSize); | 189 sar(reg, kSmiTagSize); |
| 177 } | 190 } |
| 178 | 191 |
| 179 // Abort execution if argument is not a number. Used in debug code. | 192 // Abort execution if argument is not a number. Used in debug code. |
| 180 void AbortIfNotNumber(Register object, const char* msg); | 193 void AbortIfNotNumber(Register object); |
| 194 |
| 195 // Abort execution if argument is not a smi. Used in debug code. |
| 196 void AbortIfNotSmi(Register object); |
| 181 | 197 |
| 182 // --------------------------------------------------------------------------- | 198 // --------------------------------------------------------------------------- |
| 183 // Exception handling | 199 // Exception handling |
| 184 | 200 |
| 185 // Push a new try handler and link into try handler chain. The return | 201 // Push a new try handler and link into try handler chain. The return |
| 186 // address must be pushed before calling this helper. | 202 // address must be pushed before calling this helper. |
| 187 void PushTryHandler(CodeLocation try_location, HandlerType type); | 203 void PushTryHandler(CodeLocation try_location, HandlerType type); |
| 188 | 204 |
| 189 // Unlink the stack handler on top of the stack from the try handler chain. | 205 // Unlink the stack handler on top of the stack from the try handler chain. |
| 190 void PopTryHandler(); | 206 void PopTryHandler(); |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 bool allow_stub_calls() { return allow_stub_calls_; } | 470 bool allow_stub_calls() { return allow_stub_calls_; } |
| 455 | 471 |
| 456 // --------------------------------------------------------------------------- | 472 // --------------------------------------------------------------------------- |
| 457 // String utilities. | 473 // String utilities. |
| 458 | 474 |
| 459 // Check whether the instance type represents a flat ascii string. Jump to the | 475 // Check whether the instance type represents a flat ascii string. Jump to the |
| 460 // label if not. If the instance type can be scratched specify same register | 476 // label if not. If the instance type can be scratched specify same register |
| 461 // for both instance type and scratch. | 477 // for both instance type and scratch. |
| 462 void JumpIfInstanceTypeIsNotSequentialAscii(Register instance_type, | 478 void JumpIfInstanceTypeIsNotSequentialAscii(Register instance_type, |
| 463 Register scratch, | 479 Register scratch, |
| 464 Label *on_not_flat_ascii_string); | 480 Label* on_not_flat_ascii_string); |
| 465 | 481 |
| 466 // Checks if both objects are sequential ASCII strings, and jumps to label | 482 // Checks if both objects are sequential ASCII strings, and jumps to label |
| 467 // if either is not. | 483 // if either is not. |
| 468 void JumpIfNotBothSequentialAsciiStrings(Register object1, | 484 void JumpIfNotBothSequentialAsciiStrings(Register object1, |
| 469 Register object2, | 485 Register object2, |
| 470 Register scratch1, | 486 Register scratch1, |
| 471 Register scratch2, | 487 Register scratch2, |
| 472 Label *on_not_flat_ascii_strings); | 488 Label* on_not_flat_ascii_strings); |
| 473 | 489 |
| 474 private: | 490 private: |
| 475 bool generating_stub_; | 491 bool generating_stub_; |
| 476 bool allow_stub_calls_; | 492 bool allow_stub_calls_; |
| 477 // This handle will be patched with the code object on installation. | 493 // This handle will be patched with the code object on installation. |
| 478 Handle<Object> code_object_; | 494 Handle<Object> code_object_; |
| 479 | 495 |
| 480 // Helper functions for generating invokes. | 496 // Helper functions for generating invokes. |
| 481 void InvokePrologue(const ParameterCount& expected, | 497 void InvokePrologue(const ParameterCount& expected, |
| 482 const ParameterCount& actual, | 498 const ParameterCount& actual, |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 } \ | 580 } \ |
| 565 masm-> | 581 masm-> |
| 566 #else | 582 #else |
| 567 #define ACCESS_MASM(masm) masm-> | 583 #define ACCESS_MASM(masm) masm-> |
| 568 #endif | 584 #endif |
| 569 | 585 |
| 570 | 586 |
| 571 } } // namespace v8::internal | 587 } } // namespace v8::internal |
| 572 | 588 |
| 573 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 589 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
| OLD | NEW |