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

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

Issue 1376443002: Refactored interface of FeedbackVectorSpec and friends. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 5 years, 2 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/type-feedback-vector.cc ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | 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/compiler.h" 7 #include "src/compiler.h"
8 #include "src/interpreter/bytecode-array-iterator.h" 8 #include "src/interpreter/bytecode-array-iterator.h"
9 #include "src/interpreter/bytecode-generator.h" 9 #include "src/interpreter/bytecode-generator.h"
10 #include "src/interpreter/interpreter.h" 10 #include "src/interpreter/interpreter.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 } 387 }
388 } 388 }
389 389
390 390
391 TEST(PropertyLoads) { 391 TEST(PropertyLoads) {
392 InitializedHandleScope handle_scope; 392 InitializedHandleScope handle_scope;
393 BytecodeGeneratorHelper helper; 393 BytecodeGeneratorHelper helper;
394 394
395 FeedbackVectorSlotKind ic_kinds[] = {i::FeedbackVectorSlotKind::LOAD_IC, 395 FeedbackVectorSlotKind ic_kinds[] = {i::FeedbackVectorSlotKind::LOAD_IC,
396 i::FeedbackVectorSlotKind::LOAD_IC}; 396 i::FeedbackVectorSlotKind::LOAD_IC};
397 FeedbackVectorSpec feedback_spec(0, 2, ic_kinds); 397 StaticFeedbackVectorSpec feedback_spec(0, 2, ic_kinds);
398 Handle<i::TypeFeedbackVector> vector = 398 Handle<i::TypeFeedbackVector> vector =
399 helper.factory()->NewTypeFeedbackVector(&feedback_spec); 399 helper.factory()->NewTypeFeedbackVector(&feedback_spec);
400 400
401 ExpectedSnippet<const char*> snippets[] = { 401 ExpectedSnippet<const char*> snippets[] = {
402 {"function f(a) { return a.name; }\nf({name : \"test\"})", 402 {"function f(a) { return a.name; }\nf({name : \"test\"})",
403 1 * kPointerSize, 403 1 * kPointerSize,
404 2, 404 2,
405 10, 405 10,
406 { 406 {
407 B(Ldar), R(helper.kLastParamIndex), // 407 B(Ldar), R(helper.kLastParamIndex), //
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 } 475 }
476 } 476 }
477 477
478 478
479 TEST(PropertyStores) { 479 TEST(PropertyStores) {
480 InitializedHandleScope handle_scope; 480 InitializedHandleScope handle_scope;
481 BytecodeGeneratorHelper helper; 481 BytecodeGeneratorHelper helper;
482 482
483 FeedbackVectorSlotKind ic_kinds[] = {i::FeedbackVectorSlotKind::STORE_IC, 483 FeedbackVectorSlotKind ic_kinds[] = {i::FeedbackVectorSlotKind::STORE_IC,
484 i::FeedbackVectorSlotKind::STORE_IC}; 484 i::FeedbackVectorSlotKind::STORE_IC};
485 FeedbackVectorSpec feedback_spec(0, 2, ic_kinds); 485 StaticFeedbackVectorSpec feedback_spec(0, 2, ic_kinds);
486 Handle<i::TypeFeedbackVector> vector = 486 Handle<i::TypeFeedbackVector> vector =
487 helper.factory()->NewTypeFeedbackVector(&feedback_spec); 487 helper.factory()->NewTypeFeedbackVector(&feedback_spec);
488 488
489 ExpectedSnippet<const char*> snippets[] = { 489 ExpectedSnippet<const char*> snippets[] = {
490 {"function f(a) { a.name = \"val\"; }\nf({name : \"test\"})", 490 {"function f(a) { a.name = \"val\"; }\nf({name : \"test\"})",
491 2 * kPointerSize, 491 2 * kPointerSize,
492 2, 492 2,
493 16, 493 16,
494 { 494 {
495 B(Ldar), R(helper.kLastParamIndex), // 495 B(Ldar), R(helper.kLastParamIndex), //
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 581
582 #define FUNC_ARG "new (function Obj() { this.func = function() { return; }})()" 582 #define FUNC_ARG "new (function Obj() { this.func = function() { return; }})()"
583 583
584 584
585 TEST(PropertyCall) { 585 TEST(PropertyCall) {
586 InitializedHandleScope handle_scope; 586 InitializedHandleScope handle_scope;
587 BytecodeGeneratorHelper helper; // 587 BytecodeGeneratorHelper helper; //
588 588
589 FeedbackVectorSlotKind ic_kinds[] = {i::FeedbackVectorSlotKind::LOAD_IC, 589 FeedbackVectorSlotKind ic_kinds[] = {i::FeedbackVectorSlotKind::LOAD_IC,
590 i::FeedbackVectorSlotKind::LOAD_IC}; 590 i::FeedbackVectorSlotKind::LOAD_IC};
591 FeedbackVectorSpec feedback_spec(0, 2, ic_kinds); 591 StaticFeedbackVectorSpec feedback_spec(0, 2, ic_kinds);
592 Handle<i::TypeFeedbackVector> vector = 592 Handle<i::TypeFeedbackVector> vector =
593 helper.factory()->NewTypeFeedbackVector(&feedback_spec); 593 helper.factory()->NewTypeFeedbackVector(&feedback_spec);
594 594
595 ExpectedSnippet<const char*> snippets[] = { 595 ExpectedSnippet<const char*> snippets[] = {
596 {"function f(a) { return a.func(); }\nf(" FUNC_ARG ")", 596 {"function f(a) { return a.func(); }\nf(" FUNC_ARG ")",
597 2 * kPointerSize, 597 2 * kPointerSize,
598 2, 598 2,
599 16, 599 16,
600 { 600 {
601 B(Ldar), R(helper.kLastParamIndex), // 601 B(Ldar), R(helper.kLastParamIndex), //
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 Handle<BytecodeArray> bytecode_array = 874 Handle<BytecodeArray> bytecode_array =
875 helper.MakeBytecodeForFunction(snippets[i].code_snippet); 875 helper.MakeBytecodeForFunction(snippets[i].code_snippet);
876 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 876 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
877 } 877 }
878 } 878 }
879 879
880 880
881 } // namespace interpreter 881 } // namespace interpreter
882 } // namespace internal 882 } // namespace internal
883 } // namespance v8 883 } // namespance v8
OLDNEW
« no previous file with comments | « src/type-feedback-vector.cc ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698