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

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

Issue 1402943002: [Interpreter] Support for operator new. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate review comments on patch sets 2 and 3. 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
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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 B(Call), R(0), R(1), U8(2), // 904 B(Call), R(0), R(1), U8(2), //
905 B(Return) // 905 B(Return) //
906 }, 906 },
907 1, 907 1,
908 {"func"}}, 908 {"func"}},
909 {"function f(a, b) { return a.func(b + b, b); }\nf(" FUNC_ARG ", 1)", 909 {"function f(a, b) { return a.func(b + b, b); }\nf(" FUNC_ARG ", 1)",
910 4 * kPointerSize, 910 4 * kPointerSize,
911 3, 911 3,
912 30, 912 30,
913 { 913 {
914 B(Ldar), R(helper.kLastParamIndex - 1), // 914 B(Ldar), R(helper.kLastParamIndex - 1), //
915 B(Star), R(1), // 915 B(Star), R(1), //
916 B(LdaConstant), U8(0), // 916 B(LdaConstant), U8(0), //
917 B(LoadICSloppy), R(1), U8(vector->GetIndex(slot2)), // 917 B(LoadICSloppy), R(1), U8(5), //
rmcilroy 2015/10/14 10:18:35 please use vector->GetIndex(...) here
oth 2015/10/14 16:02:19 Done.
918 B(Star), R(0), // 918 B(Star), R(0), //
919 B(Ldar), R(helper.kLastParamIndex), // 919 B(Ldar), R(helper.kLastParamIndex), //
920 B(Star), R(2), // 920 B(Star), R(3), //
921 B(Ldar), R(helper.kLastParamIndex), // 921 B(Ldar), R(helper.kLastParamIndex), //
922 B(Add), R(2), // 922 B(Add), R(3), //
923 B(Star), R(2), // 923 B(Star), R(2), //
924 B(Ldar), R(helper.kLastParamIndex), // 924 B(Ldar), R(helper.kLastParamIndex), //
925 B(Star), R(3), // 925 B(Star), R(3), //
926 B(Call), R(0), R(1), U8(2), // 926 B(Call), R(0), R(1), U8(2), //
927 B(Return) // 927 B(Return), //
928 }, 928 },
929 1, 929 1,
930 {"func"}}}; 930 {"func"}}};
931 for (size_t i = 0; i < arraysize(snippets); i++) { 931 for (size_t i = 0; i < arraysize(snippets); i++) {
932 Handle<BytecodeArray> bytecode_array = 932 Handle<BytecodeArray> bytecode_array =
933 helper.MakeBytecode(snippets[i].code_snippet, helper.kFunctionName); 933 helper.MakeBytecode(snippets[i].code_snippet, helper.kFunctionName);
934 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 934 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
935 } 935 }
936 } 936 }
937 937
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
1867 1, 1867 1,
1868 {InstanceType::SHARED_FUNCTION_INFO_TYPE}}, 1868 {InstanceType::SHARED_FUNCTION_INFO_TYPE}},
1869 }; 1869 };
1870 1870
1871 for (size_t i = 0; i < arraysize(snippets); i++) { 1871 for (size_t i = 0; i < arraysize(snippets); i++) {
1872 Handle<BytecodeArray> bytecode_array = 1872 Handle<BytecodeArray> bytecode_array =
1873 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); 1873 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet);
1874 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 1874 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
1875 } 1875 }
1876 } 1876 }
1877 1877
rmcilroy 2015/10/14 10:18:35 Still hoping for a BytecodeGenerator test for new
oth 2015/10/14 16:02:19 Done!
1878 } // namespace interpreter 1878 } // namespace interpreter
1879 } // namespace internal 1879 } // namespace internal
1880 } // namespace v8 1880 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698