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

Unified Diff: src/code-stubs.h

Issue 368263003: Use a stub in crankshaft for grow store arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed remaining issues. Created 6 years, 5 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 | « no previous file | src/code-stubs.cc » ('j') | src/runtime.cc » ('J')
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 ac59871ffcc649434975f334eb04d5dfc64d74a9..96792b887f0c7ebf60750aa5475c4e9e320c6cc8 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -44,6 +44,7 @@ namespace internal {
V(FastCloneShallowArray) \
V(FastCloneShallowObject) \
V(CreateAllocationSite) \
+ V(GrowArrayElements) \
V(ToBoolean) \
V(ToNumber) \
V(ArgumentsAccess) \
@@ -727,6 +728,57 @@ class CreateAllocationSiteStub : public HydrogenCodeStub {
};
+class GrowArrayElementsStub : public HydrogenCodeStub {
+ public:
+ explicit GrowArrayElementsStub(Isolate* isolate, bool is_js_array,
+ ElementsKind kind)
+ : HydrogenCodeStub(isolate) {
+ bit_field_ = ElementsKindBits::encode(kind) |
+ IsJsArrayBits::encode(is_js_array);
+ }
+
+ virtual Handle<Code> GenerateCode() V8_OVERRIDE;
+
+ static void GenerateAheadOfTime(Isolate* isolate);
+
+ enum RegisterInfo {
+ kObjectIndex,
+ kKeyIndex,
+ kCapacityIndex,
+ kRegisterArgumentCount
+ };
+ static const Register ObjectRegister();
+ static const Register KeyRegister();
+ static const Register CapacityRegister();
+
+ virtual void InitializeInterfaceDescriptor(
+ CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
+
+ static void InstallDescriptors(Isolate* isolate) {
+ GrowArrayElementsStub stub(isolate, true, GetInitialFastElementsKind());
+ stub.InitializeInterfaceDescriptor(
+ isolate->code_stub_interface_descriptor(CodeStub::GrowArrayElements));
+ }
+
+ ElementsKind elements_kind() const {
+ return ElementsKindBits::decode(bit_field_);
+ }
+
+ bool is_js_array() const { return IsJsArrayBits::decode(bit_field_); }
+
+ private:
+ class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
+ class IsJsArrayBits: public BitField<bool, ElementsKindBits::kNext, 1> {};
+
+ uint32_t bit_field_;
+
+ Major MajorKey() const { return GrowArrayElements; }
+ int NotMissMinorKey() const { return bit_field_; }
+
+ DISALLOW_COPY_AND_ASSIGN(GrowArrayElementsStub);
+};
+
+
class InstanceofStub: public PlatformCodeStub {
public:
enum Flags {
« no previous file with comments | « no previous file | src/code-stubs.cc » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698