| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/interpreter-assembler.h" | 5 #include "src/interpreter/interpreter-assembler.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/frames.h" | 10 #include "src/frames.h" |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 CallRuntime(Runtime::kStackGuard, GetContext()); | 495 CallRuntime(Runtime::kStackGuard, GetContext()); |
| 496 Goto(&end); | 496 Goto(&end); |
| 497 Bind(&ok); | 497 Bind(&ok); |
| 498 Goto(&end); | 498 Goto(&end); |
| 499 Bind(&end); | 499 Bind(&end); |
| 500 } | 500 } |
| 501 | 501 |
| 502 void InterpreterAssembler::Abort(BailoutReason bailout_reason) { | 502 void InterpreterAssembler::Abort(BailoutReason bailout_reason) { |
| 503 disable_stack_check_across_call_ = true; | 503 disable_stack_check_across_call_ = true; |
| 504 Node* abort_id = SmiTag(Int32Constant(bailout_reason)); | 504 Node* abort_id = SmiTag(Int32Constant(bailout_reason)); |
| 505 Node* ret_value = CallRuntime(Runtime::kAbort, GetContext(), abort_id); | 505 CallRuntime(Runtime::kAbort, GetContext(), abort_id); |
| 506 disable_stack_check_across_call_ = false; | 506 disable_stack_check_across_call_ = false; |
| 507 // Unreached, but keeps turbofan happy. | |
| 508 Return(ret_value); | |
| 509 } | 507 } |
| 510 | 508 |
| 511 void InterpreterAssembler::AbortIfWordNotEqual(Node* lhs, Node* rhs, | 509 void InterpreterAssembler::AbortIfWordNotEqual(Node* lhs, Node* rhs, |
| 512 BailoutReason bailout_reason) { | 510 BailoutReason bailout_reason) { |
| 513 CodeStubAssembler::Label match(this); | 511 CodeStubAssembler::Label match(this); |
| 514 CodeStubAssembler::Label no_match(this); | 512 CodeStubAssembler::Label no_match(this); |
| 513 CodeStubAssembler::Label end(this); |
| 515 | 514 |
| 516 Node* condition = WordEqual(lhs, rhs); | 515 Node* condition = WordEqual(lhs, rhs); |
| 517 Branch(condition, &match, &no_match); | 516 Branch(condition, &match, &no_match); |
| 518 Bind(&no_match); | 517 Bind(&no_match); |
| 519 Abort(bailout_reason); | 518 Abort(bailout_reason); |
| 519 Goto(&end); |
| 520 Bind(&match); | 520 Bind(&match); |
| 521 Goto(&end); |
| 522 Bind(&end); |
| 521 } | 523 } |
| 522 | 524 |
| 523 void InterpreterAssembler::TraceBytecode(Runtime::FunctionId function_id) { | 525 void InterpreterAssembler::TraceBytecode(Runtime::FunctionId function_id) { |
| 524 CallRuntime(function_id, GetContext(), BytecodeArrayTaggedPointer(), | 526 CallRuntime(function_id, GetContext(), BytecodeArrayTaggedPointer(), |
| 525 SmiTag(BytecodeOffset()), GetAccumulator()); | 527 SmiTag(BytecodeOffset()), GetAccumulator()); |
| 526 } | 528 } |
| 527 | 529 |
| 528 // static | 530 // static |
| 529 bool InterpreterAssembler::TargetSupportsUnalignedAccess() { | 531 bool InterpreterAssembler::TargetSupportsUnalignedAccess() { |
| 530 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 | 532 #if V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 |
| 531 return false; | 533 return false; |
| 532 #elif V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_PPC | 534 #elif V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_PPC |
| 533 return CpuFeatures::IsSupported(UNALIGNED_ACCESSES); | 535 return CpuFeatures::IsSupported(UNALIGNED_ACCESSES); |
| 534 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_X87 || \ | 536 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_X87 || \ |
| 535 V8_TARGET_ARCH_S390 | 537 V8_TARGET_ARCH_S390 |
| 536 return true; | 538 return true; |
| 537 #else | 539 #else |
| 538 #error "Unknown Architecture" | 540 #error "Unknown Architecture" |
| 539 #endif | 541 #endif |
| 540 } | 542 } |
| 541 | 543 |
| 542 } // namespace interpreter | 544 } // namespace interpreter |
| 543 } // namespace internal | 545 } // namespace internal |
| 544 } // namespace v8 | 546 } // namespace v8 |
| OLD | NEW |