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

Side by Side Diff: src/list.h

Issue 546087: Implement inline string compare on ARM. (Closed)
Patch Set: Further optimization of ARM version Created 10 years, 11 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
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/x64/codegen-x64.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 INLINE(void* operator new(size_t size)) { 62 INLINE(void* operator new(size_t size)) {
63 return P::New(static_cast<int>(size)); 63 return P::New(static_cast<int>(size));
64 } 64 }
65 INLINE(void operator delete(void* p, size_t)) { return P::Delete(p); } 65 INLINE(void operator delete(void* p, size_t)) { return P::Delete(p); }
66 66
67 // Returns a reference to the element at index i. This reference is 67 // Returns a reference to the element at index i. This reference is
68 // not safe to use after operations that can change the list's 68 // not safe to use after operations that can change the list's
69 // backing store (eg, Add). 69 // backing store (eg, Add).
70 inline T& operator[](int i) const { 70 inline T& operator[](int i) const {
71 ASSERT(0 <= i && i < length_); 71 ASSERT(0 <= i);
72 ASSERT(i < length_);
72 return data_[i]; 73 return data_[i];
73 } 74 }
74 inline T& at(int i) const { return operator[](i); } 75 inline T& at(int i) const { return operator[](i); }
75 inline T& last() const { return at(length_ - 1); } 76 inline T& last() const { return at(length_ - 1); }
76 inline T& first() const { return at(0); } 77 inline T& first() const { return at(0); }
77 78
78 INLINE(bool is_empty() const) { return length_ == 0; } 79 INLINE(bool is_empty() const) { return length_ == 0; }
79 INLINE(int length() const) { return length_; } 80 INLINE(int length() const) { return length_; }
80 INLINE(int capacity() const) { return capacity_; } 81 INLINE(int capacity() const) { return capacity_; }
81 82
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 150
150 // Add() is inlined, ResizeAdd() called by Add() is inlined except for 151 // Add() is inlined, ResizeAdd() called by Add() is inlined except for
151 // Lists of FrameElements, and ResizeAddInternal() is inlined in ResizeAdd(). 152 // Lists of FrameElements, and ResizeAddInternal() is inlined in ResizeAdd().
152 template <> 153 template <>
153 void List<FrameElement, 154 void List<FrameElement,
154 FreeStoreAllocationPolicy>::ResizeAdd(const FrameElement& element); 155 FreeStoreAllocationPolicy>::ResizeAdd(const FrameElement& element);
155 156
156 } } // namespace v8::internal 157 } } // namespace v8::internal
157 158
158 #endif // V8_LIST_H_ 159 #endif // V8_LIST_H_
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698