Commit 5c534812 authored by jarin's avatar jarin Committed by Commit bot

Revert of [turbofan] Initial support for monomorphic/polymorphic property...

Revert of [turbofan] Initial support for monomorphic/polymorphic property loads. (patchset #3 id:100001 of https://codereview.chromium.org/1396333010/ )

Reason for revert:
Waterfall redness.

Original issue's description:
> [turbofan] Initial support for monomorphic/polymorphic property loads.
>
> Native context specialization now lowers monomorphic and
> polymorphic accesses to data and constant data properties on
> object and/or prototype chain. We don't deal with accessors
> yet, and we also completely ignore proxies (which is compatible
> with what Crankshaft does).
>
> The code is more or less the straightforward implementation. We
> will need to refactor that and extract common patterns once the
> remaining bits for full load/store support is in.
>
> CQ_INCLUDE_TRYBOTS=tryserver.v8:v8_linux_nosnap_rel
> R=jarin@chromium.org
> BUG=v8:4470
> LOG=n
>
> Committed: https://crrev.com/3a0bf860b7177f7abef01ff308a53603389d958e
> Cr-Commit-Position: refs/heads/master@{#31340}

TBR=bmeurer@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:4470

Review URL: https://codereview.chromium.org/1408123002

Cr-Commit-Position: refs/heads/master@{#31341}
parent 3a0bf860
...@@ -106,15 +106,6 @@ void CompilationDependencies::Rollback() { ...@@ -106,15 +106,6 @@ void CompilationDependencies::Rollback() {
} }
void CompilationDependencies::AssumeMapStable(Handle<Map> map) {
DCHECK(map->is_stable());
// Do nothing if the map cannot transition.
if (map->CanTransition()) {
Insert(DependentCode::kPrototypeCheckGroup, map);
}
}
void CompilationDependencies::AssumeTransitionStable( void CompilationDependencies::AssumeTransitionStable(
Handle<AllocationSite> site) { Handle<AllocationSite> site) {
// Do nothing if the object doesn't have any useful element transitions left. // Do nothing if the object doesn't have any useful element transitions left.
......
...@@ -31,7 +31,6 @@ class CompilationDependencies { ...@@ -31,7 +31,6 @@ class CompilationDependencies {
void AssumeFieldType(Handle<Map> map) { void AssumeFieldType(Handle<Map> map) {
Insert(DependentCode::kFieldTypeGroup, map); Insert(DependentCode::kFieldTypeGroup, map);
} }
void AssumeMapStable(Handle<Map> map);
void AssumePropertyCell(Handle<PropertyCell> cell) { void AssumePropertyCell(Handle<PropertyCell> cell) {
Insert(DependentCode::kPropertyCellChangedGroup, cell); Insert(DependentCode::kPropertyCellChangedGroup, cell);
} }
......
This diff is collapsed.
...@@ -22,7 +22,6 @@ namespace compiler { ...@@ -22,7 +22,6 @@ namespace compiler {
class CommonOperatorBuilder; class CommonOperatorBuilder;
class JSGraph; class JSGraph;
class JSOperatorBuilder; class JSOperatorBuilder;
class MachineOperatorBuilder;
// Specializes a given JSGraph to a given GlobalObject, potentially constant // Specializes a given JSGraph to a given GlobalObject, potentially constant
...@@ -39,14 +38,13 @@ class JSGlobalSpecialization final : public AdvancedReducer { ...@@ -39,14 +38,13 @@ class JSGlobalSpecialization final : public AdvancedReducer {
JSGlobalSpecialization(Editor* editor, JSGraph* jsgraph, Flags flags, JSGlobalSpecialization(Editor* editor, JSGraph* jsgraph, Flags flags,
Handle<GlobalObject> global_object, Handle<GlobalObject> global_object,
CompilationDependencies* dependencies, Zone* zone); CompilationDependencies* dependencies);
Reduction Reduce(Node* node) final; Reduction Reduce(Node* node) final;
private: private:
Reduction ReduceJSLoadGlobal(Node* node); Reduction ReduceJSLoadGlobal(Node* node);
Reduction ReduceJSStoreGlobal(Node* node); Reduction ReduceJSStoreGlobal(Node* node);
Reduction ReduceJSLoadNamed(Node* node);
Reduction Replace(Node* node, Node* value, Node* effect = nullptr, Reduction Replace(Node* node, Node* value, Node* effect = nullptr,
Node* control = nullptr) { Node* control = nullptr) {
...@@ -55,12 +53,6 @@ class JSGlobalSpecialization final : public AdvancedReducer { ...@@ -55,12 +53,6 @@ class JSGlobalSpecialization final : public AdvancedReducer {
} }
Reduction Replace(Node* node, Handle<Object> value); Reduction Replace(Node* node, Handle<Object> value);
class PropertyAccessInfo;
bool ComputePropertyAccessInfo(Handle<Map> map, Handle<Name> name,
PropertyAccessInfo* access_info);
bool ComputePropertyAccessInfos(MapHandleList const& maps, Handle<Name> name,
ZoneVector<PropertyAccessInfo>* access_infos);
struct ScriptContextTableLookupResult; struct ScriptContextTableLookupResult;
bool LookupInScriptContextTable(Handle<Name> name, bool LookupInScriptContextTable(Handle<Name> name,
ScriptContextTableLookupResult* result); ScriptContextTableLookupResult* result);
...@@ -71,17 +63,14 @@ class JSGlobalSpecialization final : public AdvancedReducer { ...@@ -71,17 +63,14 @@ class JSGlobalSpecialization final : public AdvancedReducer {
CommonOperatorBuilder* common() const; CommonOperatorBuilder* common() const;
JSOperatorBuilder* javascript() const; JSOperatorBuilder* javascript() const;
SimplifiedOperatorBuilder* simplified() const; SimplifiedOperatorBuilder* simplified() const;
MachineOperatorBuilder* machine() const;
Flags flags() const { return flags_; } Flags flags() const { return flags_; }
Handle<GlobalObject> global_object() const { return global_object_; } Handle<GlobalObject> global_object() const { return global_object_; }
CompilationDependencies* dependencies() const { return dependencies_; } CompilationDependencies* dependencies() const { return dependencies_; }
Zone* zone() const { return zone_; }
JSGraph* const jsgraph_; JSGraph* const jsgraph_;
Flags const flags_; Flags const flags_;
Handle<GlobalObject> global_object_; Handle<GlobalObject> global_object_;
CompilationDependencies* const dependencies_; CompilationDependencies* const dependencies_;
Zone* const zone_;
DISALLOW_COPY_AND_ASSIGN(JSGlobalSpecialization); DISALLOW_COPY_AND_ASSIGN(JSGlobalSpecialization);
}; };
......
...@@ -11,11 +11,8 @@ namespace v8 { ...@@ -11,11 +11,8 @@ namespace v8 {
namespace internal { namespace internal {
namespace compiler { namespace compiler {
Node* JSGraph::ImmovableHeapConstant(Handle<HeapObject> value) { Node* JSGraph::ImmovableHeapConstant(Handle<HeapObject> object) {
if (value->IsConsString()) { return graph()->NewNode(common()->HeapConstant(object));
value = String::Flatten(Handle<String>::cast(value), TENURED);
}
return graph()->NewNode(common()->HeapConstant(value));
} }
...@@ -81,7 +78,7 @@ Node* JSGraph::HeapConstant(Handle<HeapObject> value) { ...@@ -81,7 +78,7 @@ Node* JSGraph::HeapConstant(Handle<HeapObject> value) {
// TODO(titzer): We could also match against the addresses of immortable // TODO(titzer): We could also match against the addresses of immortable
// immovables here, even without access to the heap, thus always // immovables here, even without access to the heap, thus always
// canonicalizing references to them. // canonicalizing references to them.
return ImmovableHeapConstant(value); return graph()->NewNode(common()->HeapConstant(value));
} }
......
...@@ -369,8 +369,7 @@ Reduction JSInliner::ReduceJSCallFunction(Node* node, ...@@ -369,8 +369,7 @@ Reduction JSInliner::ReduceJSCallFunction(Node* node,
info.is_deoptimization_enabled() info.is_deoptimization_enabled()
? JSGlobalSpecialization::kDeoptimizationEnabled ? JSGlobalSpecialization::kDeoptimizationEnabled
: JSGlobalSpecialization::kNoFlags, : JSGlobalSpecialization::kNoFlags,
handle(info.global_object(), info.isolate()), info_->dependencies(), handle(info.global_object(), info.isolate()), info_->dependencies());
local_zone_);
graph_reducer.AddReducer(&dead_code_elimination); graph_reducer.AddReducer(&dead_code_elimination);
graph_reducer.AddReducer(&common_reducer); graph_reducer.AddReducer(&common_reducer);
graph_reducer.AddReducer(&global_specialization); graph_reducer.AddReducer(&global_specialization);
......
...@@ -518,7 +518,7 @@ struct NativeContextSpecializationPhase { ...@@ -518,7 +518,7 @@ struct NativeContextSpecializationPhase {
? JSGlobalSpecialization::kDeoptimizationEnabled ? JSGlobalSpecialization::kDeoptimizationEnabled
: JSGlobalSpecialization::kNoFlags, : JSGlobalSpecialization::kNoFlags,
handle(data->info()->global_object(), data->isolate()), handle(data->info()->global_object(), data->isolate()),
data->info()->dependencies(), temp_zone); data->info()->dependencies());
AddReducer(data, &graph_reducer, &dead_code_elimination); AddReducer(data, &graph_reducer, &dead_code_elimination);
AddReducer(data, &graph_reducer, &common_reducer); AddReducer(data, &graph_reducer, &common_reducer);
AddReducer(data, &graph_reducer, &global_specialization); AddReducer(data, &graph_reducer, &global_specialization);
......
...@@ -19,8 +19,6 @@ class Map; ...@@ -19,8 +19,6 @@ class Map;
// index it was originally generated from. // index it was originally generated from.
class FieldIndex final { class FieldIndex final {
public: public:
FieldIndex() : bit_field_(0) {}
static FieldIndex ForPropertyIndex(Map* map, static FieldIndex ForPropertyIndex(Map* map,
int index, int index,
bool is_double = false); bool is_double = false);
......
...@@ -4905,7 +4905,6 @@ bool Map::IsJSGlobalProxyMap() { ...@@ -4905,7 +4905,6 @@ bool Map::IsJSGlobalProxyMap() {
bool Map::IsJSGlobalObjectMap() { bool Map::IsJSGlobalObjectMap() {
return instance_type() == JS_GLOBAL_OBJECT_TYPE; return instance_type() == JS_GLOBAL_OBJECT_TYPE;
} }
bool Map::IsJSTypedArrayMap() { return instance_type() == JS_TYPED_ARRAY_TYPE; }
bool Map::IsGlobalObjectMap() { bool Map::IsGlobalObjectMap() {
const InstanceType type = instance_type(); const InstanceType type = instance_type();
return type == JS_GLOBAL_OBJECT_TYPE || type == JS_BUILTINS_OBJECT_TYPE; return type == JS_GLOBAL_OBJECT_TYPE || type == JS_BUILTINS_OBJECT_TYPE;
......
...@@ -5877,7 +5877,6 @@ class Map: public HeapObject { ...@@ -5877,7 +5877,6 @@ class Map: public HeapObject {
inline bool IsJSProxyMap(); inline bool IsJSProxyMap();
inline bool IsJSGlobalProxyMap(); inline bool IsJSGlobalProxyMap();
inline bool IsJSGlobalObjectMap(); inline bool IsJSGlobalObjectMap();
inline bool IsJSTypedArrayMap();
inline bool IsGlobalObjectMap(); inline bool IsGlobalObjectMap();
inline bool CanOmitMapChecks(); inline bool CanOmitMapChecks();
......
...@@ -90,6 +90,7 @@ function f3(one) { ...@@ -90,6 +90,7 @@ function f3(one) {
for (var j = 0; j < 5; ++j) f3(1); for (var j = 0; j < 5; ++j) f3(1);
%OptimizeFunctionOnNextCall(f3); %OptimizeFunctionOnNextCall(f3);
f3(1); f3(1);
assertTrue(%GetOptimizationStatus(f3) != 2);
......
...@@ -88,6 +88,7 @@ function f3(one) { ...@@ -88,6 +88,7 @@ function f3(one) {
for (var j = 0; j < 5; ++j) f3(1); for (var j = 0; j < 5; ++j) f3(1);
%OptimizeFunctionOnNextCall(f3); %OptimizeFunctionOnNextCall(f3);
f3(1); f3(1);
assertTrue(%GetOptimizationStatus(f3) != 2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment