Reviewers: ulan,

Description:
A64: Remove A64 special casing in ExternalCallbackScope

Please review this at https://codereview.chromium.org/159993002/

SVN Base: https://v8.googlecode.com/svn/branches/experimental/a64

Affected files (+11, -6 lines):
  M src/a64/simulator-a64.h
  M src/arm/simulator-arm.h
  M src/mips/simulator-mips.h
  M src/vm-state-inl.h


Index: src/a64/simulator-a64.h
diff --git a/src/a64/simulator-a64.h b/src/a64/simulator-a64.h
index 4cb3761fe9213e21eb366f14cf07dfe5cd44d322..6279677ca8565e46f32d4ce8caafed06a3d6b1b7 100644
--- a/src/a64/simulator-a64.h
+++ b/src/a64/simulator-a64.h
@@ -445,6 +445,8 @@ class Simulator : public DecoderVisitor {
   }
   Instruction* lr() { return reg<Instruction*>(kLinkRegCode); }

+  Address get_sp() { return reinterpret_cast<Address>(sp()); }
+
   // Return 'size' bits of the value of a floating-point register, as the
   // specified type. The value is zero-extended to fill the result.
   //
Index: src/arm/simulator-arm.h
diff --git a/src/arm/simulator-arm.h b/src/arm/simulator-arm.h
index 0af5162e9380e1beafe512948129c62cb1d91443..24d7fe58c44590f3732ddeb376795089f2721bb0 100644
--- a/src/arm/simulator-arm.h
+++ b/src/arm/simulator-arm.h
@@ -207,6 +207,10 @@ class Simulator {
   void set_pc(int32_t value);
   int32_t get_pc() const;

+  Address get_sp() {
+ return reinterpret_cast<Address>(static_cast<intptr_t>(get_register(sp)));
+  }
+
   // Accessor to the internal simulator stack area.
   uintptr_t StackLimit() const;

Index: src/mips/simulator-mips.h
diff --git a/src/mips/simulator-mips.h b/src/mips/simulator-mips.h
index d9fd10f245c3617e332bfdefeb8b9b3b2a099826..92a0a87d2406e2a2fc83274ae27363b62b3b72a0 100644
--- a/src/mips/simulator-mips.h
+++ b/src/mips/simulator-mips.h
@@ -203,6 +203,10 @@ class Simulator {
   void set_pc(int32_t value);
   int32_t get_pc() const;

+  Address get_sp() {
+ return reinterpret_cast<Address>(static_cast<intptr_t>(get_register(sp)));
+  }
+
   // Accessor to the internal simulator stack area.
   uintptr_t StackLimit() const;

Index: src/vm-state-inl.h
diff --git a/src/vm-state-inl.h b/src/vm-state-inl.h
index 41690345cb987bceab7fad805732b480a61ec80e..5bee438b657577d2422ba1461eb91bf7647bd074 100644
--- a/src/vm-state-inl.h
+++ b/src/vm-state-inl.h
@@ -85,12 +85,7 @@ ExternalCallbackScope::ExternalCallbackScope(Isolate* isolate, Address callback)
       callback_(callback),
       previous_scope_(isolate->external_callback_scope()) {
 #ifdef USE_SIMULATOR
-#if V8_TARGET_ARCH_A64
- scope_address_ = reinterpret_cast<Address>(Simulator::current(isolate)->sp());
-#else
-  int32_t sp = Simulator::current(isolate)->get_register(Simulator::sp);
-  scope_address_ = reinterpret_cast<Address>(static_cast<intptr_t>(sp));
-#endif
+  scope_address_ = Simulator::current(isolate)->get_sp();
 #endif
   isolate_->set_external_callback_scope(this);
 }


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to