Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1117)

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 6624091: Fix Issue 1234. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/lithium-codegen-x64.h ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index ffb4632f952c0089be7feb47e218a0a6cd1a72d4..8225c7909d23707b641f03b347f229672a487099 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -39,7 +39,7 @@ namespace internal {
// When invoking builtins, we need to record the safepoint in the middle of
// the invoke instruction sequence generated by the macro assembler.
-class SafepointGenerator : public PostCallGenerator {
+class SafepointGenerator : public CallWrapper {
public:
SafepointGenerator(LCodeGen* codegen,
LPointerMap* pointers,
@@ -48,29 +48,29 @@ class SafepointGenerator : public PostCallGenerator {
: codegen_(codegen),
pointers_(pointers),
deoptimization_index_(deoptimization_index),
- ensure_reloc_space_(ensure_reloc_space),
- previous_safepoint_position_(-kMinSafepointSize) { }
+ ensure_reloc_space_(ensure_reloc_space) { }
virtual ~SafepointGenerator() { }
- virtual void Generate() {
+ virtual void BeforeCall(int call_size) {
+ ASSERT(call_size >= 0);
// Ensure that we have enough space after the previous safepoint position
- // for the generated code there.
- int position = codegen_->masm()->pc_offset();
- ASSERT(position > previous_safepoint_position_);
- if (position < previous_safepoint_position_ + kMinSafepointSize) {
- int padding_size =
- previous_safepoint_position_ + kMinSafepointSize - position;
+ // for the jump generated there.
+ int call_end = codegen_->masm()->pc_offset() + call_size;
+ int prev_jump_end = codegen_->LastSafepointEnd() + kMinSafepointSize;
+ if (call_end < prev_jump_end) {
+ int padding_size = prev_jump_end - call_end;
STATIC_ASSERT(kMinSafepointSize <= 9); // One multibyte nop is enough.
codegen_->masm()->nop(padding_size);
- position += padding_size;
}
+ }
+
+ virtual void AfterCall() {
// Ensure that we have enough space in the reloc info to patch
// this with calls when doing deoptimization.
if (ensure_reloc_space_) {
codegen_->masm()->RecordComment(RelocInfo::kFillerCommentString, true);
}
codegen_->RecordSafepoint(pointers_, deoptimization_index_);
- previous_safepoint_position_ = position;
}
private:
@@ -80,7 +80,6 @@ class SafepointGenerator : public PostCallGenerator {
LPointerMap* pointers_;
int deoptimization_index_;
bool ensure_reloc_space_;
- int previous_safepoint_position_;
};
« no previous file with comments | « src/x64/lithium-codegen-x64.h ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698