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

Unified Diff: src/code-stubs.h

Issue 197603002: Turn StringLengthStub (used by string wrappers only) into a hydrogen stub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | « src/arm/stub-cache-arm.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index c86b3a4d06b8d6e4f9b0bcbeb51d604956533aa8..b65f085d3d70711ae4aad75ce9f1ec2bfd2198da 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -51,7 +51,6 @@ namespace internal {
V(CompareIC) \
V(CompareNilIC) \
V(MathPow) \
- V(StringLength) \
V(FunctionPrototype) \
V(StoreArrayLength) \
V(RecordWrite) \
@@ -98,7 +97,9 @@ namespace internal {
V(CallApiGetter) \
/* IC Handler stubs */ \
V(LoadField) \
- V(KeyedLoadField)
+ V(KeyedLoadField) \
+ V(StringLength) \
+ V(KeyedStringLength)
// List of code stubs only used on ARM platforms.
#if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_A64)
@@ -833,17 +834,6 @@ class FunctionPrototypeStub: public ICStub {
};
-class StringLengthStub: public ICStub {
- public:
- explicit StringLengthStub(Code::Kind kind) : ICStub(kind) { }
- virtual void Generate(MacroAssembler* masm);
-
- private:
- STATIC_ASSERT(KindBits::kSize == 4);
- virtual CodeStub::Major MajorKey() { return StringLength; }
-};
-
-
class StoreICStub: public ICStub {
public:
StoreICStub(Code::Kind kind, StrictMode strict_mode)
@@ -959,6 +949,44 @@ class LoadFieldStub: public HandlerStub {
};
+class StringLengthStub: public HandlerStub {
+ public:
+ explicit StringLengthStub() : HandlerStub() {
+ Initialize(Code::LOAD_IC);
+ }
+ virtual Handle<Code> GenerateCode(Isolate* isolate);
+ virtual void InitializeInterfaceDescriptor(
+ Isolate* isolate,
+ CodeStubInterfaceDescriptor* descriptor);
+
+ protected:
+ virtual Code::Kind kind() const {
+ return KindBits::decode(bit_field_);
+ }
+
+ void Initialize(Code::Kind kind) {
+ bit_field_ = KindBits::encode(kind);
+ }
+
+ private:
+ virtual CodeStub::Major MajorKey() { return StringLength; }
+};
+
+
+class KeyedStringLengthStub: public StringLengthStub {
+ public:
+ explicit KeyedStringLengthStub() : StringLengthStub() {
+ Initialize(Code::KEYED_LOAD_IC);
+ }
+ virtual void InitializeInterfaceDescriptor(
+ Isolate* isolate,
+ CodeStubInterfaceDescriptor* descriptor);
+
+ private:
+ virtual CodeStub::Major MajorKey() { return KeyedStringLength; }
+};
+
+
class StoreGlobalStub : public HandlerStub {
public:
explicit StoreGlobalStub(bool is_constant, bool check_global) {
@@ -1072,8 +1100,6 @@ class KeyedLoadFieldStub: public LoadFieldStub {
Isolate* isolate,
CodeStubInterfaceDescriptor* descriptor);
- virtual Handle<Code> GenerateCode(Isolate* isolate);
-
private:
virtual CodeStub::Major MajorKey() { return KeyedLoadField; }
};
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698