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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 void MarkRecursive() { | 396 void MarkRecursive() { |
397 is_recursive_ = true; | 397 is_recursive_ = true; |
398 } | 398 } |
399 | 399 |
400 bool is_recursive() const { | 400 bool is_recursive() const { |
401 return is_recursive_; | 401 return is_recursive_; |
402 } | 402 } |
403 | 403 |
404 void MarkDependsOnEmptyArrayProtoElements() { | 404 void MarkDependsOnEmptyArrayProtoElements() { |
405 // Add map dependency if not already added. | |
406 if (depends_on_empty_array_proto_elements_) return; | |
407 isolate()->initial_object_prototype()->map()->AddDependentCompilationInfo( | |
408 DependentCode::kElementsCantBeAddedGroup, info()); | |
409 isolate()->initial_array_prototype()->map()->AddDependentCompilationInfo( | |
410 DependentCode::kElementsCantBeAddedGroup, info()); | |
411 depends_on_empty_array_proto_elements_ = true; | 405 depends_on_empty_array_proto_elements_ = true; |
412 } | 406 } |
413 | 407 |
| 408 bool depends_on_empty_array_proto_elements() { |
| 409 return depends_on_empty_array_proto_elements_; |
| 410 } |
| 411 |
414 void RecordUint32Instruction(HInstruction* instr) { | 412 void RecordUint32Instruction(HInstruction* instr) { |
415 if (uint32_instructions_ == NULL) { | 413 if (uint32_instructions_ == NULL) { |
416 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone()); | 414 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone()); |
417 } | 415 } |
418 uint32_instructions_->Add(instr, zone()); | 416 uint32_instructions_->Add(instr, zone()); |
419 } | 417 } |
420 | 418 |
421 private: | 419 private: |
422 HConstant* GetConstant(SetOncePointer<HConstant>* pointer, | 420 HConstant* GetConstant(SetOncePointer<HConstant>* pointer, |
423 int32_t integer_value); | 421 int32_t integer_value); |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 virtual ~HGraphBuilder() {} | 961 virtual ~HGraphBuilder() {} |
964 | 962 |
965 HBasicBlock* current_block() const { return current_block_; } | 963 HBasicBlock* current_block() const { return current_block_; } |
966 void set_current_block(HBasicBlock* block) { current_block_ = block; } | 964 void set_current_block(HBasicBlock* block) { current_block_ = block; } |
967 HEnvironment* environment() const { | 965 HEnvironment* environment() const { |
968 return current_block()->last_environment(); | 966 return current_block()->last_environment(); |
969 } | 967 } |
970 Zone* zone() const { return info_->zone(); } | 968 Zone* zone() const { return info_->zone(); } |
971 HGraph* graph() const { return graph_; } | 969 HGraph* graph() const { return graph_; } |
972 Isolate* isolate() const { return graph_->isolate(); } | 970 Isolate* isolate() const { return graph_->isolate(); } |
973 CompilationInfo* top_info() { return info_; } | |
974 | 971 |
975 HGraph* CreateGraph(); | 972 HGraph* CreateGraph(); |
976 | 973 |
977 // Bailout environment manipulation. | 974 // Bailout environment manipulation. |
978 void Push(HValue* value) { environment()->Push(value); } | 975 void Push(HValue* value) { environment()->Push(value); } |
979 HValue* Pop() { return environment()->Pop(); } | 976 HValue* Pop() { return environment()->Pop(); } |
980 | 977 |
981 // Adding instructions. | 978 // Adding instructions. |
982 HInstruction* AddInstruction(HInstruction* instr); | 979 HInstruction* AddInstruction(HInstruction* instr); |
983 void AddSimulate(BailoutId id, | 980 void AddSimulate(BailoutId id, |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1484 static const int kMaxFastLiteralDepth = 3; | 1481 static const int kMaxFastLiteralDepth = 3; |
1485 static const int kMaxFastLiteralProperties = 8; | 1482 static const int kMaxFastLiteralProperties = 8; |
1486 | 1483 |
1487 // Simple accessors. | 1484 // Simple accessors. |
1488 void set_function_state(FunctionState* state) { function_state_ = state; } | 1485 void set_function_state(FunctionState* state) { function_state_ = state; } |
1489 | 1486 |
1490 AstContext* ast_context() const { return ast_context_; } | 1487 AstContext* ast_context() const { return ast_context_; } |
1491 void set_ast_context(AstContext* context) { ast_context_ = context; } | 1488 void set_ast_context(AstContext* context) { ast_context_ = context; } |
1492 | 1489 |
1493 // Accessors forwarded to the function state. | 1490 // Accessors forwarded to the function state. |
1494 CompilationInfo* current_info() const { | 1491 CompilationInfo* info() const { |
1495 return function_state()->compilation_info(); | 1492 return function_state()->compilation_info(); |
1496 } | 1493 } |
1497 AstContext* call_context() const { | 1494 AstContext* call_context() const { |
1498 return function_state()->call_context(); | 1495 return function_state()->call_context(); |
1499 } | 1496 } |
1500 HBasicBlock* function_return() const { | 1497 HBasicBlock* function_return() const { |
1501 return function_state()->function_return(); | 1498 return function_state()->function_return(); |
1502 } | 1499 } |
1503 TestContext* inlined_test_context() const { | 1500 TestContext* inlined_test_context() const { |
1504 return function_state()->test_context(); | 1501 return function_state()->test_context(); |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 EmbeddedVector<char, 64> filename_; | 2020 EmbeddedVector<char, 64> filename_; |
2024 HeapStringAllocator string_allocator_; | 2021 HeapStringAllocator string_allocator_; |
2025 StringStream trace_; | 2022 StringStream trace_; |
2026 int indent_; | 2023 int indent_; |
2027 }; | 2024 }; |
2028 | 2025 |
2029 | 2026 |
2030 } } // namespace v8::internal | 2027 } } // namespace v8::internal |
2031 | 2028 |
2032 #endif // V8_HYDROGEN_H_ | 2029 #endif // V8_HYDROGEN_H_ |
OLD | NEW |