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

Side by Side Diff: runtime/vm/instructions_x64.cc

Issue 24744002: Pattern match on generated code to find edge counters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated review comments. Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/instructions_mips.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/cpu.h" 8 #include "vm/cpu.h"
9 #include "vm/instructions.h" 9 #include "vm/instructions.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
11 11
12 namespace dart { 12 namespace dart {
13 13
14 intptr_t InstructionPattern::IndexFromPPLoad(uword start) { 14 intptr_t InstructionPattern::IndexFromPPLoad(uword start) {
15 int32_t offset = *reinterpret_cast<int32_t*>(start); 15 int32_t offset = *reinterpret_cast<int32_t*>(start);
16 offset += kHeapObjectTag; 16 offset += kHeapObjectTag;
17 return (offset - Array::data_offset()) / kWordSize; 17 return (offset - Array::data_offset()) / kWordSize;
18 } 18 }
19 19
20 20
21 bool InstructionPattern::TestBytesWith(const int* data, int num_bytes) const { 21 bool InstructionPattern::TestBytesWith(const int* data, int num_bytes) const {
22 ASSERT(data != NULL); 22 ASSERT(data != NULL);
23 const uint8_t* byte_array = reinterpret_cast<const uint8_t*>(start_); 23 const uint8_t* byte_array = reinterpret_cast<const uint8_t*>(start_);
24 for (int i = 0; i < num_bytes; i++) { 24 for (int i = 0; i < num_bytes; i++) {
25 // Skip comparison for data[i] < 0. 25 // Skip comparison for data[i] < 0.
26 if ((data[i] >= 0) && (byte_array[i] != (0xFF & data[i]))) { 26 if ((data[i] >= 0) && (byte_array[i] != (0xFF & data[i]))) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 87
88 const int* ShortCallPattern::pattern() const { 88 const int* ShortCallPattern::pattern() const {
89 static const int kCallPattern[kLengthInBytes] = {0xE8, -1, -1, -1, -1}; 89 static const int kCallPattern[kLengthInBytes] = {0xE8, -1, -1, -1, -1};
90 return kCallPattern; 90 return kCallPattern;
91 } 91 }
92 92
93 } // namespace dart 93 } // namespace dart
94 94
95 #endif // defined TARGET_ARCH_X64 95 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/instructions_mips.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698