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

Side by Side Diff: src/objects.cc

Issue 1970153002: Allow Script::FindSharedFunctionInfo to return toplevel functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/compiler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 12355 matching lines...) Expand 10 before | Expand all | Expand 10 after
12366 12366
12367 12367
12368 MaybeHandle<SharedFunctionInfo> Script::FindSharedFunctionInfo( 12368 MaybeHandle<SharedFunctionInfo> Script::FindSharedFunctionInfo(
12369 FunctionLiteral* fun) { 12369 FunctionLiteral* fun) {
12370 WeakFixedArray::Iterator iterator(shared_function_infos()); 12370 WeakFixedArray::Iterator iterator(shared_function_infos());
12371 SharedFunctionInfo* shared; 12371 SharedFunctionInfo* shared;
12372 while ((shared = iterator.Next<SharedFunctionInfo>())) { 12372 while ((shared = iterator.Next<SharedFunctionInfo>())) {
12373 if (fun->function_token_position() == shared->function_token_position() && 12373 if (fun->function_token_position() == shared->function_token_position() &&
12374 fun->start_position() == shared->start_position() && 12374 fun->start_position() == shared->start_position() &&
12375 fun->end_position() == shared->end_position()) { 12375 fun->end_position() == shared->end_position()) {
12376 // This method is not used to find top-level SharedFunctionInfo objects,
12377 // verify that above checks are sufficient to distinguish top-level code.
12378 DCHECK(!shared->is_toplevel());
12379 return Handle<SharedFunctionInfo>(shared); 12376 return Handle<SharedFunctionInfo>(shared);
12380 } 12377 }
12381 } 12378 }
12382 return MaybeHandle<SharedFunctionInfo>(); 12379 return MaybeHandle<SharedFunctionInfo>();
12383 } 12380 }
12384 12381
12385 12382
12386 Script::Iterator::Iterator(Isolate* isolate) 12383 Script::Iterator::Iterator(Isolate* isolate)
12387 : iterator_(isolate->heap()->script_list()) {} 12384 : iterator_(isolate->heap()->script_list()) {}
12388 12385
(...skipping 5869 matching lines...) Expand 10 before | Expand all | Expand 10 after
18258 if (cell->value() != *new_value) { 18255 if (cell->value() != *new_value) {
18259 cell->set_value(*new_value); 18256 cell->set_value(*new_value);
18260 Isolate* isolate = cell->GetIsolate(); 18257 Isolate* isolate = cell->GetIsolate();
18261 cell->dependent_code()->DeoptimizeDependentCodeGroup( 18258 cell->dependent_code()->DeoptimizeDependentCodeGroup(
18262 isolate, DependentCode::kPropertyCellChangedGroup); 18259 isolate, DependentCode::kPropertyCellChangedGroup);
18263 } 18260 }
18264 } 18261 }
18265 18262
18266 } // namespace internal 18263 } // namespace internal
18267 } // namespace v8 18264 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698