| 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/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
| (...skipping 9995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10006 | 10006 |
| 10007 | 10007 |
| 10008 void HOptimizedGraphBuilder::VisitDelete(UnaryOperation* expr) { | 10008 void HOptimizedGraphBuilder::VisitDelete(UnaryOperation* expr) { |
| 10009 Property* prop = expr->expression()->AsProperty(); | 10009 Property* prop = expr->expression()->AsProperty(); |
| 10010 VariableProxy* proxy = expr->expression()->AsVariableProxy(); | 10010 VariableProxy* proxy = expr->expression()->AsVariableProxy(); |
| 10011 if (prop != NULL) { | 10011 if (prop != NULL) { |
| 10012 CHECK_ALIVE(VisitForValue(prop->obj())); | 10012 CHECK_ALIVE(VisitForValue(prop->obj())); |
| 10013 CHECK_ALIVE(VisitForValue(prop->key())); | 10013 CHECK_ALIVE(VisitForValue(prop->key())); |
| 10014 HValue* key = Pop(); | 10014 HValue* key = Pop(); |
| 10015 HValue* obj = Pop(); | 10015 HValue* obj = Pop(); |
| 10016 Add<HPushArguments>(obj, key); | 10016 HValue* language_mode = Add<HConstant>( |
| 10017 HInstruction* instr = New<HCallRuntime>( | 10017 static_cast<int32_t>(function_language_mode()), Representation::Smi()); |
| 10018 Runtime::FunctionForId(is_strict(function_language_mode()) | 10018 Add<HPushArguments>(obj, key, language_mode); |
| 10019 ? Runtime::kDeleteProperty_Strict | 10019 HInstruction* instr = |
| 10020 : Runtime::kDeleteProperty_Sloppy), | 10020 New<HCallRuntime>(Runtime::FunctionForId(Runtime::kDeleteProperty), 3); |
| 10021 2); | |
| 10022 return ast_context()->ReturnInstruction(instr, expr->id()); | 10021 return ast_context()->ReturnInstruction(instr, expr->id()); |
| 10023 } else if (proxy != NULL) { | 10022 } else if (proxy != NULL) { |
| 10024 Variable* var = proxy->var(); | 10023 Variable* var = proxy->var(); |
| 10025 if (var->IsUnallocated()) { | 10024 if (var->IsUnallocated()) { |
| 10026 Bailout(kDeleteWithGlobalVariable); | 10025 Bailout(kDeleteWithGlobalVariable); |
| 10027 } else if (var->IsStackAllocated() || var->IsContextSlot()) { | 10026 } else if (var->IsStackAllocated() || var->IsContextSlot()) { |
| 10028 // Result of deleting non-global variables is false. 'this' is not really | 10027 // Result of deleting non-global variables is false. 'this' is not really |
| 10029 // a variable, though we implement it as one. The subexpression does not | 10028 // a variable, though we implement it as one. The subexpression does not |
| 10030 // have side effects. | 10029 // have side effects. |
| 10031 HValue* value = var->is_this() ? graph()->GetConstantTrue() | 10030 HValue* value = var->is_this() ? graph()->GetConstantTrue() |
| (...skipping 2713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12745 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12744 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 12746 } | 12745 } |
| 12747 | 12746 |
| 12748 #ifdef DEBUG | 12747 #ifdef DEBUG |
| 12749 graph_->Verify(false); // No full verify. | 12748 graph_->Verify(false); // No full verify. |
| 12750 #endif | 12749 #endif |
| 12751 } | 12750 } |
| 12752 | 12751 |
| 12753 } // namespace internal | 12752 } // namespace internal |
| 12754 } // namespace v8 | 12753 } // namespace v8 |
| OLD | NEW |