| 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 bool CheckConstPhiUses(); | 297 bool CheckConstPhiUses(); |
| 298 | 298 |
| 299 void CollectPhis(); | 299 void CollectPhis(); |
| 300 | 300 |
| 301 void set_undefined_constant(HConstant* constant) { | 301 void set_undefined_constant(HConstant* constant) { |
| 302 undefined_constant_.set(constant); | 302 undefined_constant_.set(constant); |
| 303 } | 303 } |
| 304 HConstant* GetConstantUndefined() const { return undefined_constant_.get(); } | 304 HConstant* GetConstantUndefined() const { return undefined_constant_.get(); } |
| 305 HConstant* GetConstant0(); | 305 HConstant* GetConstant0(); |
| 306 HConstant* GetConstant1(); | 306 HConstant* GetConstant1(); |
| 307 HConstant* GetConstantSmi0(); |
| 308 HConstant* GetConstantSmi1(); |
| 307 HConstant* GetConstantMinus1(); | 309 HConstant* GetConstantMinus1(); |
| 308 HConstant* GetConstantTrue(); | 310 HConstant* GetConstantTrue(); |
| 309 HConstant* GetConstantFalse(); | 311 HConstant* GetConstantFalse(); |
| 310 HConstant* GetConstantHole(); | 312 HConstant* GetConstantHole(); |
| 313 HConstant* GetConstantNull(); |
| 311 HConstant* GetInvalidContext(); | 314 HConstant* GetInvalidContext(); |
| 312 | 315 |
| 313 HBasicBlock* CreateBasicBlock(); | 316 HBasicBlock* CreateBasicBlock(); |
| 314 HArgumentsObject* GetArgumentsObject() const { | 317 HArgumentsObject* GetArgumentsObject() const { |
| 315 return arguments_object_.get(); | 318 return arguments_object_.get(); |
| 316 } | 319 } |
| 317 | 320 |
| 318 void SetArgumentsObject(HArgumentsObject* object) { | 321 void SetArgumentsObject(HArgumentsObject* object) { |
| 319 arguments_object_.set(object); | 322 arguments_object_.set(object); |
| 320 } | 323 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 void RecordUint32Instruction(HInstruction* instr) { | 391 void RecordUint32Instruction(HInstruction* instr) { |
| 389 if (uint32_instructions_ == NULL) { | 392 if (uint32_instructions_ == NULL) { |
| 390 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone()); | 393 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone()); |
| 391 } | 394 } |
| 392 uint32_instructions_->Add(instr, zone()); | 395 uint32_instructions_->Add(instr, zone()); |
| 393 } | 396 } |
| 394 | 397 |
| 395 private: | 398 private: |
| 396 HConstant* GetConstantInt32(SetOncePointer<HConstant>* pointer, | 399 HConstant* GetConstantInt32(SetOncePointer<HConstant>* pointer, |
| 397 int32_t integer_value); | 400 int32_t integer_value); |
| 401 HConstant* GetConstantSmi(SetOncePointer<HConstant>* pointer, |
| 402 int32_t integer_value); |
| 398 | 403 |
| 399 void MarkAsDeoptimizingRecursively(HBasicBlock* block); | 404 void MarkAsDeoptimizingRecursively(HBasicBlock* block); |
| 400 void NullifyUnreachableInstructions(); | 405 void NullifyUnreachableInstructions(); |
| 401 void InsertTypeConversions(HInstruction* instr); | 406 void InsertTypeConversions(HInstruction* instr); |
| 402 void PropagateMinusZeroChecks(HValue* value, BitVector* visited); | 407 void PropagateMinusZeroChecks(HValue* value, BitVector* visited); |
| 403 void RecursivelyMarkPhiDeoptimizeOnUndefined(HPhi* phi); | 408 void RecursivelyMarkPhiDeoptimizeOnUndefined(HPhi* phi); |
| 404 void InsertRepresentationChangeForUse(HValue* value, | 409 void InsertRepresentationChangeForUse(HValue* value, |
| 405 HValue* use_value, | 410 HValue* use_value, |
| 406 int use_index, | 411 int use_index, |
| 407 Representation to); | 412 Representation to); |
| 408 void InsertRepresentationChangesForValue(HValue* value); | 413 void InsertRepresentationChangesForValue(HValue* value); |
| 409 void InferTypes(ZoneList<HValue*>* worklist); | 414 void InferTypes(ZoneList<HValue*>* worklist); |
| 410 void InitializeInferredTypes(int from_inclusive, int to_inclusive); | 415 void InitializeInferredTypes(int from_inclusive, int to_inclusive); |
| 411 void CheckForBackEdge(HBasicBlock* block, HBasicBlock* successor); | 416 void CheckForBackEdge(HBasicBlock* block, HBasicBlock* successor); |
| 412 void SetupInformativeDefinitionsInBlock(HBasicBlock* block); | 417 void SetupInformativeDefinitionsInBlock(HBasicBlock* block); |
| 413 void SetupInformativeDefinitionsRecursively(HBasicBlock* block); | 418 void SetupInformativeDefinitionsRecursively(HBasicBlock* block); |
| 414 void EliminateRedundantBoundsChecks(HBasicBlock* bb, BoundsCheckTable* table); | 419 void EliminateRedundantBoundsChecks(HBasicBlock* bb, BoundsCheckTable* table); |
| 415 | 420 |
| 416 Isolate* isolate_; | 421 Isolate* isolate_; |
| 417 int next_block_id_; | 422 int next_block_id_; |
| 418 HBasicBlock* entry_block_; | 423 HBasicBlock* entry_block_; |
| 419 HEnvironment* start_environment_; | 424 HEnvironment* start_environment_; |
| 420 ZoneList<HBasicBlock*> blocks_; | 425 ZoneList<HBasicBlock*> blocks_; |
| 421 ZoneList<HValue*> values_; | 426 ZoneList<HValue*> values_; |
| 422 ZoneList<HPhi*>* phi_list_; | 427 ZoneList<HPhi*>* phi_list_; |
| 423 ZoneList<HInstruction*>* uint32_instructions_; | 428 ZoneList<HInstruction*>* uint32_instructions_; |
| 424 SetOncePointer<HConstant> undefined_constant_; | 429 SetOncePointer<HConstant> undefined_constant_; |
| 425 SetOncePointer<HConstant> constant_0_; | 430 SetOncePointer<HConstant> constant_0_; |
| 426 SetOncePointer<HConstant> constant_1_; | 431 SetOncePointer<HConstant> constant_1_; |
| 432 SetOncePointer<HConstant> constant_smi_0_; |
| 433 SetOncePointer<HConstant> constant_smi_1_; |
| 427 SetOncePointer<HConstant> constant_minus1_; | 434 SetOncePointer<HConstant> constant_minus1_; |
| 428 SetOncePointer<HConstant> constant_true_; | 435 SetOncePointer<HConstant> constant_true_; |
| 429 SetOncePointer<HConstant> constant_false_; | 436 SetOncePointer<HConstant> constant_false_; |
| 430 SetOncePointer<HConstant> constant_the_hole_; | 437 SetOncePointer<HConstant> constant_the_hole_; |
| 438 SetOncePointer<HConstant> constant_null_; |
| 431 SetOncePointer<HConstant> constant_invalid_context_; | 439 SetOncePointer<HConstant> constant_invalid_context_; |
| 432 SetOncePointer<HArgumentsObject> arguments_object_; | 440 SetOncePointer<HArgumentsObject> arguments_object_; |
| 433 | 441 |
| 434 SetOncePointer<HBasicBlock> osr_loop_entry_; | 442 SetOncePointer<HBasicBlock> osr_loop_entry_; |
| 435 SetOncePointer<ZoneList<HUnknownOSRValue*> > osr_values_; | 443 SetOncePointer<ZoneList<HUnknownOSRValue*> > osr_values_; |
| 436 | 444 |
| 437 CompilationInfo* info_; | 445 CompilationInfo* info_; |
| 438 Zone* zone_; | 446 Zone* zone_; |
| 439 | 447 |
| 440 bool is_recursive_; | 448 bool is_recursive_; |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 class CheckBuilder { | 1024 class CheckBuilder { |
| 1017 public: | 1025 public: |
| 1018 explicit CheckBuilder(HGraphBuilder* builder); | 1026 explicit CheckBuilder(HGraphBuilder* builder); |
| 1019 ~CheckBuilder() { | 1027 ~CheckBuilder() { |
| 1020 if (!finished_) End(); | 1028 if (!finished_) End(); |
| 1021 } | 1029 } |
| 1022 | 1030 |
| 1023 HValue* CheckNotUndefined(HValue* value); | 1031 HValue* CheckNotUndefined(HValue* value); |
| 1024 HValue* CheckIntegerCompare(HValue* left, HValue* right, Token::Value op); | 1032 HValue* CheckIntegerCompare(HValue* left, HValue* right, Token::Value op); |
| 1025 HValue* CheckIntegerEq(HValue* left, HValue* right); | 1033 HValue* CheckIntegerEq(HValue* left, HValue* right); |
| 1034 |
| 1026 void End(); | 1035 void End(); |
| 1027 | 1036 |
| 1028 private: | 1037 private: |
| 1029 Zone* zone() { return builder_->zone(); } | 1038 Zone* zone() { return builder_->zone(); } |
| 1030 | 1039 |
| 1031 HGraphBuilder* builder_; | 1040 HGraphBuilder* builder_; |
| 1032 bool finished_; | 1041 bool finished_; |
| 1033 HBasicBlock* failure_block_; | 1042 HBasicBlock* failure_block_; |
| 1034 HBasicBlock* merge_block_; | 1043 HBasicBlock* merge_block_; |
| 1035 }; | 1044 }; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1243 ElementsKind to_elements_kind, | 1252 ElementsKind to_elements_kind, |
| 1244 HValue* length, | 1253 HValue* length, |
| 1245 HValue* capacity); | 1254 HValue* capacity); |
| 1246 | 1255 |
| 1247 HValue* BuildCloneShallowArray(HContext* context, | 1256 HValue* BuildCloneShallowArray(HContext* context, |
| 1248 HValue* boilerplate, | 1257 HValue* boilerplate, |
| 1249 AllocationSiteMode mode, | 1258 AllocationSiteMode mode, |
| 1250 ElementsKind kind, | 1259 ElementsKind kind, |
| 1251 int length); | 1260 int length); |
| 1252 | 1261 |
| 1262 void BuildCompareNil( |
| 1263 HValue* value, |
| 1264 EqualityKind kind, |
| 1265 CompareNilICStub::Types types, |
| 1266 Handle<Map> map, |
| 1267 int position, |
| 1268 HIfContinuation* continuation); |
| 1269 |
| 1253 private: | 1270 private: |
| 1254 HGraphBuilder(); | 1271 HGraphBuilder(); |
| 1255 CompilationInfo* info_; | 1272 CompilationInfo* info_; |
| 1256 HGraph* graph_; | 1273 HGraph* graph_; |
| 1257 HBasicBlock* current_block_; | 1274 HBasicBlock* current_block_; |
| 1258 int no_side_effects_scope_count_; | 1275 int no_side_effects_scope_count_; |
| 1259 }; | 1276 }; |
| 1260 | 1277 |
| 1261 | 1278 |
| 1262 class HOptimizedGraphBuilder: public HGraphBuilder, public AstVisitor { | 1279 class HOptimizedGraphBuilder: public HGraphBuilder, public AstVisitor { |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1940 EmbeddedVector<char, 64> filename_; | 1957 EmbeddedVector<char, 64> filename_; |
| 1941 HeapStringAllocator string_allocator_; | 1958 HeapStringAllocator string_allocator_; |
| 1942 StringStream trace_; | 1959 StringStream trace_; |
| 1943 int indent_; | 1960 int indent_; |
| 1944 }; | 1961 }; |
| 1945 | 1962 |
| 1946 | 1963 |
| 1947 } } // namespace v8::internal | 1964 } } // namespace v8::internal |
| 1948 | 1965 |
| 1949 #endif // V8_HYDROGEN_H_ | 1966 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |