v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
test-assembler-ia32.cc
Go to the documentation of this file.
1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #include <stdlib.h>
29 
30 #include "v8.h"
31 
32 #include "disassembler.h"
33 #include "factory.h"
34 #include "macro-assembler.h"
35 #include "platform.h"
36 #include "serialize.h"
37 #include "cctest.h"
38 
39 using namespace v8::internal;
40 
41 
42 typedef int (*F0)();
43 typedef int (*F1)(int x);
44 typedef int (*F2)(int x, int y);
45 
46 
47 #define __ assm.
48 
49 TEST(AssemblerIa320) {
51  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
52  HandleScope scope(isolate);
53 
54  v8::internal::byte buffer[256];
55  Assembler assm(isolate, buffer, sizeof buffer);
56 
57  __ mov(eax, Operand(esp, 4));
58  __ add(eax, Operand(esp, 8));
59  __ ret(0);
60 
61  CodeDesc desc;
62  assm.GetCode(&desc);
63  Object* code = isolate->heap()->CreateCode(
64  desc,
66  Handle<Code>())->ToObjectChecked();
67  CHECK(code->IsCode());
68 #ifdef OBJECT_PRINT
69  Code::cast(code)->Print();
70 #endif
71  F2 f = FUNCTION_CAST<F2>(Code::cast(code)->entry());
72  int res = f(3, 4);
73  ::printf("f() = %d\n", res);
74  CHECK_EQ(7, res);
75 }
76 
77 
78 TEST(AssemblerIa321) {
80  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
81  HandleScope scope(isolate);
82 
83  v8::internal::byte buffer[256];
84  Assembler assm(isolate, buffer, sizeof buffer);
85  Label L, C;
86 
87  __ mov(edx, Operand(esp, 4));
88  __ xor_(eax, eax); // clear eax
89  __ jmp(&C);
90 
91  __ bind(&L);
92  __ add(eax, edx);
93  __ sub(edx, Immediate(1));
94 
95  __ bind(&C);
96  __ test(edx, edx);
97  __ j(not_zero, &L);
98  __ ret(0);
99 
100  CodeDesc desc;
101  assm.GetCode(&desc);
102  Object* code = isolate->heap()->CreateCode(
103  desc,
105  Handle<Code>())->ToObjectChecked();
106  CHECK(code->IsCode());
107 #ifdef OBJECT_PRINT
108  Code::cast(code)->Print();
109 #endif
110  F1 f = FUNCTION_CAST<F1>(Code::cast(code)->entry());
111  int res = f(100);
112  ::printf("f() = %d\n", res);
113  CHECK_EQ(5050, res);
114 }
115 
116 
117 TEST(AssemblerIa322) {
119  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
120  HandleScope scope(isolate);
121 
122  v8::internal::byte buffer[256];
123  Assembler assm(isolate, buffer, sizeof buffer);
124  Label L, C;
125 
126  __ mov(edx, Operand(esp, 4));
127  __ mov(eax, 1);
128  __ jmp(&C);
129 
130  __ bind(&L);
131  __ imul(eax, edx);
132  __ sub(edx, Immediate(1));
133 
134  __ bind(&C);
135  __ test(edx, edx);
136  __ j(not_zero, &L);
137  __ ret(0);
138 
139  // some relocated stuff here, not executed
140  __ mov(eax, isolate->factory()->true_value());
142 
143  CodeDesc desc;
144  assm.GetCode(&desc);
145  Object* code = isolate->heap()->CreateCode(
146  desc,
148  Handle<Code>())->ToObjectChecked();
149  CHECK(code->IsCode());
150 #ifdef OBJECT_PRINT
151  Code::cast(code)->Print();
152 #endif
153  F1 f = FUNCTION_CAST<F1>(Code::cast(code)->entry());
154  int res = f(10);
155  ::printf("f() = %d\n", res);
156  CHECK_EQ(3628800, res);
157 }
158 
159 
160 typedef int (*F3)(float x);
161 
162 TEST(AssemblerIa323) {
164  if (!CpuFeatures::IsSupported(SSE2)) return;
165 
166  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
167  HandleScope scope(isolate);
168 
169  v8::internal::byte buffer[256];
170  Assembler assm(isolate, buffer, sizeof buffer);
171 
173  { CpuFeatureScope fscope(&assm, SSE2);
174  __ cvttss2si(eax, Operand(esp, 4));
175  __ ret(0);
176  }
177 
178  CodeDesc desc;
179  assm.GetCode(&desc);
180  Code* code = Code::cast(isolate->heap()->CreateCode(
181  desc,
183  Handle<Code>())->ToObjectChecked());
184  // don't print the code - our disassembler can't handle cvttss2si
185  // instead print bytes
186  Disassembler::Dump(stdout,
187  code->instruction_start(),
188  code->instruction_start() + code->instruction_size());
189  F3 f = FUNCTION_CAST<F3>(code->entry());
190  int res = f(static_cast<float>(-3.1415));
191  ::printf("f() = %d\n", res);
192  CHECK_EQ(-3, res);
193 }
194 
195 
196 typedef int (*F4)(double x);
197 
198 TEST(AssemblerIa324) {
200  if (!CpuFeatures::IsSupported(SSE2)) return;
201 
202  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
203  HandleScope scope(isolate);
204 
205  v8::internal::byte buffer[256];
206  Assembler assm(isolate, buffer, sizeof buffer);
207 
209  CpuFeatureScope fscope(&assm, SSE2);
210  __ cvttsd2si(eax, Operand(esp, 4));
211  __ ret(0);
212 
213  CodeDesc desc;
214  assm.GetCode(&desc);
215  Code* code = Code::cast(isolate->heap()->CreateCode(
216  desc,
218  Handle<Code>())->ToObjectChecked());
219  // don't print the code - our disassembler can't handle cvttsd2si
220  // instead print bytes
221  Disassembler::Dump(stdout,
222  code->instruction_start(),
223  code->instruction_start() + code->instruction_size());
224  F4 f = FUNCTION_CAST<F4>(code->entry());
225  int res = f(2.718281828);
226  ::printf("f() = %d\n", res);
227  CHECK_EQ(2, res);
228 }
229 
230 
231 static int baz = 42;
232 TEST(AssemblerIa325) {
234  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
235  HandleScope scope(isolate);
236 
237  v8::internal::byte buffer[256];
238  Assembler assm(isolate, buffer, sizeof buffer);
239 
240  __ mov(eax, Operand(reinterpret_cast<intptr_t>(&baz), RelocInfo::NONE32));
241  __ ret(0);
242 
243  CodeDesc desc;
244  assm.GetCode(&desc);
245  Code* code = Code::cast(isolate->heap()->CreateCode(
246  desc,
248  Handle<Code>())->ToObjectChecked());
249  F0 f = FUNCTION_CAST<F0>(code->entry());
250  int res = f();
251  CHECK_EQ(42, res);
252 }
253 
254 
255 typedef double (*F5)(double x, double y);
256 
257 TEST(AssemblerIa326) {
259  if (!CpuFeatures::IsSupported(SSE2)) return;
260 
261  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
262  HandleScope scope(isolate);
263  v8::internal::byte buffer[256];
264  Assembler assm(isolate, buffer, sizeof buffer);
265 
266  CpuFeatureScope fscope(&assm, SSE2);
267  __ movsd(xmm0, Operand(esp, 1 * kPointerSize));
268  __ movsd(xmm1, Operand(esp, 3 * kPointerSize));
269  __ addsd(xmm0, xmm1);
270  __ mulsd(xmm0, xmm1);
271  __ subsd(xmm0, xmm1);
272  __ divsd(xmm0, xmm1);
273  // Copy xmm0 to st(0) using eight bytes of stack.
274  __ sub(esp, Immediate(8));
275  __ movsd(Operand(esp, 0), xmm0);
276  __ fld_d(Operand(esp, 0));
277  __ add(esp, Immediate(8));
278  __ ret(0);
279 
280  CodeDesc desc;
281  assm.GetCode(&desc);
282  Code* code = Code::cast(isolate->heap()->CreateCode(
283  desc,
285  Handle<Code>())->ToObjectChecked());
286 #ifdef DEBUG
287  ::printf("\n---\n");
288  // don't print the code - our disassembler can't handle SSE instructions
289  // instead print bytes
290  Disassembler::Dump(stdout,
291  code->instruction_start(),
292  code->instruction_start() + code->instruction_size());
293 #endif
294  F5 f = FUNCTION_CAST<F5>(code->entry());
295  double res = f(2.2, 1.1);
296  ::printf("f() = %f\n", res);
297  CHECK(2.29 < res && res < 2.31);
298 }
299 
300 
301 typedef double (*F6)(int x);
302 
303 TEST(AssemblerIa328) {
305  if (!CpuFeatures::IsSupported(SSE2)) return;
306 
307  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
308  HandleScope scope(isolate);
309  v8::internal::byte buffer[256];
310  Assembler assm(isolate, buffer, sizeof buffer);
311  CpuFeatureScope fscope(&assm, SSE2);
312  __ mov(eax, Operand(esp, 4));
313  __ cvtsi2sd(xmm0, eax);
314  // Copy xmm0 to st(0) using eight bytes of stack.
315  __ sub(esp, Immediate(8));
316  __ movsd(Operand(esp, 0), xmm0);
317  __ fld_d(Operand(esp, 0));
318  __ add(esp, Immediate(8));
319  __ ret(0);
320  CodeDesc desc;
321  assm.GetCode(&desc);
322  Code* code = Code::cast(isolate->heap()->CreateCode(
323  desc,
325  Handle<Code>())->ToObjectChecked());
326  CHECK(code->IsCode());
327 #ifdef OBJECT_PRINT
328  Code::cast(code)->Print();
329 #endif
330  F6 f = FUNCTION_CAST<F6>(Code::cast(code)->entry());
331  double res = f(12);
332 
333  ::printf("f() = %f\n", res);
334  CHECK(11.99 < res && res < 12.001);
335 }
336 
337 
338 typedef int (*F7)(double x, double y);
339 
340 TEST(AssemblerIa329) {
342  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
343  HandleScope scope(isolate);
344  v8::internal::byte buffer[256];
345  MacroAssembler assm(isolate, buffer, sizeof buffer);
346  enum { kEqual = 0, kGreater = 1, kLess = 2, kNaN = 3, kUndefined = 4 };
347  Label equal_l, less_l, greater_l, nan_l;
348  __ fld_d(Operand(esp, 3 * kPointerSize));
349  __ fld_d(Operand(esp, 1 * kPointerSize));
350  __ FCmp();
351  __ j(parity_even, &nan_l);
352  __ j(equal, &equal_l);
353  __ j(below, &less_l);
354  __ j(above, &greater_l);
355 
356  __ mov(eax, kUndefined);
357  __ ret(0);
358 
359  __ bind(&equal_l);
360  __ mov(eax, kEqual);
361  __ ret(0);
362 
363  __ bind(&greater_l);
364  __ mov(eax, kGreater);
365  __ ret(0);
366 
367  __ bind(&less_l);
368  __ mov(eax, kLess);
369  __ ret(0);
370 
371  __ bind(&nan_l);
372  __ mov(eax, kNaN);
373  __ ret(0);
374 
375 
376  CodeDesc desc;
377  assm.GetCode(&desc);
378  Code* code = Code::cast(isolate->heap()->CreateCode(
379  desc,
381  Handle<Code>())->ToObjectChecked());
382  CHECK(code->IsCode());
383 #ifdef OBJECT_PRINT
384  Code::cast(code)->Print();
385 #endif
386 
387  F7 f = FUNCTION_CAST<F7>(Code::cast(code)->entry());
388  CHECK_EQ(kLess, f(1.1, 2.2));
389  CHECK_EQ(kEqual, f(2.2, 2.2));
390  CHECK_EQ(kGreater, f(3.3, 2.2));
391  CHECK_EQ(kNaN, f(OS::nan_value(), 1.1));
392 }
393 
394 
395 TEST(AssemblerIa3210) {
396  // Test chaining of label usages within instructions (issue 1644).
398  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
399  HandleScope scope(isolate);
400  Assembler assm(isolate, NULL, 0);
401 
402  Label target;
403  __ j(equal, &target);
404  __ j(not_equal, &target);
405  __ bind(&target);
406  __ nop();
407 }
408 
409 
410 TEST(AssemblerMultiByteNop) {
412  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
413  HandleScope scope(isolate);
414  v8::internal::byte buffer[1024];
415  Assembler assm(isolate, buffer, sizeof(buffer));
416  __ push(ebx);
417  __ push(ecx);
418  __ push(edx);
419  __ push(edi);
420  __ push(esi);
421  __ mov(eax, 1);
422  __ mov(ebx, 2);
423  __ mov(ecx, 3);
424  __ mov(edx, 4);
425  __ mov(edi, 5);
426  __ mov(esi, 6);
427  for (int i = 0; i < 16; i++) {
428  int before = assm.pc_offset();
429  __ Nop(i);
430  CHECK_EQ(assm.pc_offset() - before, i);
431  }
432 
433  Label fail;
434  __ cmp(eax, 1);
435  __ j(not_equal, &fail);
436  __ cmp(ebx, 2);
437  __ j(not_equal, &fail);
438  __ cmp(ecx, 3);
439  __ j(not_equal, &fail);
440  __ cmp(edx, 4);
441  __ j(not_equal, &fail);
442  __ cmp(edi, 5);
443  __ j(not_equal, &fail);
444  __ cmp(esi, 6);
445  __ j(not_equal, &fail);
446  __ mov(eax, 42);
447  __ pop(esi);
448  __ pop(edi);
449  __ pop(edx);
450  __ pop(ecx);
451  __ pop(ebx);
452  __ ret(0);
453  __ bind(&fail);
454  __ mov(eax, 13);
455  __ pop(esi);
456  __ pop(edi);
457  __ pop(edx);
458  __ pop(ecx);
459  __ pop(ebx);
460  __ ret(0);
461 
462  CodeDesc desc;
463  assm.GetCode(&desc);
464  Code* code = Code::cast(isolate->heap()->CreateCode(
465  desc,
467  Handle<Code>())->ToObjectChecked());
468  CHECK(code->IsCode());
469 
470  F0 f = FUNCTION_CAST<F0>(code->entry());
471  int res = f();
472  CHECK_EQ(42, res);
473 }
474 
475 
476 #ifdef __GNUC__
477 #define ELEMENT_COUNT 4
478 
479 void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& args) {
480  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
481  HandleScope scope(isolate);
482 
483  CHECK(args[0]->IsArray());
485  CHECK_EQ(ELEMENT_COUNT, vec->Length());
486 
487  v8::internal::byte buffer[256];
488  Assembler assm(isolate, buffer, sizeof buffer);
489 
491  CpuFeatureScope fscope(&assm, SSE2);
492 
493  // Remove return address from the stack for fix stack frame alignment.
494  __ pop(ecx);
495 
496  // Store input vector on the stack.
497  for (int i = 0; i < ELEMENT_COUNT; ++i) {
498  __ push(Immediate(vec->Get(i)->Int32Value()));
499  }
500 
501  // Read vector into a xmm register.
502  __ pxor(xmm0, xmm0);
503  __ movdqa(xmm0, Operand(esp, 0));
504  // Create mask and store it in the return register.
505  __ movmskps(eax, xmm0);
506 
507  // Remove unused data from the stack.
508  __ add(esp, Immediate(ELEMENT_COUNT * sizeof(int32_t)));
509  // Restore return address.
510  __ push(ecx);
511 
512  __ ret(0);
513 
514  CodeDesc desc;
515  assm.GetCode(&desc);
516 
517  Object* code = isolate->heap()->CreateCode(
518  desc,
520  Handle<Code>())->ToObjectChecked();
521  CHECK(code->IsCode());
522 
523  F0 f = FUNCTION_CAST<F0>(Code::cast(code)->entry());
524  int res = f();
525  args.GetReturnValue().Set(v8::Integer::New(CcTest::isolate(), res));
526 }
527 
528 
529 TEST(StackAlignmentForSSE2) {
531  if (!CpuFeatures::IsSupported(SSE2)) return;
532 
534 
535  v8::Isolate* isolate = CcTest::isolate();
536  v8::HandleScope handle_scope(isolate);
537  v8::Handle<v8::ObjectTemplate> global_template =
538  v8::ObjectTemplate::New(isolate);
539  global_template->Set(v8_str("do_sse2"),
540  v8::FunctionTemplate::New(isolate, DoSSE2));
541 
542  LocalContext env(NULL, global_template);
543  CompileRun(
544  "function foo(vec) {"
545  " return do_sse2(vec);"
546  "}");
547 
548  v8::Local<v8::Object> global_object = env->Global();
550  v8::Local<v8::Function>::Cast(global_object->Get(v8_str("foo")));
551 
552  int32_t vec[ELEMENT_COUNT] = { -1, 1, 1, 1 };
553  v8::Local<v8::Array> v8_vec = v8::Array::New(isolate, ELEMENT_COUNT);
554  for (int i = 0; i < ELEMENT_COUNT; i++) {
555  v8_vec->Set(i, v8_num(vec[i]));
556  }
557 
558  v8::Local<v8::Value> args[] = { v8_vec };
559  v8::Local<v8::Value> result = foo->Call(global_object, 1, args);
560 
561  // The mask should be 0b1000.
562  CHECK_EQ(8, result->Int32Value());
563 }
564 
565 #undef ELEMENT_COUNT
566 #endif // __GNUC__
567 
568 
569 TEST(AssemblerIa32Extractps) {
573 
574  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
575  HandleScope scope(isolate);
576  v8::internal::byte buffer[256];
577  MacroAssembler assm(isolate, buffer, sizeof buffer);
578  { CpuFeatureScope fscope2(&assm, SSE2);
579  CpuFeatureScope fscope41(&assm, SSE4_1);
580  __ movsd(xmm1, Operand(esp, 4));
581  __ extractps(eax, xmm1, 0x1);
582  __ ret(0);
583  }
584 
585  CodeDesc desc;
586  assm.GetCode(&desc);
587  Code* code = Code::cast(isolate->heap()->CreateCode(
588  desc,
590  Handle<Code>())->ToObjectChecked());
591  CHECK(code->IsCode());
592 #ifdef OBJECT_PRINT
593  Code::cast(code)->Print();
594 #endif
595 
596  F4 f = FUNCTION_CAST<F4>(Code::cast(code)->entry());
597  uint64_t value1 = V8_2PART_UINT64_C(0x12345678, 87654321);
598  CHECK_EQ(0x12345678, f(uint64_to_double(value1)));
599  uint64_t value2 = V8_2PART_UINT64_C(0x87654321, 12345678);
600  CHECK_EQ(0x87654321, f(uint64_to_double(value2)));
601 }
602 
603 
604 typedef int (*F8)(float x, float y);
605 TEST(AssemblerIa32SSE) {
607  if (!CpuFeatures::IsSupported(SSE2)) return;
608 
609  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
610  HandleScope scope(isolate);
611  v8::internal::byte buffer[256];
612  MacroAssembler assm(isolate, buffer, sizeof buffer);
613  {
614  CpuFeatureScope fscope(&assm, SSE2);
615  __ movss(xmm0, Operand(esp, kPointerSize));
616  __ movss(xmm1, Operand(esp, 2 * kPointerSize));
617  __ shufps(xmm0, xmm0, 0x0);
618  __ shufps(xmm1, xmm1, 0x0);
619  __ movaps(xmm2, xmm1);
620  __ addps(xmm2, xmm0);
621  __ mulps(xmm2, xmm1);
622  __ subps(xmm2, xmm0);
623  __ divps(xmm2, xmm1);
624  __ cvttss2si(eax, xmm2);
625  __ ret(0);
626  }
627 
628  CodeDesc desc;
629  assm.GetCode(&desc);
630  Code* code = Code::cast(isolate->heap()->CreateCode(
631  desc,
633  Handle<Code>())->ToObjectChecked());
634  CHECK(code->IsCode());
635 #ifdef OBJECT_PRINT
636  Code::cast(code)->Print();
637 #endif
638 
639  F8 f = FUNCTION_CAST<F8>(Code::cast(code)->entry());
640  CHECK_EQ(2, f(1.0, 2.0));
641 }
642 
643 
644 #undef __
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
Definition: flags.cc:269
int(* F3)(float x)
#define __
#define CHECK_EQ(expected, value)
Definition: checks.h:252
Local< Value > Call(Handle< Value > recv, int argc, Handle< Value > argv[])
Definition: api.cc:3996
Local< Value > Get(Handle< Value > key)
Definition: api.cc:3139
V8_INLINE ReturnValue< T > GetReturnValue() const
Definition: v8.h:6067
const Register esp
int int32_t
Definition: unicode.cc:47
static bool IsSupported(CpuFeature f)
Definition: assembler-arm.h:68
#define ASSERT(condition)
Definition: checks.h:329
static Local< Integer > New(Isolate *isolate, int32_t value)
Definition: api.cc:6233
int(* F8)(float x, float y)
#define CHECK(condition)
Definition: checks.h:75
void Set(Handle< String > name, Handle< Data > value, PropertyAttribute attributes=None)
Definition: api.cc:841
int(* F1)(int x)
Factory * factory()
Definition: isolate.h:995
static Code * cast(Object *obj)
const Register edi
int foo
uint8_t byte
Definition: globals.h:185
static Local< ObjectTemplate > New()
Definition: api.cc:1286
const Register eax
int(* F2)(int x, int y)
const XMMRegister xmm1
byte * instruction_start()
Definition: objects-inl.h:5857
void GetCode(CodeDesc *desc)
const int kPointerSize
Definition: globals.h:268
const Register ecx
static Local< FunctionTemplate > New(Isolate *isolate, FunctionCallback callback=0, Handle< Value > data=Handle< Value >(), Handle< Signature > signature=Handle< Signature >(), int length=0)
Definition: api.cc:942
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
double uint64_to_double(uint64_t d64)
Definition: double.h:38
#define V8_2PART_UINT64_C(a, b)
Definition: globals.h:226
Definition: v8.h:123
static Local< Array > New(Isolate *isolate, int length=0)
Definition: api.cc:5786
static V8_INLINE Local< T > Cast(Local< S > that)
Definition: v8.h:372
int(* F7)(double x, double y)
MUST_USE_RESULT MaybeObject * CreateCode(const CodeDesc &desc, Code::Flags flags, Handle< Object > self_reference, bool immovable=false, bool crankshafted=false, int prologue_offset=Code::kPrologueOffsetNotSet)
Definition: heap.cc:4119
static double nan_value()
static void InitializeVM()
Definition: cctest.h:116
const Register ebx
double(* F5)(double x, double y)
static Flags ComputeFlags(Kind kind, InlineCacheState ic_state=UNINITIALIZED, ExtraICState extra_ic_state=kNoExtraICState, StubType type=NORMAL, InlineCacheHolderFlag holder=OWN_MAP)
Definition: objects-inl.h:4601
int baz
const Register esi
static int ActivationFrameAlignment()
uint32_t Length() const
Definition: api.cc:5800
#define RUNTIME_ENTRY(name, nargs, ressize)
const XMMRegister xmm2
const Register edx
static void Dump(FILE *f, byte *begin, byte *end)
double(* F6)(int x)
Definition: v8.h:124
int(* F4)(double x)
bool Set(Handle< Value > key, Handle< Value > value, PropertyAttribute attribs=None)
Definition: api.cc:3044
static v8::Isolate * isolate()
Definition: cctest.h:96
const XMMRegister xmm0
F0Type * F0