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

Side by Side Diff: test/unittests/compiler-dispatcher/compiler-dispatcher-job-unittest.cc

Issue 2481163002: Assign unique IDs to FunctionLiterals (Closed)
Patch Set: updates Created 4 years 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
« src/parsing/parser-base.h ('K') | « src/v8.gyp ('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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 <memory> 5 #include <memory>
6 6
7 #include "include/v8.h" 7 #include "include/v8.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/ast/scopes.h" 10 #include "src/ast/scopes.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } else { 77 } else {
78 source = isolate->factory()->NewStringFromAsciiChecked(test_script); 78 source = isolate->factory()->NewStringFromAsciiChecked(test_script);
79 } 79 }
80 Handle<Script> script = isolate->factory()->NewScript(source); 80 Handle<Script> script = isolate->factory()->NewScript(source);
81 Handle<SharedFunctionInfo> shared = isolate->factory()->NewSharedFunctionInfo( 81 Handle<SharedFunctionInfo> shared = isolate->factory()->NewSharedFunctionInfo(
82 isolate->factory()->NewStringFromAsciiChecked("f"), 82 isolate->factory()->NewStringFromAsciiChecked("f"),
83 isolate->builtins()->CompileLazy(), false); 83 isolate->builtins()->CompileLazy(), false);
84 SharedFunctionInfo::SetScript(shared, script); 84 SharedFunctionInfo::SetScript(shared, script);
85 shared->set_end_position(source->length()); 85 shared->set_end_position(source->length());
86 shared->set_outer_scope_info(ScopeInfo::Empty(isolate)); 86 shared->set_outer_scope_info(ScopeInfo::Empty(isolate));
87 shared->set_function_literal_id(1);
87 return scope.CloseAndEscape(shared); 88 return scope.CloseAndEscape(shared);
88 } 89 }
89 90
90 Handle<Object> RunJS(v8::Isolate* isolate, const char* script) { 91 Handle<Object> RunJS(v8::Isolate* isolate, const char* script) {
91 return Utils::OpenHandle( 92 return Utils::OpenHandle(
92 *v8::Script::Compile( 93 *v8::Script::Compile(
93 isolate->GetCurrentContext(), 94 isolate->GetCurrentContext(),
94 v8::String::NewFromUtf8(isolate, script, v8::NewStringType::kNormal) 95 v8::String::NewFromUtf8(isolate, script, v8::NewStringType::kNormal)
95 .ToLocalChecked()) 96 .ToLocalChecked())
96 .ToLocalChecked() 97 .ToLocalChecked()
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 semaphore.Wait(); 311 semaphore.Wait();
311 ASSERT_TRUE(job->FinalizeCompilingOnMainThread()); 312 ASSERT_TRUE(job->FinalizeCompilingOnMainThread());
312 ASSERT_TRUE(job->status() == CompileJobStatus::kDone); 313 ASSERT_TRUE(job->status() == CompileJobStatus::kDone);
313 314
314 job->ResetOnMainThread(); 315 job->ResetOnMainThread();
315 ASSERT_TRUE(job->status() == CompileJobStatus::kInitial); 316 ASSERT_TRUE(job->status() == CompileJobStatus::kInitial);
316 } 317 }
317 318
318 } // namespace internal 319 } // namespace internal
319 } // namespace v8 320 } // namespace v8
OLDNEW
« src/parsing/parser-base.h ('K') | « src/v8.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698