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

Side by Side Diff: src/compiler.cc

Issue 2381843002: Add Smi::Zero and replace all Smi::FromInt(0) calls (Closed)
Patch Set: Mark Smi::kZero as V8_EXPORT_PRIVATE Created 4 years, 2 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-stubs.cc ('k') | src/compiler/code-generator.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 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 #include <memory> 8 #include <memory>
9 9
10 #include "src/asmjs/asm-js.h" 10 #include "src/asmjs/asm-js.h"
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 } 1313 }
1314 1314
1315 MaybeHandle<JSArray> Compiler::CompileForLiveEdit(Handle<Script> script) { 1315 MaybeHandle<JSArray> Compiler::CompileForLiveEdit(Handle<Script> script) {
1316 Isolate* isolate = script->GetIsolate(); 1316 Isolate* isolate = script->GetIsolate();
1317 DCHECK(AllowCompilation::IsAllowed(isolate)); 1317 DCHECK(AllowCompilation::IsAllowed(isolate));
1318 1318
1319 // In order to ensure that live edit function info collection finds the newly 1319 // In order to ensure that live edit function info collection finds the newly
1320 // generated shared function infos, clear the script's list temporarily 1320 // generated shared function infos, clear the script's list temporarily
1321 // and restore it at the end of this method. 1321 // and restore it at the end of this method.
1322 Handle<Object> old_function_infos(script->shared_function_infos(), isolate); 1322 Handle<Object> old_function_infos(script->shared_function_infos(), isolate);
1323 script->set_shared_function_infos(Smi::FromInt(0)); 1323 script->set_shared_function_infos(Smi::kZero);
1324 1324
1325 // Start a compilation. 1325 // Start a compilation.
1326 Zone zone(isolate->allocator()); 1326 Zone zone(isolate->allocator());
1327 ParseInfo parse_info(&zone, script); 1327 ParseInfo parse_info(&zone, script);
1328 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); 1328 CompilationInfo info(&parse_info, Handle<JSFunction>::null());
1329 info.MarkAsDebug(); 1329 info.MarkAsDebug();
1330 1330
1331 // TODO(635): support extensions. 1331 // TODO(635): support extensions.
1332 const bool compilation_succeeded = !CompileToplevel(&info).is_null(); 1332 const bool compilation_succeeded = !CompileToplevel(&info).is_null();
1333 Handle<JSArray> infos; 1333 Handle<JSArray> infos;
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1888 DCHECK(shared->is_compiled()); 1888 DCHECK(shared->is_compiled());
1889 function->set_literals(cached.literals); 1889 function->set_literals(cached.literals);
1890 } else if (shared->is_compiled()) { 1890 } else if (shared->is_compiled()) {
1891 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. 1891 // TODO(mvstanton): pass pretenure flag to EnsureLiterals.
1892 JSFunction::EnsureLiterals(function); 1892 JSFunction::EnsureLiterals(function);
1893 } 1893 }
1894 } 1894 }
1895 1895
1896 } // namespace internal 1896 } // namespace internal
1897 } // namespace v8 1897 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/compiler/code-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698