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

Side by Side Diff: src/compiler.cc

Issue 724023002: Soft fail for invalid cache data. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: use flag to indicate rejection Created 6 years, 1 month 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
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 8
9 #include "src/ast-numbering.h" 9 #include "src/ast-numbering.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 16 matching lines...) Expand all
27 #include "src/scopeinfo.h" 27 #include "src/scopeinfo.h"
28 #include "src/scopes.h" 28 #include "src/scopes.h"
29 #include "src/typing.h" 29 #include "src/typing.h"
30 #include "src/vm-state-inl.h" 30 #include "src/vm-state-inl.h"
31 31
32 namespace v8 { 32 namespace v8 {
33 namespace internal { 33 namespace internal {
34 34
35 35
36 ScriptData::ScriptData(const byte* data, int length) 36 ScriptData::ScriptData(const byte* data, int length)
37 : owns_data_(false), data_(data), length_(length) { 37 : owns_data_(false), rejected_(false), data_(data), length_(length) {
38 if (!IsAligned(reinterpret_cast<intptr_t>(data), kPointerAlignment)) { 38 if (!IsAligned(reinterpret_cast<intptr_t>(data), kPointerAlignment)) {
39 byte* copy = NewArray<byte>(length); 39 byte* copy = NewArray<byte>(length);
40 DCHECK(IsAligned(reinterpret_cast<intptr_t>(copy), kPointerAlignment)); 40 DCHECK(IsAligned(reinterpret_cast<intptr_t>(copy), kPointerAlignment));
41 CopyBytes(copy, data, length); 41 CopyBytes(copy, data, length);
42 data_ = copy; 42 data_ = copy;
43 AcquireDataOwnership(); 43 AcquireDataOwnership();
44 } 44 }
45 } 45 }
46 46
47 47
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 AllowHandleDereference allow_deref; 1470 AllowHandleDereference allow_deref;
1471 bool tracing_on = info()->IsStub() 1471 bool tracing_on = info()->IsStub()
1472 ? FLAG_trace_hydrogen_stubs 1472 ? FLAG_trace_hydrogen_stubs
1473 : (FLAG_trace_hydrogen && 1473 : (FLAG_trace_hydrogen &&
1474 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); 1474 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter));
1475 return (tracing_on && 1475 return (tracing_on &&
1476 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); 1476 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL);
1477 } 1477 }
1478 1478
1479 } } // namespace v8::internal 1479 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.h ('k') | src/parser.h » ('j') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698