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

Side by Side Diff: src/hydrogen-instructions.h

Issue 10534006: Remove TLS access for current Zone. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review. Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 virtual Representation RequiredInputRepresentation(int index) { 985 virtual Representation RequiredInputRepresentation(int index) {
986 return Representation::None(); 986 return Representation::None();
987 } 987 }
988 988
989 DECLARE_CONCRETE_INSTRUCTION(SoftDeoptimize) 989 DECLARE_CONCRETE_INSTRUCTION(SoftDeoptimize)
990 }; 990 };
991 991
992 992
993 class HDeoptimize: public HControlInstruction { 993 class HDeoptimize: public HControlInstruction {
994 public: 994 public:
995 explicit HDeoptimize(int environment_length) : values_(environment_length) { } 995 HDeoptimize(int environment_length, Zone* zone)
996 : values_(environment_length, zone) { }
996 997
997 virtual Representation RequiredInputRepresentation(int index) { 998 virtual Representation RequiredInputRepresentation(int index) {
998 return Representation::None(); 999 return Representation::None();
999 } 1000 }
1000 1001
1001 virtual int OperandCount() { return values_.length(); } 1002 virtual int OperandCount() { return values_.length(); }
1002 virtual HValue* OperandAt(int index) { return values_[index]; } 1003 virtual HValue* OperandAt(int index) { return values_[index]; }
1003 virtual void PrintDataTo(StringStream* stream); 1004 virtual void PrintDataTo(StringStream* stream);
1004 1005
1005 virtual int SuccessorCount() { return 0; } 1006 virtual int SuccessorCount() { return 0; }
1006 virtual HBasicBlock* SuccessorAt(int i) { 1007 virtual HBasicBlock* SuccessorAt(int i) {
1007 UNREACHABLE(); 1008 UNREACHABLE();
1008 return NULL; 1009 return NULL;
1009 } 1010 }
1010 virtual void SetSuccessorAt(int i, HBasicBlock* block) { 1011 virtual void SetSuccessorAt(int i, HBasicBlock* block) {
1011 UNREACHABLE(); 1012 UNREACHABLE();
1012 } 1013 }
1013 1014
1014 void AddEnvironmentValue(HValue* value) { 1015 void AddEnvironmentValue(HValue* value, Zone* zone) {
1015 values_.Add(NULL); 1016 values_.Add(NULL, zone);
1016 SetOperandAt(values_.length() - 1, value); 1017 SetOperandAt(values_.length() - 1, value);
1017 } 1018 }
1018 1019
1019 DECLARE_CONCRETE_INSTRUCTION(Deoptimize) 1020 DECLARE_CONCRETE_INSTRUCTION(Deoptimize)
1020 1021
1021 enum UseEnvironment { 1022 enum UseEnvironment {
1022 kNoUses, 1023 kNoUses,
1023 kUseAll 1024 kUseAll
1024 }; 1025 };
1025 1026
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 1274
1274 DECLARE_CONCRETE_INSTRUCTION(ClampToUint8) 1275 DECLARE_CONCRETE_INSTRUCTION(ClampToUint8)
1275 1276
1276 protected: 1277 protected:
1277 virtual bool DataEquals(HValue* other) { return true; } 1278 virtual bool DataEquals(HValue* other) { return true; }
1278 }; 1279 };
1279 1280
1280 1281
1281 class HSimulate: public HInstruction { 1282 class HSimulate: public HInstruction {
1282 public: 1283 public:
1283 HSimulate(int ast_id, int pop_count) 1284 HSimulate(int ast_id, int pop_count, Zone* zone)
1284 : ast_id_(ast_id), 1285 : ast_id_(ast_id),
1285 pop_count_(pop_count), 1286 pop_count_(pop_count),
1286 values_(2), 1287 values_(2, zone),
1287 assigned_indexes_(2) {} 1288 assigned_indexes_(2, zone),
1289 zone_(zone) {}
1288 virtual ~HSimulate() {} 1290 virtual ~HSimulate() {}
1289 1291
1290 virtual void PrintDataTo(StringStream* stream); 1292 virtual void PrintDataTo(StringStream* stream);
1291 1293
1292 bool HasAstId() const { return ast_id_ != AstNode::kNoNumber; } 1294 bool HasAstId() const { return ast_id_ != AstNode::kNoNumber; }
1293 int ast_id() const { return ast_id_; } 1295 int ast_id() const { return ast_id_; }
1294 void set_ast_id(int id) { 1296 void set_ast_id(int id) {
1295 ASSERT(!HasAstId()); 1297 ASSERT(!HasAstId());
1296 ast_id_ = id; 1298 ast_id_ = id;
1297 } 1299 }
(...skipping 27 matching lines...) Expand all
1325 #endif 1327 #endif
1326 1328
1327 protected: 1329 protected:
1328 virtual void InternalSetOperandAt(int index, HValue* value) { 1330 virtual void InternalSetOperandAt(int index, HValue* value) {
1329 values_[index] = value; 1331 values_[index] = value;
1330 } 1332 }
1331 1333
1332 private: 1334 private:
1333 static const int kNoIndex = -1; 1335 static const int kNoIndex = -1;
1334 void AddValue(int index, HValue* value) { 1336 void AddValue(int index, HValue* value) {
1335 assigned_indexes_.Add(index); 1337 assigned_indexes_.Add(index, zone_);
1336 // Resize the list of pushed values. 1338 // Resize the list of pushed values.
1337 values_.Add(NULL); 1339 values_.Add(NULL, zone_);
1338 // Set the operand through the base method in HValue to make sure that the 1340 // Set the operand through the base method in HValue to make sure that the
1339 // use lists are correctly updated. 1341 // use lists are correctly updated.
1340 SetOperandAt(values_.length() - 1, value); 1342 SetOperandAt(values_.length() - 1, value);
1341 } 1343 }
1342 int ast_id_; 1344 int ast_id_;
1343 int pop_count_; 1345 int pop_count_;
1344 ZoneList<HValue*> values_; 1346 ZoneList<HValue*> values_;
1345 ZoneList<int> assigned_indexes_; 1347 ZoneList<int> assigned_indexes_;
1348 Zone* zone_;
1346 }; 1349 };
1347 1350
1348 1351
1349 class HStackCheck: public HTemplateInstruction<1> { 1352 class HStackCheck: public HTemplateInstruction<1> {
1350 public: 1353 public:
1351 enum Type { 1354 enum Type {
1352 kFunctionEntry, 1355 kFunctionEntry,
1353 kBackwardsBranch 1356 kBackwardsBranch
1354 }; 1357 };
1355 1358
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
2053 2056
2054 DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer) 2057 DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer)
2055 2058
2056 protected: 2059 protected:
2057 virtual bool DataEquals(HValue* other) { return true; } 2060 virtual bool DataEquals(HValue* other) { return true; }
2058 }; 2061 };
2059 2062
2060 2063
2061 class HCheckMaps: public HTemplateInstruction<2> { 2064 class HCheckMaps: public HTemplateInstruction<2> {
2062 public: 2065 public:
2063 HCheckMaps(HValue* value, Handle<Map> map, HValue* typecheck = NULL) { 2066 HCheckMaps(HValue* value, Handle<Map> map, Zone* zone,
2067 HValue* typecheck = NULL) {
2064 SetOperandAt(0, value); 2068 SetOperandAt(0, value);
2065 // If callers don't depend on a typecheck, they can pass in NULL. In that 2069 // If callers don't depend on a typecheck, they can pass in NULL. In that
2066 // case we use a copy of the |value| argument as a dummy value. 2070 // case we use a copy of the |value| argument as a dummy value.
2067 SetOperandAt(1, typecheck != NULL ? typecheck : value); 2071 SetOperandAt(1, typecheck != NULL ? typecheck : value);
2068 set_representation(Representation::Tagged()); 2072 set_representation(Representation::Tagged());
2069 SetFlag(kUseGVN); 2073 SetFlag(kUseGVN);
2070 SetGVNFlag(kDependsOnMaps); 2074 SetGVNFlag(kDependsOnMaps);
2071 SetGVNFlag(kDependsOnElementsKind); 2075 SetGVNFlag(kDependsOnElementsKind);
2072 map_set()->Add(map); 2076 map_set()->Add(map, zone);
2073 } 2077 }
2074 HCheckMaps(HValue* value, SmallMapList* maps) { 2078 HCheckMaps(HValue* value, SmallMapList* maps, Zone* zone) {
2075 SetOperandAt(0, value); 2079 SetOperandAt(0, value);
2076 SetOperandAt(1, value); 2080 SetOperandAt(1, value);
2077 set_representation(Representation::Tagged()); 2081 set_representation(Representation::Tagged());
2078 SetFlag(kUseGVN); 2082 SetFlag(kUseGVN);
2079 SetGVNFlag(kDependsOnMaps); 2083 SetGVNFlag(kDependsOnMaps);
2080 SetGVNFlag(kDependsOnElementsKind); 2084 SetGVNFlag(kDependsOnElementsKind);
2081 for (int i = 0; i < maps->length(); i++) { 2085 for (int i = 0; i < maps->length(); i++) {
2082 map_set()->Add(maps->at(i)); 2086 map_set()->Add(maps->at(i), zone);
2083 } 2087 }
2084 map_set()->Sort(); 2088 map_set()->Sort();
2085 } 2089 }
2086 2090
2087 static HCheckMaps* NewWithTransitions(HValue* object, Handle<Map> map) { 2091 static HCheckMaps* NewWithTransitions(HValue* object, Handle<Map> map,
2088 HCheckMaps* check_map = new HCheckMaps(object, map); 2092 Zone* zone) {
2093 HCheckMaps* check_map = new(zone) HCheckMaps(object, map, zone);
2089 SmallMapList* map_set = check_map->map_set(); 2094 SmallMapList* map_set = check_map->map_set();
2090 2095
2091 // Since transitioned elements maps of the initial map don't fail the map 2096 // Since transitioned elements maps of the initial map don't fail the map
2092 // check, the CheckMaps instruction doesn't need to depend on ElementsKinds. 2097 // check, the CheckMaps instruction doesn't need to depend on ElementsKinds.
2093 check_map->ClearGVNFlag(kDependsOnElementsKind); 2098 check_map->ClearGVNFlag(kDependsOnElementsKind);
2094 2099
2095 ElementsKind kind = map->elements_kind(); 2100 ElementsKind kind = map->elements_kind();
2096 bool packed = IsFastPackedElementsKind(kind); 2101 bool packed = IsFastPackedElementsKind(kind);
2097 while (CanTransitionToMoreGeneralFastElementsKind(kind, packed)) { 2102 while (CanTransitionToMoreGeneralFastElementsKind(kind, packed)) {
2098 kind = GetNextMoreGeneralFastElementsKind(kind, packed); 2103 kind = GetNextMoreGeneralFastElementsKind(kind, packed);
2099 Map* transitioned_map = 2104 Map* transitioned_map =
2100 map->LookupElementsTransitionMap(kind, NULL); 2105 map->LookupElementsTransitionMap(kind, NULL);
2101 if (transitioned_map) { 2106 if (transitioned_map) {
2102 map_set->Add(Handle<Map>(transitioned_map)); 2107 map_set->Add(Handle<Map>(transitioned_map), zone);
2103 } 2108 }
2104 }; 2109 };
2105 map_set->Sort(); 2110 map_set->Sort();
2106 return check_map; 2111 return check_map;
2107 } 2112 }
2108 2113
2109 virtual Representation RequiredInputRepresentation(int index) { 2114 virtual Representation RequiredInputRepresentation(int index) {
2110 return Representation::Tagged(); 2115 return Representation::Tagged();
2111 } 2116 }
2112 virtual void PrintDataTo(StringStream* stream); 2117 virtual void PrintDataTo(StringStream* stream);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
2161 return target_.is_identical_to(b->target()); 2166 return target_.is_identical_to(b->target());
2162 } 2167 }
2163 2168
2164 private: 2169 private:
2165 Handle<JSFunction> target_; 2170 Handle<JSFunction> target_;
2166 }; 2171 };
2167 2172
2168 2173
2169 class HCheckInstanceType: public HUnaryOperation { 2174 class HCheckInstanceType: public HUnaryOperation {
2170 public: 2175 public:
2171 static HCheckInstanceType* NewIsSpecObject(HValue* value) { 2176 static HCheckInstanceType* NewIsSpecObject(HValue* value, Zone* zone) {
2172 return new HCheckInstanceType(value, IS_SPEC_OBJECT); 2177 return new(zone) HCheckInstanceType(value, IS_SPEC_OBJECT);
2173 } 2178 }
2174 static HCheckInstanceType* NewIsJSArray(HValue* value) { 2179 static HCheckInstanceType* NewIsJSArray(HValue* value, Zone* zone) {
2175 return new HCheckInstanceType(value, IS_JS_ARRAY); 2180 return new(zone) HCheckInstanceType(value, IS_JS_ARRAY);
2176 } 2181 }
2177 static HCheckInstanceType* NewIsString(HValue* value) { 2182 static HCheckInstanceType* NewIsString(HValue* value, Zone* zone) {
2178 return new HCheckInstanceType(value, IS_STRING); 2183 return new(zone) HCheckInstanceType(value, IS_STRING);
2179 } 2184 }
2180 static HCheckInstanceType* NewIsSymbol(HValue* value) { 2185 static HCheckInstanceType* NewIsSymbol(HValue* value, Zone* zone) {
2181 return new HCheckInstanceType(value, IS_SYMBOL); 2186 return new(zone) HCheckInstanceType(value, IS_SYMBOL);
2182 } 2187 }
2183 2188
2184 virtual void PrintDataTo(StringStream* stream); 2189 virtual void PrintDataTo(StringStream* stream);
2185 2190
2186 virtual Representation RequiredInputRepresentation(int index) { 2191 virtual Representation RequiredInputRepresentation(int index) {
2187 return Representation::Tagged(); 2192 return Representation::Tagged();
2188 } 2193 }
2189 2194
2190 virtual HValue* Canonicalize(); 2195 virtual HValue* Canonicalize();
2191 2196
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2320 2325
2321 DECLARE_CONCRETE_INSTRUCTION(CheckSmi) 2326 DECLARE_CONCRETE_INSTRUCTION(CheckSmi)
2322 2327
2323 protected: 2328 protected:
2324 virtual bool DataEquals(HValue* other) { return true; } 2329 virtual bool DataEquals(HValue* other) { return true; }
2325 }; 2330 };
2326 2331
2327 2332
2328 class HPhi: public HValue { 2333 class HPhi: public HValue {
2329 public: 2334 public:
2330 explicit HPhi(int merged_index) 2335 HPhi(int merged_index, Zone* zone)
2331 : inputs_(2), 2336 : inputs_(2, zone),
2332 merged_index_(merged_index), 2337 merged_index_(merged_index),
2333 phi_id_(-1), 2338 phi_id_(-1),
2334 is_live_(false), 2339 is_live_(false),
2335 is_convertible_to_integer_(true) { 2340 is_convertible_to_integer_(true) {
2336 for (int i = 0; i < Representation::kNumRepresentations; i++) { 2341 for (int i = 0; i < Representation::kNumRepresentations; i++) {
2337 non_phi_uses_[i] = 0; 2342 non_phi_uses_[i] = 0;
2338 indirect_uses_[i] = 0; 2343 indirect_uses_[i] = 0;
2339 } 2344 }
2340 ASSERT(merged_index >= 0); 2345 ASSERT(merged_index >= 0);
2341 set_representation(Representation::Tagged()); 2346 set_representation(Representation::Tagged());
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
2480 (HeapNumber::cast(*handle_)->value() == 2485 (HeapNumber::cast(*handle_)->value() ==
2481 static_cast<double>(NumberToInt32(*handle_)))) return true; 2486 static_cast<double>(NumberToInt32(*handle_)))) return true;
2482 return false; 2487 return false;
2483 } 2488 }
2484 2489
2485 virtual bool EmitAtUses() { return !representation().IsDouble(); } 2490 virtual bool EmitAtUses() { return !representation().IsDouble(); }
2486 virtual HValue* Canonicalize(); 2491 virtual HValue* Canonicalize();
2487 virtual void PrintDataTo(StringStream* stream); 2492 virtual void PrintDataTo(StringStream* stream);
2488 virtual HType CalculateInferredType(); 2493 virtual HType CalculateInferredType();
2489 bool IsInteger() const { return handle_->IsSmi(); } 2494 bool IsInteger() const { return handle_->IsSmi(); }
2490 HConstant* CopyToRepresentation(Representation r) const; 2495 HConstant* CopyToRepresentation(Representation r, Zone* zone) const;
2491 HConstant* CopyToTruncatedInt32() const; 2496 HConstant* CopyToTruncatedInt32(Zone* zone) const;
2492 bool HasInteger32Value() const { return has_int32_value_; } 2497 bool HasInteger32Value() const { return has_int32_value_; }
2493 int32_t Integer32Value() const { 2498 int32_t Integer32Value() const {
2494 ASSERT(HasInteger32Value()); 2499 ASSERT(HasInteger32Value());
2495 return int32_value_; 2500 return int32_value_;
2496 } 2501 }
2497 bool HasDoubleValue() const { return has_double_value_; } 2502 bool HasDoubleValue() const { return has_double_value_; }
2498 double DoubleValue() const { 2503 double DoubleValue() const {
2499 ASSERT(HasDoubleValue()); 2504 ASSERT(HasDoubleValue());
2500 return double_value_; 2505 return double_value_;
2501 } 2506 }
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after
3880 bool is_in_object_; 3885 bool is_in_object_;
3881 int offset_; 3886 int offset_;
3882 }; 3887 };
3883 3888
3884 3889
3885 class HLoadNamedFieldPolymorphic: public HTemplateInstruction<2> { 3890 class HLoadNamedFieldPolymorphic: public HTemplateInstruction<2> {
3886 public: 3891 public:
3887 HLoadNamedFieldPolymorphic(HValue* context, 3892 HLoadNamedFieldPolymorphic(HValue* context,
3888 HValue* object, 3893 HValue* object,
3889 SmallMapList* types, 3894 SmallMapList* types,
3890 Handle<String> name); 3895 Handle<String> name,
3896 Zone* zone);
3891 3897
3892 HValue* context() { return OperandAt(0); } 3898 HValue* context() { return OperandAt(0); }
3893 HValue* object() { return OperandAt(1); } 3899 HValue* object() { return OperandAt(1); }
3894 SmallMapList* types() { return &types_; } 3900 SmallMapList* types() { return &types_; }
3895 Handle<String> name() { return name_; } 3901 Handle<String> name() { return name_; }
3896 bool need_generic() { return need_generic_; } 3902 bool need_generic() { return need_generic_; }
3897 3903
3898 virtual Representation RequiredInputRepresentation(int index) { 3904 virtual Representation RequiredInputRepresentation(int index) {
3899 return Representation::Tagged(); 3905 return Representation::Tagged();
3900 } 3906 }
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
5082 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); 5088 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex);
5083 }; 5089 };
5084 5090
5085 5091
5086 #undef DECLARE_INSTRUCTION 5092 #undef DECLARE_INSTRUCTION
5087 #undef DECLARE_CONCRETE_INSTRUCTION 5093 #undef DECLARE_CONCRETE_INSTRUCTION
5088 5094
5089 } } // namespace v8::internal 5095 } } // namespace v8::internal
5090 5096
5091 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 5097 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« 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