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

Side by Side Diff: test/cctest/compiler/test-run-deopt.cc

Issue 1163803002: Cosmetic changes to tests to make it easier to concatenate them. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix snapshot-external.cc Created 5 years, 6 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 | « test/cctest/compiler/test-representation-change.cc ('k') | test/cctest/gay-fixed.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 "test/cctest/cctest.h" 7 #include "test/cctest/cctest.h"
8 #include "test/cctest/compiler/function-tester.h" 8 #include "test/cctest/compiler/function-tester.h"
9 9
10 using namespace v8;
11 using namespace v8::internal; 10 using namespace v8::internal;
12 using namespace v8::internal::compiler; 11 using namespace v8::internal::compiler;
13 12
14 #if V8_TURBOFAN_TARGET 13 #if V8_TURBOFAN_TARGET
15 14
16 static void IsOptimized(const FunctionCallbackInfo<v8::Value>& args) { 15 static void IsOptimized(const v8::FunctionCallbackInfo<v8::Value>& args) {
17 JavaScriptFrameIterator it(CcTest::i_isolate()); 16 JavaScriptFrameIterator it(CcTest::i_isolate());
18 JavaScriptFrame* frame = it.frame(); 17 JavaScriptFrame* frame = it.frame();
19 return args.GetReturnValue().Set(frame->is_optimized()); 18 return args.GetReturnValue().Set(frame->is_optimized());
20 } 19 }
21 20
22 21
23 static void InstallIsOptimizedHelper(v8::Isolate* isolate) { 22 static void InstallIsOptimizedHelper(v8::Isolate* isolate) {
24 Local<v8::Context> context = isolate->GetCurrentContext(); 23 v8::Local<v8::Context> context = isolate->GetCurrentContext();
25 Local<v8::FunctionTemplate> t = FunctionTemplate::New(isolate, IsOptimized); 24 v8::Local<v8::FunctionTemplate> t =
25 v8::FunctionTemplate::New(isolate, IsOptimized);
26 context->Global()->Set(v8_str("IsOptimized"), t->GetFunction()); 26 context->Global()->Set(v8_str("IsOptimized"), t->GetFunction());
27 } 27 }
28 28
29 29
30 TEST(TurboSimpleDeopt) { 30 TEST(TurboSimpleDeopt) {
31 FLAG_allow_natives_syntax = true; 31 FLAG_allow_natives_syntax = true;
32 32
33 FunctionTester T( 33 FunctionTester T(
34 "(function f(a) {" 34 "(function f(a) {"
35 "var b = 1;" 35 "var b = 1;"
(...skipping 28 matching lines...) Expand all
64 TEST(TurboTrivialDeopt) { 64 TEST(TurboTrivialDeopt) {
65 FLAG_allow_natives_syntax = true; 65 FLAG_allow_natives_syntax = true;
66 66
67 FunctionTester T( 67 FunctionTester T(
68 "(function foo() {" 68 "(function foo() {"
69 "%DeoptimizeFunction(foo);" 69 "%DeoptimizeFunction(foo);"
70 "return 1; })"); 70 "return 1; })");
71 71
72 T.CheckCall(T.Val(1)); 72 T.CheckCall(T.Val(1));
73 } 73 }
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-representation-change.cc ('k') | test/cctest/gay-fixed.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698