| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/hydrogen.h" | 5 #include "src/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
| 10 #include "src/ast-numbering.h" | 10 #include "src/ast-numbering.h" |
| (...skipping 12753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12764 void HOptimizedGraphBuilder::GenerateDebugIsActive(CallRuntime* call) { | 12764 void HOptimizedGraphBuilder::GenerateDebugIsActive(CallRuntime* call) { |
| 12765 DCHECK(call->arguments()->length() == 0); | 12765 DCHECK(call->arguments()->length() == 0); |
| 12766 HValue* ref = | 12766 HValue* ref = |
| 12767 Add<HConstant>(ExternalReference::debug_is_active_address(isolate())); | 12767 Add<HConstant>(ExternalReference::debug_is_active_address(isolate())); |
| 12768 HValue* value = | 12768 HValue* value = |
| 12769 Add<HLoadNamedField>(ref, nullptr, HObjectAccess::ForExternalUInteger8()); | 12769 Add<HLoadNamedField>(ref, nullptr, HObjectAccess::ForExternalUInteger8()); |
| 12770 return ast_context()->ReturnValue(value); | 12770 return ast_context()->ReturnValue(value); |
| 12771 } | 12771 } |
| 12772 | 12772 |
| 12773 | 12773 |
| 12774 void HOptimizedGraphBuilder::GenerateGetPrototype(CallRuntime* call) { | |
| 12775 DCHECK(call->arguments()->length() == 1); | |
| 12776 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | |
| 12777 HValue* object = Pop(); | |
| 12778 | |
| 12779 NoObservableSideEffectsScope no_effects(this); | |
| 12780 | |
| 12781 HValue* map = Add<HLoadNamedField>(object, nullptr, HObjectAccess::ForMap()); | |
| 12782 HValue* bit_field = | |
| 12783 Add<HLoadNamedField>(map, nullptr, HObjectAccess::ForMapBitField()); | |
| 12784 HValue* is_access_check_needed_mask = | |
| 12785 Add<HConstant>(1 << Map::kIsAccessCheckNeeded); | |
| 12786 HValue* is_access_check_needed_test = AddUncasted<HBitwise>( | |
| 12787 Token::BIT_AND, bit_field, is_access_check_needed_mask); | |
| 12788 | |
| 12789 HValue* proto = | |
| 12790 Add<HLoadNamedField>(map, nullptr, HObjectAccess::ForPrototype()); | |
| 12791 HValue* proto_map = | |
| 12792 Add<HLoadNamedField>(proto, nullptr, HObjectAccess::ForMap()); | |
| 12793 HValue* proto_bit_field = | |
| 12794 Add<HLoadNamedField>(proto_map, nullptr, HObjectAccess::ForMapBitField()); | |
| 12795 HValue* is_hidden_prototype_mask = | |
| 12796 Add<HConstant>(1 << Map::kIsHiddenPrototype); | |
| 12797 HValue* is_hidden_prototype_test = AddUncasted<HBitwise>( | |
| 12798 Token::BIT_AND, proto_bit_field, is_hidden_prototype_mask); | |
| 12799 | |
| 12800 { | |
| 12801 IfBuilder needs_runtime(this); | |
| 12802 needs_runtime.If<HCompareNumericAndBranch>( | |
| 12803 is_access_check_needed_test, graph()->GetConstant0(), Token::NE); | |
| 12804 needs_runtime.OrIf<HCompareNumericAndBranch>( | |
| 12805 is_hidden_prototype_test, graph()->GetConstant0(), Token::NE); | |
| 12806 | |
| 12807 needs_runtime.Then(); | |
| 12808 { | |
| 12809 Add<HPushArguments>(object); | |
| 12810 Push( | |
| 12811 Add<HCallRuntime>(Runtime::FunctionForId(Runtime::kGetPrototype), 1)); | |
| 12812 } | |
| 12813 | |
| 12814 needs_runtime.Else(); | |
| 12815 Push(proto); | |
| 12816 } | |
| 12817 return ast_context()->ReturnValue(Pop()); | |
| 12818 } | |
| 12819 | |
| 12820 | |
| 12821 #undef CHECK_BAILOUT | 12774 #undef CHECK_BAILOUT |
| 12822 #undef CHECK_ALIVE | 12775 #undef CHECK_ALIVE |
| 12823 | 12776 |
| 12824 | 12777 |
| 12825 HEnvironment::HEnvironment(HEnvironment* outer, | 12778 HEnvironment::HEnvironment(HEnvironment* outer, |
| 12826 Scope* scope, | 12779 Scope* scope, |
| 12827 Handle<JSFunction> closure, | 12780 Handle<JSFunction> closure, |
| 12828 Zone* zone) | 12781 Zone* zone) |
| 12829 : closure_(closure), | 12782 : closure_(closure), |
| 12830 values_(0, zone), | 12783 values_(0, zone), |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13451 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13404 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13452 } | 13405 } |
| 13453 | 13406 |
| 13454 #ifdef DEBUG | 13407 #ifdef DEBUG |
| 13455 graph_->Verify(false); // No full verify. | 13408 graph_->Verify(false); // No full verify. |
| 13456 #endif | 13409 #endif |
| 13457 } | 13410 } |
| 13458 | 13411 |
| 13459 } // namespace internal | 13412 } // namespace internal |
| 13460 } // namespace v8 | 13413 } // namespace v8 |
| OLD | NEW |