| OLD | NEW |
| 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/asmjs/asm-js.h" | 9 #include "src/asmjs/asm-js.h" |
| 10 #include "src/asmjs/typing-asm.h" | 10 #include "src/asmjs/typing-asm.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 | 219 |
| 220 int CompilationInfo::GetDeclareGlobalsFlags() const { | 220 int CompilationInfo::GetDeclareGlobalsFlags() const { |
| 221 DCHECK(DeclareGlobalsLanguageMode::is_valid(parse_info()->language_mode())); | 221 DCHECK(DeclareGlobalsLanguageMode::is_valid(parse_info()->language_mode())); |
| 222 return DeclareGlobalsEvalFlag::encode(parse_info()->is_eval()) | | 222 return DeclareGlobalsEvalFlag::encode(parse_info()->is_eval()) | |
| 223 DeclareGlobalsNativeFlag::encode(parse_info()->is_native()) | | 223 DeclareGlobalsNativeFlag::encode(parse_info()->is_native()) | |
| 224 DeclareGlobalsLanguageMode::encode(parse_info()->language_mode()); | 224 DeclareGlobalsLanguageMode::encode(parse_info()->language_mode()); |
| 225 } | 225 } |
| 226 | 226 |
| 227 SourcePositionTableBuilder::RecordingMode |
| 228 CompilationInfo::SourcePositionRecordingMode() const { |
| 229 return parse_info() && parse_info()->is_native() |
| 230 ? SourcePositionTableBuilder::OMIT_SOURCE_POSITIONS |
| 231 : SourcePositionTableBuilder::RECORD_SOURCE_POSITIONS; |
| 232 } |
| 233 |
| 227 bool CompilationInfo::ExpectsJSReceiverAsReceiver() { | 234 bool CompilationInfo::ExpectsJSReceiverAsReceiver() { |
| 228 return is_sloppy(parse_info()->language_mode()) && !parse_info()->is_native(); | 235 return is_sloppy(parse_info()->language_mode()) && !parse_info()->is_native(); |
| 229 } | 236 } |
| 230 | 237 |
| 231 #if DEBUG | 238 #if DEBUG |
| 232 void CompilationInfo::PrintAstForTesting() { | 239 void CompilationInfo::PrintAstForTesting() { |
| 233 PrintF("--- Source from AST ---\n%s\n", | 240 PrintF("--- Source from AST ---\n%s\n", |
| 234 PrettyPrinter(isolate()).PrintProgram(literal())); | 241 PrettyPrinter(isolate()).PrintProgram(literal())); |
| 235 } | 242 } |
| 236 #endif | 243 #endif |
| (...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1825 DCHECK(shared->is_compiled()); | 1832 DCHECK(shared->is_compiled()); |
| 1826 function->set_literals(cached.literals); | 1833 function->set_literals(cached.literals); |
| 1827 } else if (shared->is_compiled()) { | 1834 } else if (shared->is_compiled()) { |
| 1828 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1835 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
| 1829 JSFunction::EnsureLiterals(function); | 1836 JSFunction::EnsureLiterals(function); |
| 1830 } | 1837 } |
| 1831 } | 1838 } |
| 1832 | 1839 |
| 1833 } // namespace internal | 1840 } // namespace internal |
| 1834 } // namespace v8 | 1841 } // namespace v8 |
| OLD | NEW |