OLD | NEW |
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 "src/snapshot/code-serializer.h" | 5 #include "src/snapshot/code-serializer.h" |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/log.h" | 8 #include "src/log.h" |
9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
10 #include "src/profiler/cpu-profiler.h" | 10 #include "src/profiler/cpu-profiler.h" |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 } | 234 } |
235 result->set_deserialized(true); | 235 result->set_deserialized(true); |
236 | 236 |
237 if (isolate->logger()->is_logging_code_events() || | 237 if (isolate->logger()->is_logging_code_events() || |
238 isolate->cpu_profiler()->is_profiling()) { | 238 isolate->cpu_profiler()->is_profiling()) { |
239 String* name = isolate->heap()->empty_string(); | 239 String* name = isolate->heap()->empty_string(); |
240 if (result->script()->IsScript()) { | 240 if (result->script()->IsScript()) { |
241 Script* script = Script::cast(result->script()); | 241 Script* script = Script::cast(result->script()); |
242 if (script->name()->IsString()) name = String::cast(script->name()); | 242 if (script->name()->IsString()) name = String::cast(script->name()); |
243 } | 243 } |
244 isolate->logger()->CodeCreateEvent( | 244 isolate->logger()->CodeCreateEvent(Logger::SCRIPT_TAG, |
245 Logger::SCRIPT_TAG, result->abstract_code(), *result, NULL, name); | 245 result->abstract_code(), *result, name); |
246 } | 246 } |
247 return scope.CloseAndEscape(result); | 247 return scope.CloseAndEscape(result); |
248 } | 248 } |
249 | 249 |
250 class Checksum { | 250 class Checksum { |
251 public: | 251 public: |
252 explicit Checksum(Vector<const byte> payload) { | 252 explicit Checksum(Vector<const byte> payload) { |
253 #ifdef MEMORY_SANITIZER | 253 #ifdef MEMORY_SANITIZER |
254 // Computing the checksum includes padding bytes for objects like strings. | 254 // Computing the checksum includes padding bytes for objects like strings. |
255 // Mark every object as initialized in the code serializer. | 255 // Mark every object as initialized in the code serializer. |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 SanityCheckResult r = scd->SanityCheck(isolate, source); | 406 SanityCheckResult r = scd->SanityCheck(isolate, source); |
407 if (r == CHECK_SUCCESS) return scd; | 407 if (r == CHECK_SUCCESS) return scd; |
408 cached_data->Reject(); | 408 cached_data->Reject(); |
409 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); | 409 source->GetIsolate()->counters()->code_cache_reject_reason()->AddSample(r); |
410 delete scd; | 410 delete scd; |
411 return NULL; | 411 return NULL; |
412 } | 412 } |
413 | 413 |
414 } // namespace internal | 414 } // namespace internal |
415 } // namespace v8 | 415 } // namespace v8 |
OLD | NEW |