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

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

Issue 1384673002: The metadata part of TypeFeedbackVector is extracted to TypeFeedbackMetadata array. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup 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-inl.h ('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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 TEST(PropertyLoads) { 417 TEST(PropertyLoads) {
418 InitializedHandleScope handle_scope; 418 InitializedHandleScope handle_scope;
419 BytecodeGeneratorHelper helper; 419 BytecodeGeneratorHelper helper;
420 Zone zone; 420 Zone zone;
421 421
422 FeedbackVectorSpec feedback_spec(&zone); 422 FeedbackVectorSpec feedback_spec(&zone);
423 FeedbackVectorSlot slot1 = feedback_spec.AddLoadICSlot(); 423 FeedbackVectorSlot slot1 = feedback_spec.AddLoadICSlot();
424 FeedbackVectorSlot slot2 = feedback_spec.AddLoadICSlot(); 424 FeedbackVectorSlot slot2 = feedback_spec.AddLoadICSlot();
425 425
426 Handle<i::TypeFeedbackVector> vector = 426 Handle<i::TypeFeedbackVector> vector =
427 i::TypeFeedbackVector::New(helper.isolate(), &feedback_spec); 427 i::NewTypeFeedbackVector(helper.isolate(), &feedback_spec);
428 428
429 ExpectedSnippet<const char*> snippets[] = { 429 ExpectedSnippet<const char*> snippets[] = {
430 {"function f(a) { return a.name; }\nf({name : \"test\"})", 430 {"function f(a) { return a.name; }\nf({name : \"test\"})",
431 1 * kPointerSize, 431 1 * kPointerSize,
432 2, 432 2,
433 10, 433 10,
434 { 434 {
435 B(Ldar), R(helper.kLastParamIndex), // 435 B(Ldar), R(helper.kLastParamIndex), //
436 B(Star), R(0), // 436 B(Star), R(0), //
437 B(LdaConstant), U8(0), // 437 B(LdaConstant), U8(0), //
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 TEST(PropertyStores) { 507 TEST(PropertyStores) {
508 InitializedHandleScope handle_scope; 508 InitializedHandleScope handle_scope;
509 BytecodeGeneratorHelper helper; 509 BytecodeGeneratorHelper helper;
510 Zone zone; 510 Zone zone;
511 511
512 FeedbackVectorSpec feedback_spec(&zone); 512 FeedbackVectorSpec feedback_spec(&zone);
513 FeedbackVectorSlot slot1 = feedback_spec.AddStoreICSlot(); 513 FeedbackVectorSlot slot1 = feedback_spec.AddStoreICSlot();
514 FeedbackVectorSlot slot2 = feedback_spec.AddStoreICSlot(); 514 FeedbackVectorSlot slot2 = feedback_spec.AddStoreICSlot();
515 515
516 Handle<i::TypeFeedbackVector> vector = 516 Handle<i::TypeFeedbackVector> vector =
517 i::TypeFeedbackVector::New(helper.isolate(), &feedback_spec); 517 i::NewTypeFeedbackVector(helper.isolate(), &feedback_spec);
518 518
519 ExpectedSnippet<const char*> snippets[] = { 519 ExpectedSnippet<const char*> snippets[] = {
520 {"function f(a) { a.name = \"val\"; }\nf({name : \"test\"})", 520 {"function f(a) { a.name = \"val\"; }\nf({name : \"test\"})",
521 2 * kPointerSize, 521 2 * kPointerSize,
522 2, 522 2,
523 16, 523 16,
524 { 524 {
525 B(Ldar), R(helper.kLastParamIndex), // 525 B(Ldar), R(helper.kLastParamIndex), //
526 B(Star), R(0), // 526 B(Star), R(0), //
527 B(LdaConstant), U8(0), // 527 B(LdaConstant), U8(0), //
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 InitializedHandleScope handle_scope; 616 InitializedHandleScope handle_scope;
617 BytecodeGeneratorHelper helper; // 617 BytecodeGeneratorHelper helper; //
618 Zone zone; 618 Zone zone;
619 619
620 FeedbackVectorSpec feedback_spec(&zone); 620 FeedbackVectorSpec feedback_spec(&zone);
621 FeedbackVectorSlot slot1 = feedback_spec.AddLoadICSlot(); 621 FeedbackVectorSlot slot1 = feedback_spec.AddLoadICSlot();
622 FeedbackVectorSlot slot2 = feedback_spec.AddLoadICSlot(); 622 FeedbackVectorSlot slot2 = feedback_spec.AddLoadICSlot();
623 USE(slot1); 623 USE(slot1);
624 624
625 Handle<i::TypeFeedbackVector> vector = 625 Handle<i::TypeFeedbackVector> vector =
626 i::TypeFeedbackVector::New(helper.isolate(), &feedback_spec); 626 i::NewTypeFeedbackVector(helper.isolate(), &feedback_spec);
627 627
628 ExpectedSnippet<const char*> snippets[] = { 628 ExpectedSnippet<const char*> snippets[] = {
629 {"function f(a) { return a.func(); }\nf(" FUNC_ARG ")", 629 {"function f(a) { return a.func(); }\nf(" FUNC_ARG ")",
630 2 * kPointerSize, 630 2 * kPointerSize,
631 2, 631 2,
632 16, 632 16,
633 { 633 {
634 B(Ldar), R(helper.kLastParamIndex), // 634 B(Ldar), R(helper.kLastParamIndex), //
635 B(Star), R(1), // 635 B(Star), R(1), //
636 B(LdaConstant), U8(0), // 636 B(LdaConstant), U8(0), //
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1256 for (size_t i = 0; i < arraysize(snippets); i++) { 1256 for (size_t i = 0; i < arraysize(snippets); i++) {
1257 Handle<BytecodeArray> bytecode_array = 1257 Handle<BytecodeArray> bytecode_array =
1258 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); 1258 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet);
1259 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 1259 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
1260 } 1260 }
1261 } 1261 }
1262 1262
1263 } // namespace interpreter 1263 } // namespace interpreter
1264 } // namespace internal 1264 } // namespace internal
1265 } // namespace v8 1265 } // namespace v8
OLDNEW
« no previous file with comments | « src/type-feedback-vector-inl.h ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698