| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 | 6 |
| 7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
| 8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
| 9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
| 10 #include "src/ia32/assembler-ia32.h" | 10 #include "src/ia32/assembler-ia32.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 break; | 314 break; |
| 315 case kArchLookupSwitch: | 315 case kArchLookupSwitch: |
| 316 AssembleArchLookupSwitch(instr); | 316 AssembleArchLookupSwitch(instr); |
| 317 break; | 317 break; |
| 318 case kArchTableSwitch: | 318 case kArchTableSwitch: |
| 319 AssembleArchTableSwitch(instr); | 319 AssembleArchTableSwitch(instr); |
| 320 break; | 320 break; |
| 321 case kArchNop: | 321 case kArchNop: |
| 322 // don't emit code for nops. | 322 // don't emit code for nops. |
| 323 break; | 323 break; |
| 324 case kArchDeoptimize: { |
| 325 int deopt_state_id = |
| 326 BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); |
| 327 AssembleDeoptimizerCall(deopt_state_id, Deoptimizer::EAGER); |
| 328 break; |
| 329 } |
| 324 case kArchRet: | 330 case kArchRet: |
| 325 AssembleReturn(); | 331 AssembleReturn(); |
| 326 break; | 332 break; |
| 327 case kArchStackPointer: | 333 case kArchStackPointer: |
| 328 __ mov(i.OutputRegister(), esp); | 334 __ mov(i.OutputRegister(), esp); |
| 329 break; | 335 break; |
| 330 case kArchTruncateDoubleToI: { | 336 case kArchTruncateDoubleToI: { |
| 331 auto result = i.OutputRegister(); | 337 auto result = i.OutputRegister(); |
| 332 auto input = i.InputDoubleRegister(0); | 338 auto input = i.InputDoubleRegister(0); |
| 333 auto ool = new (zone()) OutOfLineTruncateDoubleToI(this, result, input); | 339 auto ool = new (zone()) OutOfLineTruncateDoubleToI(this, result, input); |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 for (size_t index = 0; index < case_count; ++index) { | 869 for (size_t index = 0; index < case_count; ++index) { |
| 864 cases[index] = GetLabel(i.InputRpo(index + 2)); | 870 cases[index] = GetLabel(i.InputRpo(index + 2)); |
| 865 } | 871 } |
| 866 Label* const table = AddJumpTable(cases, case_count); | 872 Label* const table = AddJumpTable(cases, case_count); |
| 867 __ cmp(input, Immediate(case_count)); | 873 __ cmp(input, Immediate(case_count)); |
| 868 __ j(above_equal, GetLabel(i.InputRpo(1))); | 874 __ j(above_equal, GetLabel(i.InputRpo(1))); |
| 869 __ jmp(Operand::JumpTable(input, times_4, table)); | 875 __ jmp(Operand::JumpTable(input, times_4, table)); |
| 870 } | 876 } |
| 871 | 877 |
| 872 | 878 |
| 873 void CodeGenerator::AssembleDeoptimizerCall(int deoptimization_id) { | 879 void CodeGenerator::AssembleDeoptimizerCall( |
| 880 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { |
| 874 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | 881 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
| 875 isolate(), deoptimization_id, Deoptimizer::LAZY); | 882 isolate(), deoptimization_id, bailout_type); |
| 876 __ call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 883 __ call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
| 877 } | 884 } |
| 878 | 885 |
| 879 | 886 |
| 880 // The calling convention for JSFunctions on IA32 passes arguments on the | 887 // The calling convention for JSFunctions on IA32 passes arguments on the |
| 881 // stack and the JSFunction and context in EDI and ESI, respectively, thus | 888 // stack and the JSFunction and context in EDI and ESI, respectively, thus |
| 882 // the steps of the call look as follows: | 889 // the steps of the call look as follows: |
| 883 | 890 |
| 884 // --{ before the call instruction }-------------------------------------------- | 891 // --{ before the call instruction }-------------------------------------------- |
| 885 // | caller frame | | 892 // | caller frame | |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 } | 1279 } |
| 1273 } | 1280 } |
| 1274 MarkLazyDeoptSite(); | 1281 MarkLazyDeoptSite(); |
| 1275 } | 1282 } |
| 1276 | 1283 |
| 1277 #undef __ | 1284 #undef __ |
| 1278 | 1285 |
| 1279 } // namespace compiler | 1286 } // namespace compiler |
| 1280 } // namespace internal | 1287 } // namespace internal |
| 1281 } // namespace v8 | 1288 } // namespace v8 |
| OLD | NEW |