OLD | NEW |
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 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 HValue* BuildCheckString(HValue* string); | 1287 HValue* BuildCheckString(HValue* string); |
1288 HValue* BuildWrapReceiver(HValue* object, HValue* function); | 1288 HValue* BuildWrapReceiver(HValue* object, HValue* function); |
1289 | 1289 |
1290 // Building common constructs | 1290 // Building common constructs |
1291 HValue* BuildCheckForCapacityGrow(HValue* object, | 1291 HValue* BuildCheckForCapacityGrow(HValue* object, |
1292 HValue* elements, | 1292 HValue* elements, |
1293 ElementsKind kind, | 1293 ElementsKind kind, |
1294 HValue* length, | 1294 HValue* length, |
1295 HValue* key, | 1295 HValue* key, |
1296 bool is_js_array, | 1296 bool is_js_array, |
1297 bool is_store); | 1297 PropertyAccessType access_type); |
1298 | 1298 |
1299 HValue* BuildCopyElementsOnWrite(HValue* object, | 1299 HValue* BuildCopyElementsOnWrite(HValue* object, |
1300 HValue* elements, | 1300 HValue* elements, |
1301 ElementsKind kind, | 1301 ElementsKind kind, |
1302 HValue* length); | 1302 HValue* length); |
1303 | 1303 |
1304 void BuildTransitionElementsKind(HValue* object, | 1304 void BuildTransitionElementsKind(HValue* object, |
1305 HValue* map, | 1305 HValue* map, |
1306 ElementsKind from_kind, | 1306 ElementsKind from_kind, |
1307 ElementsKind to_kind, | 1307 ElementsKind to_kind, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 HValue* BuildStringAdd(HValue* left, | 1344 HValue* BuildStringAdd(HValue* left, |
1345 HValue* right, | 1345 HValue* right, |
1346 HAllocationMode allocation_mode); | 1346 HAllocationMode allocation_mode); |
1347 | 1347 |
1348 HInstruction* BuildUncheckedMonomorphicElementAccess( | 1348 HInstruction* BuildUncheckedMonomorphicElementAccess( |
1349 HValue* checked_object, | 1349 HValue* checked_object, |
1350 HValue* key, | 1350 HValue* key, |
1351 HValue* val, | 1351 HValue* val, |
1352 bool is_js_array, | 1352 bool is_js_array, |
1353 ElementsKind elements_kind, | 1353 ElementsKind elements_kind, |
1354 bool is_store, | 1354 PropertyAccessType access_type, |
1355 LoadKeyedHoleMode load_mode, | 1355 LoadKeyedHoleMode load_mode, |
1356 KeyedAccessStoreMode store_mode); | 1356 KeyedAccessStoreMode store_mode); |
1357 | 1357 |
1358 HInstruction* AddElementAccess( | 1358 HInstruction* AddElementAccess( |
1359 HValue* elements, | 1359 HValue* elements, |
1360 HValue* checked_key, | 1360 HValue* checked_key, |
1361 HValue* val, | 1361 HValue* val, |
1362 HValue* dependency, | 1362 HValue* dependency, |
1363 ElementsKind elements_kind, | 1363 ElementsKind elements_kind, |
1364 bool is_store, | 1364 PropertyAccessType access_type, |
1365 LoadKeyedHoleMode load_mode = NEVER_RETURN_HOLE); | 1365 LoadKeyedHoleMode load_mode = NEVER_RETURN_HOLE); |
1366 | 1366 |
1367 HLoadNamedField* BuildLoadNamedField(HValue* object, HObjectAccess access); | 1367 HLoadNamedField* BuildLoadNamedField(HValue* object, HObjectAccess access); |
1368 HInstruction* AddLoadNamedField(HValue* object, HObjectAccess access); | 1368 HInstruction* AddLoadNamedField(HValue* object, HObjectAccess access); |
1369 HInstruction* AddLoadStringInstanceType(HValue* string); | 1369 HInstruction* AddLoadStringInstanceType(HValue* string); |
1370 HInstruction* AddLoadStringLength(HValue* string); | 1370 HInstruction* AddLoadStringLength(HValue* string); |
1371 HStoreNamedField* AddStoreMapNoWriteBarrier(HValue* object, HValue* map) { | 1371 HStoreNamedField* AddStoreMapNoWriteBarrier(HValue* object, HValue* map) { |
1372 HStoreNamedField* store_map = Add<HStoreNamedField>( | 1372 HStoreNamedField* store_map = Add<HStoreNamedField>( |
1373 object, HObjectAccess::ForMap(), map); | 1373 object, HObjectAccess::ForMap(), map); |
1374 store_map->SkipWriteBarrier(); | 1374 store_map->SkipWriteBarrier(); |
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2180 void SetUpScope(Scope* scope); | 2180 void SetUpScope(Scope* scope); |
2181 virtual void VisitStatements(ZoneList<Statement*>* statements) V8_OVERRIDE; | 2181 virtual void VisitStatements(ZoneList<Statement*>* statements) V8_OVERRIDE; |
2182 | 2182 |
2183 #define DECLARE_VISIT(type) virtual void Visit##type(type* node) V8_OVERRIDE; | 2183 #define DECLARE_VISIT(type) virtual void Visit##type(type* node) V8_OVERRIDE; |
2184 AST_NODE_LIST(DECLARE_VISIT) | 2184 AST_NODE_LIST(DECLARE_VISIT) |
2185 #undef DECLARE_VISIT | 2185 #undef DECLARE_VISIT |
2186 | 2186 |
2187 Type* ToType(Handle<Map> map) { return IC::MapToType<Type>(map, zone()); } | 2187 Type* ToType(Handle<Map> map) { return IC::MapToType<Type>(map, zone()); } |
2188 | 2188 |
2189 private: | 2189 private: |
2190 enum PropertyAccessType { LOAD, STORE }; | |
2191 | |
2192 // Helpers for flow graph construction. | 2190 // Helpers for flow graph construction. |
2193 enum GlobalPropertyAccess { | 2191 enum GlobalPropertyAccess { |
2194 kUseCell, | 2192 kUseCell, |
2195 kUseGeneric | 2193 kUseGeneric |
2196 }; | 2194 }; |
2197 GlobalPropertyAccess LookupGlobalProperty(Variable* var, | 2195 GlobalPropertyAccess LookupGlobalProperty(Variable* var, |
2198 LookupResult* lookup, | 2196 LookupResult* lookup, |
2199 bool is_store); | 2197 PropertyAccessType access_type); |
2200 | 2198 |
2201 void EnsureArgumentsArePushedForAccess(); | 2199 void EnsureArgumentsArePushedForAccess(); |
2202 bool TryArgumentsAccess(Property* expr); | 2200 bool TryArgumentsAccess(Property* expr); |
2203 | 2201 |
2204 // Try to optimize fun.apply(receiver, arguments) pattern. | 2202 // Try to optimize fun.apply(receiver, arguments) pattern. |
2205 bool TryCallApply(Call* expr); | 2203 bool TryCallApply(Call* expr); |
2206 | 2204 |
2207 HValue* ImplicitReceiverFor(HValue* function, | 2205 HValue* ImplicitReceiverFor(HValue* function, |
2208 Handle<JSFunction> target); | 2206 Handle<JSFunction> target); |
2209 | 2207 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2449 HValue* val, | 2447 HValue* val, |
2450 SmallMapList* maps); | 2448 SmallMapList* maps); |
2451 | 2449 |
2452 LoadKeyedHoleMode BuildKeyedHoleMode(Handle<Map> map); | 2450 LoadKeyedHoleMode BuildKeyedHoleMode(Handle<Map> map); |
2453 | 2451 |
2454 HInstruction* BuildMonomorphicElementAccess(HValue* object, | 2452 HInstruction* BuildMonomorphicElementAccess(HValue* object, |
2455 HValue* key, | 2453 HValue* key, |
2456 HValue* val, | 2454 HValue* val, |
2457 HValue* dependency, | 2455 HValue* dependency, |
2458 Handle<Map> map, | 2456 Handle<Map> map, |
2459 bool is_store, | 2457 PropertyAccessType access_type, |
2460 KeyedAccessStoreMode store_mode); | 2458 KeyedAccessStoreMode store_mode); |
2461 | 2459 |
2462 HValue* HandlePolymorphicElementAccess(HValue* object, | 2460 HValue* HandlePolymorphicElementAccess(HValue* object, |
2463 HValue* key, | 2461 HValue* key, |
2464 HValue* val, | 2462 HValue* val, |
2465 SmallMapList* maps, | 2463 SmallMapList* maps, |
2466 bool is_store, | 2464 PropertyAccessType access_type, |
2467 KeyedAccessStoreMode store_mode, | 2465 KeyedAccessStoreMode store_mode, |
2468 bool* has_side_effects); | 2466 bool* has_side_effects); |
2469 | 2467 |
2470 HValue* HandleKeyedElementAccess(HValue* obj, | 2468 HValue* HandleKeyedElementAccess(HValue* obj, |
2471 HValue* key, | 2469 HValue* key, |
2472 HValue* val, | 2470 HValue* val, |
2473 Expression* expr, | 2471 Expression* expr, |
2474 bool is_store, | 2472 PropertyAccessType access_type, |
2475 bool* has_side_effects); | 2473 bool* has_side_effects); |
2476 | 2474 |
2477 HInstruction* BuildNamedGeneric(PropertyAccessType access, | 2475 HInstruction* BuildNamedGeneric(PropertyAccessType access, |
2478 HValue* object, | 2476 HValue* object, |
2479 Handle<String> name, | 2477 Handle<String> name, |
2480 HValue* value, | 2478 HValue* value, |
2481 bool is_uninitialized = false); | 2479 bool is_uninitialized = false); |
2482 | 2480 |
2483 HCheckMaps* AddCheckMap(HValue* object, Handle<Map> map); | 2481 HCheckMaps* AddCheckMap(HValue* object, Handle<Map> map); |
2484 | 2482 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2740 } | 2738 } |
2741 | 2739 |
2742 private: | 2740 private: |
2743 HGraphBuilder* builder_; | 2741 HGraphBuilder* builder_; |
2744 }; | 2742 }; |
2745 | 2743 |
2746 | 2744 |
2747 } } // namespace v8::internal | 2745 } } // namespace v8::internal |
2748 | 2746 |
2749 #endif // V8_HYDROGEN_H_ | 2747 #endif // V8_HYDROGEN_H_ |
OLD | NEW |