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

Unified Diff: src/hydrogen-instructions.h

Issue 19207002: Reland deprecation of HAllocateObject in favor of HAllocate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | « src/hydrogen-escape-analysis.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 cb2225dcf69b973a1ba07c3c71c879212bd23b20..27c517aa1a5be38b03e3ec186532dea8da7aeebb 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -66,7 +66,6 @@ class LChunkBuilder;
V(AccessArgumentsAt) \
V(Add) \
V(Allocate) \
- V(AllocateObject) \
V(ApplyArguments) \
V(ArgumentsElements) \
V(ArgumentsLength) \
@@ -4952,50 +4951,6 @@ class HLoadGlobalGeneric: public HTemplateInstruction<2> {
};
-class HAllocateObject: public HTemplateInstruction<1> {
- public:
- HAllocateObject(HValue* context, Handle<JSFunction> constructor)
- : constructor_(constructor) {
- SetOperandAt(0, context);
- set_representation(Representation::Tagged());
- SetGVNFlag(kChangesNewSpacePromotion);
- constructor_initial_map_ = constructor->has_initial_map()
- ? Handle<Map>(constructor->initial_map())
- : Handle<Map>::null();
- // If slack tracking finished, the instance size and property counts
- // remain unchanged so that we can allocate memory for the object.
- ASSERT(!constructor->shared()->IsInobjectSlackTrackingInProgress());
- }
-
- // Maximum instance size for which allocations will be inlined.
- static const int kMaxSize = 64 * kPointerSize;
-
- HValue* context() { return OperandAt(0); }
- Handle<JSFunction> constructor() { return constructor_; }
- Handle<Map> constructor_initial_map() { return constructor_initial_map_; }
-
- virtual Representation RequiredInputRepresentation(int index) {
- return Representation::Tagged();
- }
-
- virtual Handle<Map> GetMonomorphicJSObjectMap() {
- ASSERT(!constructor_initial_map_.is_null());
- return constructor_initial_map_;
- }
-
- virtual HType CalculateInferredType();
-
- DECLARE_CONCRETE_INSTRUCTION(AllocateObject)
-
- private:
- // TODO(svenpanne) Might be safe, but leave it out until we know for sure.
- // virtual bool IsDeletable() const { return true; }
-
- Handle<JSFunction> constructor_;
- Handle<Map> constructor_initial_map_;
-};
-
-
class HAllocate: public HTemplateInstruction<2> {
public:
enum Flags {
@@ -5016,6 +4971,9 @@ class HAllocate: public HTemplateInstruction<2> {
SetGVNFlag(kDependsOnNewSpacePromotion);
}
+ // Maximum instance size for which allocations will be inlined.
+ static const int kMaxInlineSize = 64 * kPointerSize;
+
static Flags DefaultFlags() {
return CAN_ALLOCATE_IN_NEW_SPACE;
}
@@ -5041,6 +4999,14 @@ class HAllocate: public HTemplateInstruction<2> {
}
}
+ virtual Handle<Map> GetMonomorphicJSObjectMap() {
+ return known_initial_map_;
+ }
+
+ void set_known_initial_map(Handle<Map> known_initial_map) {
+ known_initial_map_ = known_initial_map;
+ }
+
virtual HType CalculateInferredType();
bool CanAllocateInNewSpace() const {
@@ -5082,6 +5048,7 @@ class HAllocate: public HTemplateInstruction<2> {
private:
HType type_;
Flags flags_;
+ Handle<Map> known_initial_map_;
};
@@ -5132,7 +5099,6 @@ inline bool ReceiverObjectNeedsWriteBarrier(HValue* object,
return false;
}
if (object != new_space_dominator) return true;
- if (object->IsAllocateObject()) return false;
if (object->IsAllocate()) {
return !HAllocate::cast(object)->GuaranteedInNewSpace();
}
« no previous file with comments | « src/hydrogen-escape-analysis.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698