| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 bool GenerateCode(); | 119 bool GenerateCode(); |
| 120 | 120 |
| 121 // Finish the code by setting stack height, safepoint, and bailout | 121 // Finish the code by setting stack height, safepoint, and bailout |
| 122 // information on it. | 122 // information on it. |
| 123 void FinishCode(Handle<Code> code); | 123 void FinishCode(Handle<Code> code); |
| 124 | 124 |
| 125 // Deferred code support. | 125 // Deferred code support. |
| 126 void DoDeferredNumberTagD(LNumberTagD* instr); | 126 void DoDeferredNumberTagD(LNumberTagD* instr); |
| 127 | 127 |
| 128 enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 }; | 128 enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 }; |
| 129 void DoDeferredNumberTagI(LInstruction* instr, | 129 void DoDeferredNumberTagIU(LInstruction* instr, |
| 130 LOperand* value, | 130 LOperand* value, |
| 131 IntegerSignedness signedness); | 131 LOperand* temp1, |
| 132 LOperand* temp2, |
| 133 IntegerSignedness signedness); |
| 132 | 134 |
| 133 void DoDeferredTaggedToI(LTaggedToI* instr); | 135 void DoDeferredTaggedToI(LTaggedToI* instr); |
| 134 void DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr); | 136 void DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr); |
| 135 void DoDeferredStackCheck(LStackCheck* instr); | 137 void DoDeferredStackCheck(LStackCheck* instr); |
| 136 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); | 138 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); |
| 137 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); | 139 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); |
| 138 void DoDeferredAllocate(LAllocate* instr); | 140 void DoDeferredAllocate(LAllocate* instr); |
| 139 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, | 141 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, |
| 140 Label* map_check); | 142 Label* map_check); |
| 141 void DoDeferredInstanceMigration(LCheckMaps* instr, Register object); | 143 void DoDeferredInstanceMigration(LCheckMaps* instr, Register object); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 155 | 157 |
| 156 // Emit frame translation commands for an environment. | 158 // Emit frame translation commands for an environment. |
| 157 void WriteTranslation(LEnvironment* environment, Translation* translation); | 159 void WriteTranslation(LEnvironment* environment, Translation* translation); |
| 158 | 160 |
| 159 // Declare methods that deal with the individual node types. | 161 // Declare methods that deal with the individual node types. |
| 160 #define DECLARE_DO(type) void Do##type(L##type* node); | 162 #define DECLARE_DO(type) void Do##type(L##type* node); |
| 161 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 163 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
| 162 #undef DECLARE_DO | 164 #undef DECLARE_DO |
| 163 | 165 |
| 164 private: | 166 private: |
| 165 StrictModeFlag strict_mode_flag() const { | 167 StrictMode strict_mode() const { return info()->strict_mode(); } |
| 166 return info()->is_classic_mode() ? kNonStrictMode : kStrictMode; | |
| 167 } | |
| 168 | 168 |
| 169 Scope* scope() const { return scope_; } | 169 Scope* scope() const { return scope_; } |
| 170 | 170 |
| 171 Register scratch0() { return r9; } | 171 Register scratch0() { return r9; } |
| 172 LowDwVfpRegister double_scratch0() { return kScratchDoubleReg; } | 172 LowDwVfpRegister double_scratch0() { return kScratchDoubleReg; } |
| 173 | 173 |
| 174 LInstruction* GetNextInstruction(); | 174 LInstruction* GetNextInstruction(); |
| 175 | 175 |
| 176 void EmitClassOfTest(Label* if_true, | 176 void EmitClassOfTest(Label* if_true, |
| 177 Label* if_false, | 177 Label* if_false, |
| 178 Handle<String> class_name, | 178 Handle<String> class_name, |
| 179 Register input, | 179 Register input, |
| 180 Register temporary, | 180 Register temporary, |
| 181 Register temporary2); | 181 Register temporary2); |
| 182 | 182 |
| 183 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } | 183 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } |
| 184 | 184 |
| 185 void Abort(BailoutReason reason); | 185 void Abort(BailoutReason reason); |
| 186 | 186 |
| 187 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } | 187 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } |
| 188 | 188 |
| 189 void SaveCallerDoubles(); | 189 void SaveCallerDoubles(); |
| 190 void RestoreCallerDoubles(); | 190 void RestoreCallerDoubles(); |
| 191 | 191 |
| 192 // Code generation passes. Returns true if code generation should | 192 // Code generation passes. Returns true if code generation should |
| 193 // continue. | 193 // continue. |
| 194 void GenerateBodyInstructionPre(LInstruction* instr) V8_OVERRIDE; |
| 194 bool GeneratePrologue(); | 195 bool GeneratePrologue(); |
| 195 bool GenerateDeferredCode(); | 196 bool GenerateDeferredCode(); |
| 196 bool GenerateDeoptJumpTable(); | 197 bool GenerateDeoptJumpTable(); |
| 197 bool GenerateSafepointTable(); | 198 bool GenerateSafepointTable(); |
| 198 | 199 |
| 199 // Generates the custom OSR entrypoint and sets the osr_pc_offset. | 200 // Generates the custom OSR entrypoint and sets the osr_pc_offset. |
| 200 void GenerateOsrPrologue(); | 201 void GenerateOsrPrologue(); |
| 201 | 202 |
| 202 enum SafepointMode { | 203 enum SafepointMode { |
| 203 RECORD_SIMPLE_SAFEPOINT, | 204 RECORD_SIMPLE_SAFEPOINT, |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 void EmitIsConstructCall(Register temp1, Register temp2); | 341 void EmitIsConstructCall(Register temp1, Register temp2); |
| 341 | 342 |
| 342 // Emits optimized code to deep-copy the contents of statically known | 343 // Emits optimized code to deep-copy the contents of statically known |
| 343 // object graphs (e.g. object literal boilerplate). | 344 // object graphs (e.g. object literal boilerplate). |
| 344 void EmitDeepCopy(Handle<JSObject> object, | 345 void EmitDeepCopy(Handle<JSObject> object, |
| 345 Register result, | 346 Register result, |
| 346 Register source, | 347 Register source, |
| 347 int* offset, | 348 int* offset, |
| 348 AllocationSiteMode mode); | 349 AllocationSiteMode mode); |
| 349 | 350 |
| 350 // Emit optimized code for integer division. | |
| 351 // Inputs are signed. | |
| 352 // All registers are clobbered. | |
| 353 // If 'remainder' is no_reg, it is not computed. | |
| 354 void EmitSignedIntegerDivisionByConstant(Register result, | |
| 355 Register dividend, | |
| 356 int32_t divisor, | |
| 357 Register remainder, | |
| 358 Register scratch, | |
| 359 LEnvironment* environment); | |
| 360 | |
| 361 void EnsureSpaceForLazyDeopt(int space_needed) V8_OVERRIDE; | 351 void EnsureSpaceForLazyDeopt(int space_needed) V8_OVERRIDE; |
| 362 void DoLoadKeyedExternalArray(LLoadKeyed* instr); | 352 void DoLoadKeyedExternalArray(LLoadKeyed* instr); |
| 363 void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr); | 353 void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr); |
| 364 void DoLoadKeyedFixedArray(LLoadKeyed* instr); | 354 void DoLoadKeyedFixedArray(LLoadKeyed* instr); |
| 365 void DoStoreKeyedExternalArray(LStoreKeyed* instr); | 355 void DoStoreKeyedExternalArray(LStoreKeyed* instr); |
| 366 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); | 356 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); |
| 367 void DoStoreKeyedFixedArray(LStoreKeyed* instr); | 357 void DoStoreKeyedFixedArray(LStoreKeyed* instr); |
| 368 | 358 |
| 369 ZoneList<LEnvironment*> deoptimizations_; | 359 ZoneList<LEnvironment*> deoptimizations_; |
| 370 ZoneList<Deoptimizer::JumpTableEntry> deopt_jump_table_; | 360 ZoneList<Deoptimizer::JumpTableEntry> deopt_jump_table_; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 LCodeGen* codegen_; | 449 LCodeGen* codegen_; |
| 460 Label entry_; | 450 Label entry_; |
| 461 Label exit_; | 451 Label exit_; |
| 462 Label* external_exit_; | 452 Label* external_exit_; |
| 463 int instruction_index_; | 453 int instruction_index_; |
| 464 }; | 454 }; |
| 465 | 455 |
| 466 } } // namespace v8::internal | 456 } } // namespace v8::internal |
| 467 | 457 |
| 468 #endif // V8_ARM_LITHIUM_CODEGEN_ARM_H_ | 458 #endif // V8_ARM_LITHIUM_CODEGEN_ARM_H_ |
| OLD | NEW |