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

Side by Side Diff: test/cctest/interpreter/test-interpreter.cc

Issue 1278413002: [interpreter] Fix nosnap build for interpreter table generation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove create_heap_objects Created 5 years, 4 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
« no previous file with comments | « src/isolate.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/execution.h" 7 #include "src/execution.h"
8 #include "src/handles.h" 8 #include "src/handles.h"
9 #include "src/interpreter/bytecode-array-builder.h" 9 #include "src/interpreter/bytecode-array-builder.h"
10 #include "src/interpreter/interpreter.h" 10 #include "src/interpreter/interpreter.h"
(...skipping 17 matching lines...) Expand all
28 private: 28 private:
29 Isolate* isolate_; 29 Isolate* isolate_;
30 Handle<JSFunction> function_; 30 Handle<JSFunction> function_;
31 }; 31 };
32 32
33 class InterpreterTester { 33 class InterpreterTester {
34 public: 34 public:
35 InterpreterTester(Isolate* isolate, Handle<BytecodeArray> bytecode) 35 InterpreterTester(Isolate* isolate, Handle<BytecodeArray> bytecode)
36 : isolate_(isolate), function_(GetBytecodeFunction(isolate, bytecode)) { 36 : isolate_(isolate), function_(GetBytecodeFunction(isolate, bytecode)) {
37 i::FLAG_ignition = true; 37 i::FLAG_ignition = true;
38 Handle<FixedArray> empty_array = isolate->factory()->empty_fixed_array(); 38 // Ensure handler table is generated.
39 Handle<FixedArray> interpreter_table = 39 isolate->interpreter()->Initialize();
40 isolate->factory()->interpreter_table();
41 if (interpreter_table.is_identical_to(empty_array)) {
42 // Ensure handler table is generated.
43 isolate->interpreter()->Initialize(true);
44 }
45 } 40 }
46 virtual ~InterpreterTester() {} 41 virtual ~InterpreterTester() {}
47 42
48 InterpreterCallable GetCallable() { 43 InterpreterCallable GetCallable() {
49 return InterpreterCallable(isolate_, function_); 44 return InterpreterCallable(isolate_, function_);
50 } 45 }
51 46
52 private: 47 private:
53 Isolate* isolate_; 48 Isolate* isolate_;
54 Handle<JSFunction> function_; 49 Handle<JSFunction> function_;
(...skipping 26 matching lines...) Expand all
81 // register file. 76 // register file.
82 builder.set_locals_count(1); 77 builder.set_locals_count(1);
83 builder.Return(); 78 builder.Return();
84 Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(); 79 Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray();
85 80
86 InterpreterTester tester(handles.main_isolate(), bytecode_array); 81 InterpreterTester tester(handles.main_isolate(), bytecode_array);
87 InterpreterCallable callable(tester.GetCallable()); 82 InterpreterCallable callable(tester.GetCallable());
88 Handle<Object> return_val = callable().ToHandleChecked(); 83 Handle<Object> return_val = callable().ToHandleChecked();
89 CHECK(return_val.is_identical_to(undefined_value)); 84 CHECK(return_val.is_identical_to(undefined_value));
90 } 85 }
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698