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

Side by Side Diff: test/cctest/asmjs/test-asm-typer.cc

Issue 2632123006: Reland: [Parse] ParseInfo owns the parsing Zone. (Closed)
Patch Set: Created 3 years, 11 months 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 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 <cstring> 5 #include <cstring>
6 #include <functional> 6 #include <functional>
7 #include <iostream> 7 #include <iostream>
8 #include <memory> 8 #include <memory>
9 9
10 #include "src/asmjs/asm-typer.h" 10 #include "src/asmjs/asm-typer.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 validation_type_(type), 46 validation_type_(type),
47 handles_(), 47 handles_(),
48 zone_(handles_.main_zone()), 48 zone_(handles_.main_zone()),
49 isolate_(CcTest::i_isolate()), 49 isolate_(CcTest::i_isolate()),
50 ast_value_factory_(zone_, isolate_->ast_string_constants(), 50 ast_value_factory_(zone_, isolate_->ast_string_constants(),
51 isolate_->heap()->HashSeed()), 51 isolate_->heap()->HashSeed()),
52 factory_(isolate_->factory()), 52 factory_(isolate_->factory()),
53 source_code_( 53 source_code_(
54 factory_->NewStringFromUtf8(CStrVector(source)).ToHandleChecked()), 54 factory_->NewStringFromUtf8(CStrVector(source)).ToHandleChecked()),
55 script_(factory_->NewScript(source_code_)) { 55 script_(factory_->NewScript(source_code_)) {
56 ParseInfo info(zone_, script_); 56 ParseInfo info(script_);
marja 2017/01/17 15:39:08 This is a bit weird. We'll create a Zone here, and
rmcilroy 2017/01/19 12:48:29 You are right and this was actually an issue. I re
57 info.set_allow_lazy_parsing(false); 57 info.set_allow_lazy_parsing(false);
58 info.set_toplevel(true); 58 info.set_toplevel(true);
59 info.set_ast_value_factory(&ast_value_factory_); 59 info.set_ast_value_factory(&ast_value_factory_);
60 info.set_ast_value_factory_owned(false); 60 info.set_ast_value_factory_owned(false);
61 Parser parser(&info); 61 Parser parser(&info);
62 62
63 if (!Compiler::ParseAndAnalyze(&info)) { 63 if (!Compiler::ParseAndAnalyze(&info)) {
64 std::cerr << "Failed to parse:\n" << source_ << "\n"; 64 std::cerr << "Failed to parse:\n" << source_ << "\n";
65 CHECK(false); 65 CHECK(false);
66 } 66 }
(...skipping 2010 matching lines...) Expand 10 before | Expand all | Expand 10 after
2077 if (!ValidationOf(Module(kTests[ii])) 2077 if (!ValidationOf(Module(kTests[ii]))
2078 ->FailsWithMessage( 2078 ->FailsWithMessage(
2079 "Constant in return must be signed, float, or double.")) { 2079 "Constant in return must be signed, float, or double.")) {
2080 std::cerr << "Test:\n" << kTests[ii]; 2080 std::cerr << "Test:\n" << kTests[ii];
2081 CHECK(false); 2081 CHECK(false);
2082 } 2082 }
2083 } 2083 }
2084 } 2084 }
2085 2085
2086 } // namespace 2086 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698