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

Side by Side Diff: src/hydrogen.cc

Issue 1179893002: Add script context with context-allocated "const this" (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Factor out Variable::HasThisName Created 5 years, 6 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/compiler/ast-graph-builder.cc ('k') | src/ia32/full-codegen-ia32.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 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/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 10179 matching lines...) Expand 10 before | Expand all | Expand 10 after
10190 Add<HPushArguments>(obj, key, Add<HConstant>(function_language_mode())); 10190 Add<HPushArguments>(obj, key, Add<HConstant>(function_language_mode()));
10191 // TODO(olivf) InvokeFunction produces a check for the parameter count, 10191 // TODO(olivf) InvokeFunction produces a check for the parameter count,
10192 // even though we are certain to pass the correct number of arguments here. 10192 // even though we are certain to pass the correct number of arguments here.
10193 HInstruction* instr = New<HInvokeFunction>(function, 3); 10193 HInstruction* instr = New<HInvokeFunction>(function, 3);
10194 return ast_context()->ReturnInstruction(instr, expr->id()); 10194 return ast_context()->ReturnInstruction(instr, expr->id());
10195 } else if (proxy != NULL) { 10195 } else if (proxy != NULL) {
10196 Variable* var = proxy->var(); 10196 Variable* var = proxy->var();
10197 if (var->IsUnallocated()) { 10197 if (var->IsUnallocated()) {
10198 Bailout(kDeleteWithGlobalVariable); 10198 Bailout(kDeleteWithGlobalVariable);
10199 } else if (var->IsStackAllocated() || var->IsContextSlot()) { 10199 } else if (var->IsStackAllocated() || var->IsContextSlot()) {
10200 // Result of deleting non-global variables is false. 'this' is not 10200 // Result of deleting non-global variables is false. 'this' is not really
10201 // really a variable, though we implement it as one. The 10201 // a variable, though we implement it as one. The subexpression does not
10202 // subexpression does not have side effects. 10202 // have side effects.
10203 HValue* value = var->is_this() 10203 HValue* value = var->HasThisName(isolate()) ? graph()->GetConstantTrue()
10204 ? graph()->GetConstantTrue() 10204 : graph()->GetConstantFalse();
10205 : graph()->GetConstantFalse();
10206 return ast_context()->ReturnValue(value); 10205 return ast_context()->ReturnValue(value);
10207 } else { 10206 } else {
10208 Bailout(kDeleteWithNonGlobalVariable); 10207 Bailout(kDeleteWithNonGlobalVariable);
10209 } 10208 }
10210 } else { 10209 } else {
10211 // Result of deleting non-property, non-variable reference is true. 10210 // Result of deleting non-property, non-variable reference is true.
10212 // Evaluate the subexpression for side effects. 10211 // Evaluate the subexpression for side effects.
10213 CHECK_ALIVE(VisitForEffect(expr->expression())); 10212 CHECK_ALIVE(VisitForEffect(expr->expression()));
10214 return ast_context()->ReturnValue(graph()->GetConstantTrue()); 10213 return ast_context()->ReturnValue(graph()->GetConstantTrue());
10215 } 10214 }
(...skipping 2959 matching lines...) Expand 10 before | Expand all | Expand 10 after
13175 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13174 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13176 } 13175 }
13177 13176
13178 #ifdef DEBUG 13177 #ifdef DEBUG
13179 graph_->Verify(false); // No full verify. 13178 graph_->Verify(false); // No full verify.
13180 #endif 13179 #endif
13181 } 13180 }
13182 13181
13183 } // namespace internal 13182 } // namespace internal
13184 } // namespace v8 13183 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698