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

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

Issue 2337123003: [turbofan] Collect invocation counts and compute relative call frequencies. (Closed)
Patch Set: Address feedback. Created 4 years, 3 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 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/bytecode-array-iterator.h" 10 #include "src/interpreter/bytecode-array-iterator.h"
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 NewTypeFeedbackVector(isolate, &feedback_spec); 416 NewTypeFeedbackVector(isolate, &feedback_spec);
417 417
418 Register reg(0); 418 Register reg(0);
419 builder.LoadLiteral(test_cases[i].lhs) 419 builder.LoadLiteral(test_cases[i].lhs)
420 .StoreAccumulatorInRegister(reg) 420 .StoreAccumulatorInRegister(reg)
421 .LoadLiteral(test_cases[i].rhs) 421 .LoadLiteral(test_cases[i].rhs)
422 .BinaryOperation(Token::Value::ADD, reg, vector->GetIndex(slot)) 422 .BinaryOperation(Token::Value::ADD, reg, vector->GetIndex(slot))
423 .Return(); 423 .Return();
424 Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(isolate); 424 Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray(isolate);
425 425
426 InterpreterTester tester(isolate, bytecode_array); 426 InterpreterTester tester(isolate, bytecode_array, vector);
427 auto callable = tester.GetCallable<>(); 427 auto callable = tester.GetCallable<>();
428 Handle<Object> return_value = callable().ToHandleChecked(); 428 Handle<Object> return_value = callable().ToHandleChecked();
429 CHECK(return_value->SameValue(*test_cases[i].expected_value)); 429 CHECK(return_value->SameValue(*test_cases[i].expected_value));
430 } 430 }
431 } 431 }
432 432
433 433
434 TEST(InterpreterParameter1) { 434 TEST(InterpreterParameter1) {
435 HandleAndZoneScope handles; 435 HandleAndZoneScope handles;
436 Isolate* isolate = handles.main_isolate(); 436 Isolate* isolate = handles.main_isolate();
(...skipping 4284 matching lines...) Expand 10 before | Expand all | Expand 10 after
4721 auto callable = tester.GetCallable<>(); 4721 auto callable = tester.GetCallable<>();
4722 4722
4723 Handle<i::Object> return_value = callable().ToHandleChecked(); 4723 Handle<i::Object> return_value = callable().ToHandleChecked();
4724 CHECK(return_value->SameValue(*tests[i].second)); 4724 CHECK(return_value->SameValue(*tests[i].second));
4725 } 4725 }
4726 } 4726 }
4727 4727
4728 } // namespace interpreter 4728 } // namespace interpreter
4729 } // namespace internal 4729 } // namespace internal
4730 } // namespace v8 4730 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/WideRegisters.golden ('k') | test/cctest/test-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698