Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 2810363003: [builtins] Introduce DeleteProperty builtin (Closed)
Patch Set: fix CallableFor not to create handles Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/code-stub-assembler.cc ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/ast/compile-time-value.h" 7 #include "src/ast/compile-time-value.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/compilation-info.h" 9 #include "src/compilation-info.h"
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 2102 matching lines...) Expand 10 before | Expand all | Expand 10 after
2113 Variable* variable = expr->expression()->AsVariableProxy()->var(); 2113 Variable* variable = expr->expression()->AsVariableProxy()->var();
2114 DCHECK(is_sloppy(language_mode()) || variable->is_this()); 2114 DCHECK(is_sloppy(language_mode()) || variable->is_this());
2115 value = BuildVariableDelete(variable, expr->id(), 2115 value = BuildVariableDelete(variable, expr->id(),
2116 ast_context()->GetStateCombine()); 2116 ast_context()->GetStateCombine());
2117 } else if (expr->expression()->IsProperty()) { 2117 } else if (expr->expression()->IsProperty()) {
2118 Property* property = expr->expression()->AsProperty(); 2118 Property* property = expr->expression()->AsProperty();
2119 VisitForValue(property->obj()); 2119 VisitForValue(property->obj());
2120 VisitForValue(property->key()); 2120 VisitForValue(property->key());
2121 Node* key = environment()->Pop(); 2121 Node* key = environment()->Pop();
2122 Node* object = environment()->Pop(); 2122 Node* object = environment()->Pop();
2123 value = NewNode(javascript()->DeleteProperty(language_mode()), object, key); 2123 Node* mode = jsgraph()->Constant(static_cast<int32_t>(language_mode()));
2124 value = NewNode(javascript()->DeleteProperty(), object, key, mode);
2124 PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine()); 2125 PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine());
2125 } else { 2126 } else {
2126 VisitForEffect(expr->expression()); 2127 VisitForEffect(expr->expression());
2127 value = jsgraph()->TrueConstant(); 2128 value = jsgraph()->TrueConstant();
2128 } 2129 }
2129 ast_context()->ProduceValue(expr, value); 2130 ast_context()->ProduceValue(expr, value);
2130 } 2131 }
2131 2132
2132 2133
2133 void AstGraphBuilder::VisitVoid(UnaryOperation* expr) { 2134 void AstGraphBuilder::VisitVoid(UnaryOperation* expr) {
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
2446 2447
2447 2448
2448 Node* AstGraphBuilder::BuildVariableDelete(Variable* variable, 2449 Node* AstGraphBuilder::BuildVariableDelete(Variable* variable,
2449 BailoutId bailout_id, 2450 BailoutId bailout_id,
2450 OutputFrameStateCombine combine) { 2451 OutputFrameStateCombine combine) {
2451 switch (variable->location()) { 2452 switch (variable->location()) {
2452 case VariableLocation::UNALLOCATED: { 2453 case VariableLocation::UNALLOCATED: {
2453 // Global var, const, or let variable. 2454 // Global var, const, or let variable.
2454 Node* global = BuildLoadGlobalObject(); 2455 Node* global = BuildLoadGlobalObject();
2455 Node* name = jsgraph()->Constant(variable->name()); 2456 Node* name = jsgraph()->Constant(variable->name());
2456 const Operator* op = javascript()->DeleteProperty(language_mode()); 2457 Node* mode = jsgraph()->Constant(static_cast<int32_t>(language_mode()));
2457 Node* result = NewNode(op, global, name); 2458 const Operator* op = javascript()->DeleteProperty();
2459 Node* result = NewNode(op, global, name, mode);
2458 PrepareFrameState(result, bailout_id, combine); 2460 PrepareFrameState(result, bailout_id, combine);
2459 return result; 2461 return result;
2460 } 2462 }
2461 case VariableLocation::PARAMETER: 2463 case VariableLocation::PARAMETER:
2462 case VariableLocation::LOCAL: 2464 case VariableLocation::LOCAL:
2463 case VariableLocation::CONTEXT: { 2465 case VariableLocation::CONTEXT: {
2464 // Local var, const, or let variable or context variable. 2466 // Local var, const, or let variable or context variable.
2465 return jsgraph()->BooleanConstant(variable->is_this()); 2467 return jsgraph()->BooleanConstant(variable->is_this());
2466 } 2468 }
2467 case VariableLocation::LOOKUP: 2469 case VariableLocation::LOOKUP:
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
3175 float invocation_frequency, LoopAssignmentAnalysis* loop_assignment, 3177 float invocation_frequency, LoopAssignmentAnalysis* loop_assignment,
3176 SourcePositionTable* source_positions, int inlining_id) 3178 SourcePositionTable* source_positions, int inlining_id)
3177 : AstGraphBuilder(local_zone, info, jsgraph, invocation_frequency, 3179 : AstGraphBuilder(local_zone, info, jsgraph, invocation_frequency,
3178 loop_assignment), 3180 loop_assignment),
3179 source_positions_(source_positions), 3181 source_positions_(source_positions),
3180 start_position_(info->shared_info()->start_position(), inlining_id) {} 3182 start_position_(info->shared_info()->start_position(), inlining_id) {}
3181 3183
3182 } // namespace compiler 3184 } // namespace compiler
3183 } // namespace internal 3185 } // namespace internal
3184 } // namespace v8 3186 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stub-assembler.cc ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698