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

Side by Side Diff: test/cctest/test-api-accessors.cc

Issue 1588053002: Generalize 'fast accessor' tests to work with --always-opt. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | test/cctest/test-api-fast-accessor-builder.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 "test/cctest/cctest.h" 5 #include "test/cctest/cctest.h"
6 6
7 #include "include/v8.h" 7 #include "include/v8.h"
8 #include "include/v8-experimental.h" 8 #include "include/v8-experimental.h"
9 9
10 10
(...skipping 10 matching lines...) Expand all
21 21
22 22
23 v8::experimental::FastAccessorBuilder* FastAccessor(v8::Isolate* isolate) { 23 v8::experimental::FastAccessorBuilder* FastAccessor(v8::Isolate* isolate) {
24 auto builder = v8::experimental::FastAccessorBuilder::New(isolate); 24 auto builder = v8::experimental::FastAccessorBuilder::New(isolate);
25 builder->ReturnValue(builder->IntegerConstant(41)); 25 builder->ReturnValue(builder->IntegerConstant(41));
26 return builder; 26 return builder;
27 } 27 }
28 28
29 29
30 TEST(FastAccessors) { 30 TEST(FastAccessors) {
31 if (i::FLAG_always_opt) return;
32
33 v8::Isolate* isolate = CcTest::isolate(); 31 v8::Isolate* isolate = CcTest::isolate();
34 v8::HandleScope scope(isolate); 32 v8::HandleScope scope(isolate);
35 LocalContext env; 33 LocalContext env;
36 34
37 // We emulate Embedder-created DOM Node instances. Specifically: 35 // We emulate Embedder-created DOM Node instances. Specifically:
38 // - 'parent': FunctionTemplate ~= DOM Node superclass 36 // - 'parent': FunctionTemplate ~= DOM Node superclass
39 // - 'child': FunctionTemplate ~= a specific DOM node type, like a <div /> 37 // - 'child': FunctionTemplate ~= a specific DOM node type, like a <div />
40 // 38 //
41 // We'll install both a C++-based and a JS-based accessor on the parent, 39 // We'll install both a C++-based and a JS-based accessor on the parent,
42 // and expect it to be callable on the child. 40 // and expect it to be callable on the child.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 "var g = Object.getOwnPropertyDescriptor(" 104 "var g = Object.getOwnPropertyDescriptor("
107 " n.__proto__.__proto__, 'firstChildRaw')['get'];" 105 " n.__proto__.__proto__, 'firstChildRaw')['get'];"
108 "try {" 106 "try {"
109 " var f = { firstChildRaw: '51' };" 107 " var f = { firstChildRaw: '51' };"
110 " g.apply(f);" 108 " g.apply(f);"
111 "} catch(e) {" 109 "} catch(e) {"
112 " 31415;" 110 " 31415;"
113 "}", 111 "}",
114 31415); 112 31415);
115 } 113 }
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-api-fast-accessor-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698