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

Unified Diff: runtime/vm/code_patcher_ia32.cc

Issue 17421003: Store arguments descriptor in ICData. Remove loading of arguments descriptor at unoptimized call si… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | « runtime/vm/code_patcher_arm_test.cc ('k') | runtime/vm/code_patcher_ia32_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_patcher_ia32.cc
===================================================================
--- runtime/vm/code_patcher_ia32.cc (revision 24207)
+++ runtime/vm/code_patcher_ia32.cc (working copy)
@@ -15,14 +15,13 @@
namespace dart {
-// The pattern of a Dart instance call is:
-// 1: mov ECX, immediate 1
-// 2: mov EDX, immediate 2
-// 3: call target_address
-// <- return_address
-class DartCallPattern : public ValueObject {
+// The expected pattern of a dart instance call:
+// mov ECX, ic-data
+// call target_address
+// <- return address
+class InstanceCall : public ValueObject {
public:
- explicit DartCallPattern(uword return_address)
+ explicit InstanceCall(uword return_address)
: start_(return_address - (kNumInstructions * kInstructionSize)) {
ASSERT(IsValid(return_address));
ASSERT(kInstructionSize == Assembler::kCallExternalLabelSize);
@@ -33,8 +32,7 @@
reinterpret_cast<uint8_t*>(
return_address - (kNumInstructions * kInstructionSize));
return (code_bytes[0] == 0xB9) &&
- (code_bytes[kInstructionSize] == 0xBA) &&
- (code_bytes[2 * kInstructionSize] == 0xE8);
+ (code_bytes[1 * kInstructionSize] == 0xE8);
}
uword target() const {
@@ -49,15 +47,11 @@
CPU::FlushICache(call_address(), kInstructionSize);
}
- RawObject* immediate_one() const {
+ RawObject* ic_data() const {
return *reinterpret_cast<RawObject**>(start_ + 1);
}
- RawObject* immediate_two() const {
- return *reinterpret_cast<RawObject**>(start_ + kInstructionSize + 1);
- }
-
- static const int kNumInstructions = 3;
+ static const int kNumInstructions = 2;
static const int kInstructionSize = 5; // All instructions have same length.
private:
@@ -66,28 +60,10 @@
}
uword call_address() const {
- return start_ + 2 * kInstructionSize;
+ return start_ + 1 * kInstructionSize;
}
uword start_;
- DISALLOW_IMPLICIT_CONSTRUCTORS(DartCallPattern);
-};
-
-
-// The expected pattern of a dart instance call:
-// mov ECX, ic-data
-// mov EDX, arguments_descriptor_array
-// call target_address
-// <- return address
-class InstanceCall : public DartCallPattern {
- public:
- explicit InstanceCall(uword return_address)
- : DartCallPattern(return_address) {}
-
- RawObject* ic_data() const { return immediate_one(); }
- RawObject* arguments_descriptor() const { return immediate_two(); }
-
- private:
DISALLOW_IMPLICIT_CONSTRUCTORS(InstanceCall);
};
@@ -225,22 +201,18 @@
uword CodePatcher::GetInstanceCallAt(uword return_address,
const Code& code,
- ICData* ic_data,
- Array* arguments_descriptor) {
+ ICData* ic_data) {
ASSERT(code.ContainsInstructionAt(return_address));
InstanceCall call(return_address);
if (ic_data != NULL) {
*ic_data ^= call.ic_data();
}
- if (arguments_descriptor != NULL) {
- *arguments_descriptor ^= call.arguments_descriptor();
- }
return call.target();
}
intptr_t CodePatcher::InstanceCallSizeInBytes() {
- return DartCallPattern::kNumInstructions * DartCallPattern::kInstructionSize;
+ return InstanceCall::kNumInstructions * InstanceCall::kInstructionSize;
}
} // namespace dart
« no previous file with comments | « runtime/vm/code_patcher_arm_test.cc ('k') | runtime/vm/code_patcher_ia32_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698