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

Unified Diff: runtime/vm/code_patcher_x64.cc

Issue 2481873005: clang-format runtime/vm (Closed)
Patch Set: Merge Created 4 years, 1 month 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_mips_test.cc ('k') | runtime/vm/code_patcher_x64_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_patcher_x64.cc
diff --git a/runtime/vm/code_patcher_x64.cc b/runtime/vm/code_patcher_x64.cc
index 0426ae785ffc090047f9e1c75dd62cb95e7cf7d9..4b79751b10b17ff1a9a3143ad5c349d8dd672b9a 100644
--- a/runtime/vm/code_patcher_x64.cc
+++ b/runtime/vm/code_patcher_x64.cc
@@ -54,21 +54,17 @@ class UnoptimizedCall : public ValueObject {
bool IsValid() const {
static int16_t pattern[kCallPatternSize] = {
- 0x49, 0x8b, 0x9f, -1, -1, -1, -1, // movq RBX, [PP + offs]
- 0x4d, 0x8b, 0xa7, -1, -1, -1, -1, // movq CR, [PP + offs]
- 0x4d, 0x8b, 0x5c, 0x24, 0x07, // movq TMP, [CR + entry_point_offs]
- 0x41, 0xff, 0xd3 // callq TMP
+ 0x49, 0x8b, 0x9f, -1, -1, -1, -1, // movq RBX, [PP + offs]
+ 0x4d, 0x8b, 0xa7, -1, -1, -1, -1, // movq CR, [PP + offs]
+ 0x4d, 0x8b, 0x5c, 0x24, 0x07, // movq TMP, [CR + entry_point_offs]
+ 0x41, 0xff, 0xd3 // callq TMP
};
return MatchesPattern(start_, pattern, kCallPatternSize);
}
- intptr_t argument_index() const {
- return IndexFromPPLoad(start_ + 3);
- }
+ intptr_t argument_index() const { return IndexFromPPLoad(start_ + 3); }
- RawObject* ic_data() const {
- return object_pool_.ObjectAt(argument_index());
- }
+ RawObject* ic_data() const { return object_pool_.ObjectAt(argument_index()); }
RawCode* target() const {
intptr_t index = IndexFromPPLoad(start_ + 10);
@@ -95,8 +91,7 @@ class UnoptimizedCall : public ValueObject {
class NativeCall : public UnoptimizedCall {
public:
NativeCall(uword return_address, const Code& code)
- : UnoptimizedCall(return_address, code) {
- }
+ : UnoptimizedCall(return_address, code) {}
NativeFunction native_function() const {
return reinterpret_cast<NativeFunction>(
@@ -104,8 +99,7 @@ class NativeCall : public UnoptimizedCall {
}
void set_native_function(NativeFunction func) const {
- object_pool_.SetRawValueAt(argument_index(),
- reinterpret_cast<uword>(func));
+ object_pool_.SetRawValueAt(argument_index(), reinterpret_cast<uword>(func));
}
private:
@@ -159,16 +153,14 @@ class PoolPointerCall : public ValueObject {
bool IsValid() const {
static int16_t pattern[kCallPatternSize] = {
- 0x4d, 0x8b, 0xa7, -1, -1, -1, -1, // movq CR, [PP + offs]
- 0x4d, 0x8b, 0x5c, 0x24, 0x07, // movq TMP, [CR + entry_point_off]
- 0x41, 0xff, 0xd3 // callq TMP
+ 0x4d, 0x8b, 0xa7, -1, -1, -1, -1, // movq CR, [PP + offs]
+ 0x4d, 0x8b, 0x5c, 0x24, 0x07, // movq TMP, [CR + entry_point_off]
+ 0x41, 0xff, 0xd3 // callq TMP
};
return MatchesPattern(start_, pattern, kCallPatternSize);
}
- intptr_t pp_index() const {
- return IndexFromPPLoad(start_ + 3);
- }
+ intptr_t pp_index() const { return IndexFromPPLoad(start_ + 3); }
RawCode* Target() const {
Code& code = Code::Handle();
@@ -207,25 +199,19 @@ class SwitchableCall : public ValueObject {
bool IsValid() const {
static int16_t pattern[kCallPatternSize] = {
- 0x4d, 0x8b, 0xa7, -1, -1, -1, -1, // movq r12, [PP + code_offs]
- 0x49, 0x8b, 0x4c, 0x24, 0x0f, // movq rcx, [r12 + entrypoint_off]
- 0x49, 0x8b, 0x9f, -1, -1, -1, -1, // movq rbx, [PP + cache_offs]
- 0xff, 0xd1, // call rcx
+ 0x4d, 0x8b, 0xa7, -1, -1, -1, -1, // movq r12, [PP + code_offs]
+ 0x49, 0x8b, 0x4c, 0x24, 0x0f, // movq rcx, [r12 + entrypoint_off]
+ 0x49, 0x8b, 0x9f, -1, -1, -1, -1, // movq rbx, [PP + cache_offs]
+ 0xff, 0xd1, // call rcx
};
ASSERT(ARRAY_SIZE(pattern) == kCallPatternSize);
return MatchesPattern(start_, pattern, kCallPatternSize);
}
- intptr_t data_index() const {
- return IndexFromPPLoad(start_ + 15);
- }
- intptr_t target_index() const {
- return IndexFromPPLoad(start_ + 3);
- }
+ intptr_t data_index() const { return IndexFromPPLoad(start_ + 15); }
+ intptr_t target_index() const { return IndexFromPPLoad(start_ + 3); }
- RawObject* data() const {
- return object_pool_.ObjectAt(data_index());
- }
+ RawObject* data() const { return object_pool_.ObjectAt(data_index()); }
RawCode* target() const {
return reinterpret_cast<RawCode*>(object_pool_.ObjectAt(target_index()));
}
@@ -251,7 +237,6 @@ class SwitchableCall : public ValueObject {
};
-
RawCode* CodePatcher::GetStaticCallTargetAt(uword return_address,
const Code& code) {
ASSERT(code.ContainsInstructionAt(return_address));
@@ -298,8 +283,9 @@ void CodePatcher::InsertDeoptimizationCallAt(uword start) {
}
-RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(
- uword return_address, const Code& code, ICData* ic_data_result) {
+RawFunction* CodePatcher::GetUnoptimizedStaticCallAt(uword return_address,
+ const Code& code,
+ ICData* ic_data_result) {
ASSERT(code.ContainsInstructionAt(return_address));
UnoptimizedStaticCall static_call(return_address, code);
ICData& ic_data = ICData::Handle();
« no previous file with comments | « runtime/vm/code_patcher_mips_test.cc ('k') | runtime/vm/code_patcher_x64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698