OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2011-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 |
11 // with the distribution. | 11 // with the distribution. |
12 // * Neither the name of Google Inc. nor the names of its | 12 // * Neither the name of Google Inc. nor the names of its |
13 // contributors may be used to endorse or promote products derived | 13 // contributors may be used to endorse or promote products derived |
14 // from this software without specific prior written permission. | 14 // from this software without specific prior written permission. |
15 // | 15 // |
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_ARM_LITHIUM_CODEGEN_ARM_H_ | 28 #ifndef V8_SH4_LITHIUM_CODEGEN_SH4_H_ |
29 #define V8_ARM_LITHIUM_CODEGEN_ARM_H_ | 29 #define V8_SH4_LITHIUM_CODEGEN_SH4_H_ |
30 | 30 |
31 #include "arm/lithium-arm.h" | 31 #include "sh4/lithium-sh4.h" |
32 #include "arm/lithium-gap-resolver-arm.h" | 32 #include "sh4/lithium-gap-resolver-sh4.h" |
33 #include "deoptimizer.h" | 33 #include "deoptimizer.h" |
34 #include "safepoint-table.h" | 34 #include "safepoint-table.h" |
35 #include "scopes.h" | 35 #include "scopes.h" |
36 | 36 |
37 namespace v8 { | 37 namespace v8 { |
38 namespace internal { | 38 namespace internal { |
39 | 39 |
40 // Forward declarations. | 40 // Forward declarations. |
41 class LDeferredCode; | 41 class LDeferredCode; |
42 class SafepointGenerator; | 42 class SafepointGenerator; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 bool is_aborted() const { return status_ == ABORTED; } | 172 bool is_aborted() const { return status_ == ABORTED; } |
173 | 173 |
174 StrictModeFlag strict_mode_flag() const { | 174 StrictModeFlag strict_mode_flag() const { |
175 return info()->is_classic_mode() ? kNonStrictMode : kStrictMode; | 175 return info()->is_classic_mode() ? kNonStrictMode : kStrictMode; |
176 } | 176 } |
177 | 177 |
178 LPlatformChunk* chunk() const { return chunk_; } | 178 LPlatformChunk* chunk() const { return chunk_; } |
179 Scope* scope() const { return scope_; } | 179 Scope* scope() const { return scope_; } |
180 HGraph* graph() const { return chunk_->graph(); } | 180 HGraph* graph() const { return chunk_->graph(); } |
181 | 181 |
182 Register scratch0() { return r9; } | 182 Register scratch0() { UNIMPLEMENTED(); |
183 DwVfpRegister double_scratch0() { return kScratchDoubleReg; } | 183 return r9; } |
| 184 DwVfpRegister double_scratch0() { UNIMPLEMENTED(); |
| 185 return dr8; } |
184 | 186 |
185 int GetNextEmittedBlock(int block); | 187 int GetNextEmittedBlock(int block); |
186 LInstruction* GetNextInstruction(); | 188 LInstruction* GetNextInstruction(); |
187 | 189 |
188 void EmitClassOfTest(Label* if_true, | 190 void EmitClassOfTest(Label* if_true, |
189 Label* if_false, | 191 Label* if_false, |
190 Handle<String> class_name, | 192 Handle<String> class_name, |
191 Register input, | 193 Register input, |
192 Register temporary, | 194 Register temporary, |
193 Register temporary2); | 195 Register temporary2); |
(...skipping 12 matching lines...) Expand all Loading... |
206 bool GenerateBody(); | 208 bool GenerateBody(); |
207 bool GenerateDeferredCode(); | 209 bool GenerateDeferredCode(); |
208 bool GenerateDeoptJumpTable(); | 210 bool GenerateDeoptJumpTable(); |
209 bool GenerateSafepointTable(); | 211 bool GenerateSafepointTable(); |
210 | 212 |
211 enum SafepointMode { | 213 enum SafepointMode { |
212 RECORD_SIMPLE_SAFEPOINT, | 214 RECORD_SIMPLE_SAFEPOINT, |
213 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS | 215 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS |
214 }; | 216 }; |
215 | 217 |
216 void CallCode( | |
217 Handle<Code> code, | |
218 RelocInfo::Mode mode, | |
219 LInstruction* instr, | |
220 TargetAddressStorageMode storage_mode = CAN_INLINE_TARGET_ADDRESS); | |
221 | |
222 void CallCodeGeneric( | |
223 Handle<Code> code, | |
224 RelocInfo::Mode mode, | |
225 LInstruction* instr, | |
226 SafepointMode safepoint_mode, | |
227 TargetAddressStorageMode storage_mode = CAN_INLINE_TARGET_ADDRESS); | |
228 | |
229 void CallRuntime(const Runtime::Function* function, | 218 void CallRuntime(const Runtime::Function* function, |
230 int num_arguments, | 219 int num_arguments, |
231 LInstruction* instr); | 220 LInstruction* instr); |
232 | 221 |
233 void CallRuntime(Runtime::FunctionId id, | 222 void CallRuntime(Runtime::FunctionId id, |
234 int num_arguments, | 223 int num_arguments, |
235 LInstruction* instr) { | 224 LInstruction* instr) { |
236 const Runtime::Function* function = Runtime::FunctionForId(id); | 225 const Runtime::Function* function = Runtime::FunctionForId(id); |
237 CallRuntime(function, num_arguments, instr); | 226 CallRuntime(function, num_arguments, instr); |
238 } | 227 } |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 // Compiler from a set of parallel moves to a sequential list of moves. | 399 // Compiler from a set of parallel moves to a sequential list of moves. |
411 LGapResolver resolver_; | 400 LGapResolver resolver_; |
412 | 401 |
413 Safepoint::Kind expected_safepoint_kind_; | 402 Safepoint::Kind expected_safepoint_kind_; |
414 | 403 |
415 class PushSafepointRegistersScope BASE_EMBEDDED { | 404 class PushSafepointRegistersScope BASE_EMBEDDED { |
416 public: | 405 public: |
417 PushSafepointRegistersScope(LCodeGen* codegen, | 406 PushSafepointRegistersScope(LCodeGen* codegen, |
418 Safepoint::Kind kind) | 407 Safepoint::Kind kind) |
419 : codegen_(codegen) { | 408 : codegen_(codegen) { |
420 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 409 UNIMPLEMENTED(); |
421 codegen_->expected_safepoint_kind_ = kind; | |
422 | |
423 switch (codegen_->expected_safepoint_kind_) { | |
424 case Safepoint::kWithRegisters: | |
425 codegen_->masm_->PushSafepointRegisters(); | |
426 break; | |
427 case Safepoint::kWithRegistersAndDoubles: | |
428 codegen_->masm_->PushSafepointRegistersAndDoubles(); | |
429 break; | |
430 default: | |
431 UNREACHABLE(); | |
432 } | |
433 } | 410 } |
434 | 411 |
435 ~PushSafepointRegistersScope() { | 412 ~PushSafepointRegistersScope() { |
436 Safepoint::Kind kind = codegen_->expected_safepoint_kind_; | 413 UNIMPLEMENTED(); |
437 ASSERT((kind & Safepoint::kWithRegisters) != 0); | |
438 switch (kind) { | |
439 case Safepoint::kWithRegisters: | |
440 codegen_->masm_->PopSafepointRegisters(); | |
441 break; | |
442 case Safepoint::kWithRegistersAndDoubles: | |
443 codegen_->masm_->PopSafepointRegistersAndDoubles(); | |
444 break; | |
445 default: | |
446 UNREACHABLE(); | |
447 } | |
448 codegen_->expected_safepoint_kind_ = Safepoint::kSimple; | |
449 } | 414 } |
450 | 415 |
451 private: | 416 private: |
452 LCodeGen* codegen_; | 417 LCodeGen* codegen_; |
453 }; | 418 }; |
454 | 419 |
455 friend class LDeferredCode; | 420 friend class LDeferredCode; |
456 friend class LEnvironment; | 421 friend class LEnvironment; |
457 friend class SafepointGenerator; | 422 friend class SafepointGenerator; |
458 DISALLOW_COPY_AND_ASSIGN(LCodeGen); | 423 DISALLOW_COPY_AND_ASSIGN(LCodeGen); |
(...skipping 25 matching lines...) Expand all Loading... |
484 private: | 449 private: |
485 LCodeGen* codegen_; | 450 LCodeGen* codegen_; |
486 Label entry_; | 451 Label entry_; |
487 Label exit_; | 452 Label exit_; |
488 Label* external_exit_; | 453 Label* external_exit_; |
489 int instruction_index_; | 454 int instruction_index_; |
490 }; | 455 }; |
491 | 456 |
492 } } // namespace v8::internal | 457 } } // namespace v8::internal |
493 | 458 |
494 #endif // V8_ARM_LITHIUM_CODEGEN_ARM_H_ | 459 #endif // V8_SH4_LITHIUM_CODEGEN_SH4_H_ |
OLD | NEW |