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

Side by Side Diff: src/compiler.cc

Issue 1136883006: Reapply "Resolve references to "this" the same way as normal variables"" (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Fix this reference in super call, fix "this" in debug evaluator Created 5 years, 7 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/arm64/lithium-codegen-arm64.cc ('k') | src/compiler/ast-graph-builder.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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.h" 5 #include "src/compiler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "src/ast-numbering.h" 9 #include "src/ast-numbering.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 216 }
217 } 217 }
218 218
219 219
220 bool CompilationInfo::is_simple_parameter_list() { 220 bool CompilationInfo::is_simple_parameter_list() {
221 return scope()->is_simple_parameter_list(); 221 return scope()->is_simple_parameter_list();
222 } 222 }
223 223
224 224
225 bool CompilationInfo::MayUseThis() const { 225 bool CompilationInfo::MayUseThis() const {
226 return scope()->uses_this() || scope()->inner_uses_this() || 226 return scope()->has_this_declaration() && scope()->receiver()->is_used();
227 scope()->calls_sloppy_eval();
228 } 227 }
229 228
230 229
231 int CompilationInfo::TraceInlinedFunction(Handle<SharedFunctionInfo> shared, 230 int CompilationInfo::TraceInlinedFunction(Handle<SharedFunctionInfo> shared,
232 SourcePosition position, 231 SourcePosition position,
233 int parent_id) { 232 int parent_id) {
234 DCHECK(track_positions_); 233 DCHECK(track_positions_);
235 234
236 int inline_id = static_cast<int>(inlined_function_infos_.size()); 235 int inline_id = static_cast<int>(inlined_function_infos_.size());
237 InlinedFunctionInfo info(parent_id, position, UnboundScript::kNoScriptId, 236 InlinedFunctionInfo info(parent_id, position, UnboundScript::kNoScriptId,
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 } 1565 }
1567 1566
1568 1567
1569 #if DEBUG 1568 #if DEBUG
1570 void CompilationInfo::PrintAstForTesting() { 1569 void CompilationInfo::PrintAstForTesting() {
1571 PrintF("--- Source from AST ---\n%s\n", 1570 PrintF("--- Source from AST ---\n%s\n",
1572 PrettyPrinter(isolate(), zone()).PrintProgram(function())); 1571 PrettyPrinter(isolate(), zone()).PrintProgram(function()));
1573 } 1572 }
1574 #endif 1573 #endif
1575 } } // namespace v8::internal 1574 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/compiler/ast-graph-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698