| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "src/compiler/pipeline.h" | 7 #include "src/compiler/pipeline.h" |
| 8 #include "src/execution.h" | 8 #include "src/execution.h" |
| 9 #include "src/handles.h" | 9 #include "src/handles.h" |
| 10 #include "src/interpreter/bytecode-array-builder.h" | 10 #include "src/interpreter/bytecode-array-builder.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 | 64 |
| 65 class BytecodeGraphTester { | 65 class BytecodeGraphTester { |
| 66 public: | 66 public: |
| 67 BytecodeGraphTester(Isolate* isolate, Zone* zone, const char* script, | 67 BytecodeGraphTester(Isolate* isolate, Zone* zone, const char* script, |
| 68 const char* filter = kFunctionName) | 68 const char* filter = kFunctionName) |
| 69 : isolate_(isolate), zone_(zone), script_(script) { | 69 : isolate_(isolate), zone_(zone), script_(script) { |
| 70 i::FLAG_ignition = true; | 70 i::FLAG_ignition = true; |
| 71 i::FLAG_always_opt = false; | 71 i::FLAG_always_opt = false; |
| 72 i::FLAG_allow_natives_syntax = true; | 72 i::FLAG_allow_natives_syntax = true; |
| 73 i::FLAG_ignition_fallback_on_eval_and_catch = false; | 73 i::FLAG_ignition_fallback_on_catch = false; |
| 74 // Set ignition filter flag via SetFlagsFromString to avoid double-free | 74 // Set ignition filter flag via SetFlagsFromString to avoid double-free |
| 75 // (or potential leak with StrDup() based on ownership confusion). | 75 // (or potential leak with StrDup() based on ownership confusion). |
| 76 ScopedVector<char> ignition_filter(64); | 76 ScopedVector<char> ignition_filter(64); |
| 77 SNPrintF(ignition_filter, "--ignition-filter=%s", filter); | 77 SNPrintF(ignition_filter, "--ignition-filter=%s", filter); |
| 78 FlagList::SetFlagsFromString(ignition_filter.start(), | 78 FlagList::SetFlagsFromString(ignition_filter.start(), |
| 79 ignition_filter.length()); | 79 ignition_filter.length()); |
| 80 // Ensure handler table is generated. | 80 // Ensure handler table is generated. |
| 81 isolate->interpreter()->Initialize(); | 81 isolate->interpreter()->Initialize(); |
| 82 } | 82 } |
| 83 virtual ~BytecodeGraphTester() {} | 83 virtual ~BytecodeGraphTester() {} |
| (...skipping 2246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2330 callable(factory->NewNumberFromInt(a)).ToHandleChecked(); | 2330 callable(factory->NewNumberFromInt(a)).ToHandleChecked(); |
| 2331 static const int results[] = {11, 12, 2}; | 2331 static const int results[] = {11, 12, 2}; |
| 2332 CHECK_EQ(Handle<Smi>::cast(return_val)->value(), results[a]); | 2332 CHECK_EQ(Handle<Smi>::cast(return_val)->value(), results[a]); |
| 2333 } | 2333 } |
| 2334 } | 2334 } |
| 2335 } | 2335 } |
| 2336 | 2336 |
| 2337 } // namespace compiler | 2337 } // namespace compiler |
| 2338 } // namespace internal | 2338 } // namespace internal |
| 2339 } // namespace v8 | 2339 } // namespace v8 |
| OLD | NEW |