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

Unified Diff: src/hydrogen-instructions.h

Issue 8914006: Create missing boilerplate for array literals instead of deoptimizing (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 9 years 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/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index d7c0eb059ed249831f4ec7462fca1348e21b6097..d5d427c0b6914047792259c773f4e870fae6227b 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -4202,7 +4202,7 @@ class HMaterializedLiteral: public HTemplateInstruction<V> {
class HArrayLiteral: public HMaterializedLiteral<1> {
public:
HArrayLiteral(HValue* context,
- Handle<JSObject> boilerplate_object,
+ Handle<HeapObject> boilerplate_object,
int length,
int literal_index,
int depth)
@@ -4214,9 +4214,12 @@ class HArrayLiteral: public HMaterializedLiteral<1> {
HValue* context() { return OperandAt(0); }
ElementsKind boilerplate_elements_kind() const {
- return boilerplate_object_->GetElementsKind();
+ if (!boilerplate_object_->IsJSObject()) {
+ return FAST_ELEMENTS;
+ }
+ return Handle<JSObject>::cast(boilerplate_object_)->GetElementsKind();
}
- Handle<JSObject> boilerplate_object() const { return boilerplate_object_; }
+ Handle<HeapObject> boilerplate_object() const { return boilerplate_object_; }
int length() const { return length_; }
bool IsCopyOnWrite() const;
@@ -4230,7 +4233,7 @@ class HArrayLiteral: public HMaterializedLiteral<1> {
private:
int length_;
- Handle<JSObject> boilerplate_object_;
+ Handle<HeapObject> boilerplate_object_;
};
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698