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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "src/scanner-character-streams.h" | 24 #include "src/scanner-character-streams.h" |
25 #include "src/scopeinfo.h" | 25 #include "src/scopeinfo.h" |
26 #include "src/scopes.h" | 26 #include "src/scopes.h" |
27 #include "src/typing.h" | 27 #include "src/typing.h" |
28 #include "src/vm-state-inl.h" | 28 #include "src/vm-state-inl.h" |
29 | 29 |
30 namespace v8 { | 30 namespace v8 { |
31 namespace internal { | 31 namespace internal { |
32 | 32 |
33 | 33 |
| 34 ScriptData::ScriptData(const byte* data, int length) |
| 35 : owns_data_(false), data_(data), length_(length) { |
| 36 if (!IsAligned(reinterpret_cast<intptr_t>(data), kPointerAlignment)) { |
| 37 byte* copy = NewArray<byte>(length); |
| 38 ASSERT(IsAligned(reinterpret_cast<intptr_t>(data_), kPointerAlignment)); |
| 39 CopyBytes(copy, data, length); |
| 40 data_ = copy; |
| 41 AcquireDataOwnership(); |
| 42 } |
| 43 } |
| 44 |
| 45 |
34 CompilationInfo::CompilationInfo(Handle<Script> script, | 46 CompilationInfo::CompilationInfo(Handle<Script> script, |
35 Zone* zone) | 47 Zone* zone) |
36 : flags_(StrictModeField::encode(SLOPPY)), | 48 : flags_(StrictModeField::encode(SLOPPY)), |
37 script_(script), | 49 script_(script), |
38 osr_ast_id_(BailoutId::None()), | 50 osr_ast_id_(BailoutId::None()), |
39 parameter_count_(0), | 51 parameter_count_(0), |
40 this_has_uses_(true), | 52 this_has_uses_(true), |
41 optimization_id_(-1), | 53 optimization_id_(-1), |
42 ast_value_factory_(NULL), | 54 ast_value_factory_(NULL), |
43 ast_value_factory_owned_(false) { | 55 ast_value_factory_owned_(false) { |
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 AllowHandleDereference allow_deref; | 1336 AllowHandleDereference allow_deref; |
1325 bool tracing_on = info()->IsStub() | 1337 bool tracing_on = info()->IsStub() |
1326 ? FLAG_trace_hydrogen_stubs | 1338 ? FLAG_trace_hydrogen_stubs |
1327 : (FLAG_trace_hydrogen && | 1339 : (FLAG_trace_hydrogen && |
1328 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1340 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1329 return (tracing_on && | 1341 return (tracing_on && |
1330 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1342 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1331 } | 1343 } |
1332 | 1344 |
1333 } } // namespace v8::internal | 1345 } } // namespace v8::internal |
OLD | NEW |