· 9 years ago · Nov 15, 2016, 10:16 AM
1diff -urp v8.t5.4.259/Makefile v8/Makefile
2--- v8.t5.4.259/Makefile 2016-11-14 15:48:15.294010612 -0800
3+++ v8/Makefile 2016-11-14 15:08:43.236024433 -0800
4@@ -102,6 +102,10 @@ endif
5 ifeq ($(gdbjit), off)
6 GYPFLAGS += -Dv8_enable_gdbjit=0
7 endif
8+# musl=on
9+ifeq ($(musl), on)
10+ GYPFLAGS += -Duse_musl_support=1
11+endif
12 # vtunejit=on
13 ifeq ($(vtunejit), on)
14 GYPFLAGS += -Dv8_enable_vtunejit=1
15@@ -246,7 +250,7 @@ endif
16
17 # Architectures and modes to be compiled. Consider these to be internal
18 # variables, don't override them (use the targets instead).
19-ARCHES = ia32 x64 arm arm64 mips mipsel mips64 mips64el x87 ppc ppc64 s390 \
20+ARCHES = ia32 x64 x32 arm arm64 mips mipsel mips64 mips64el x87 ppc ppc64 s390 \
21 s390x
22 ARCHES32 = ia32 arm mips mipsel x87 ppc s390
23 DEFAULT_ARCHES = ia32 x64 arm
24@@ -458,6 +462,7 @@ $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
25 -Dtarget_arch=$(V8_TARGET_ARCH), \
26 $(if $(shell echo $(ARCHES32) | grep $(V8_TARGET_ARCH)), \
27 -Dtarget_arch=ia32,)) \
28+ -Dx86_64_abi=x32 \
29 $(if $(findstring optdebug,$@),-Dv8_optimized_debug=1,) \
30 -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS)
31
32diff -urp v8.t5.4.259/gypfiles/detect_v8_host_arch.py v8/gypfiles/detect_v8_host_arch.py
33--- v8.t5.4.259/gypfiles/detect_v8_host_arch.py 2016-11-14 15:48:15.302010921 -0800
34+++ v8/gypfiles/detect_v8_host_arch.py 2016-11-14 15:08:43.237024473 -0800
35@@ -69,7 +69,8 @@ def DoMain(_):
36 # Distinguish between different userland bitness by querying
37 # the python binary.
38 if host_arch == 'x64' and platform.architecture()[0] == '32bit':
39- host_arch = 'ia32'
40+ # host_arch = 'ia32' #multilib
41+ host_arch = 'x64' #x32 abi
42
43 return host_arch
44
45diff -urp v8.t5.4.259/gypfiles/standalone.gypi v8/gypfiles/standalone.gypi
46--- v8.t5.4.259/gypfiles/standalone.gypi 2016-11-14 15:48:15.305011036 -0800
47+++ v8/gypfiles/standalone.gypi 2016-11-14 15:08:43.238024512 -0800
48@@ -159,7 +159,7 @@
49 }, {
50 'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
51 }],
52- ['host_arch!="ppc" and host_arch!="ppc64" and host_arch!="ppc64le" and host_arch!="s390" and host_arch!="s390x"', {
53+ ['host_arch!="ppc" and host_arch!="ppc64" and host_arch!="ppc64le" and host_arch!="s390" and host_arch!="s390x" and host_arch!="x32"', {
54 'host_clang%': 1,
55 }, {
56 'host_clang%': 0,
57@@ -445,7 +445,7 @@
58 ['OS=="aix"', {
59 'cflags': [ '-g', '-Og', '-gxcoff' ],
60 }, {
61- 'cflags': [ '-g', '-O0' ],
62+ 'cflags': [ '-g3', '-O0' ],
63 }],
64 ],
65 },
66@@ -657,7 +657,7 @@
67 }],
68 ],
69 }],
70- ['linux_use_bundled_gold==1 and not (clang==0 and use_lto==1)', {
71+ ['linux_use_bundled_gold==1 and not (clang==0 and use_lto==1) and not (x86_64_abi=="x32")', {
72 # Put our binutils, which contains gold in the search path. We pass
73 # the path to gold to the compiler. gyp leaves unspecified what the
74 # cwd is when running the compiler, so the normal gyp path-munging
75@@ -750,6 +750,11 @@
76 ],
77 'ldflags': [ '-pthread', ],
78 'conditions': [
79+ [ 'use_musl_support==1', {
80+ 'defines': [
81+ 'V8_LIBC_MUSL=1'
82+ ],
83+ }],
84 # Don't warn about TRACE_EVENT_* macros with zero arguments passed to
85 # ##__VA_ARGS__. C99 strict mode prohibits having zero variadic macro
86 # arguments in gcc.
87diff -urp v8.t5.4.259/gypfiles/toolchain.gypi v8/gypfiles/toolchain.gypi
88--- v8.t5.4.259/gypfiles/toolchain.gypi 2016-11-14 15:48:15.306011075 -0800
89+++ v8/gypfiles/toolchain.gypi 2016-11-14 15:08:43.239024551 -0800
90@@ -40,6 +40,8 @@
91 'has_valgrind%': 0,
92 'coverage%': 0,
93 'v8_target_arch%': '<(target_arch)',
94+ 'x86_64_abi%': '<(x86_64_abi)',
95+ 'use_musl_support%': '<(use_musl_support)',
96 'v8_host_byteorder%': '<!(python -c "import sys; print sys.byteorder")',
97 'force_dynamic_crt%': 0,
98 # Native Client builds currently use the V8 ARM JIT and
99@@ -96,12 +98,12 @@
100 'binutils_dir%': '',
101
102 'conditions': [
103- ['OS=="linux" and host_arch=="x64"', {
104- 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
105- }],
106- ['OS=="linux" and host_arch=="ia32"', {
107- 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
108- }],
109+ #['OS=="linux" and host_arch=="x64" and x86_64_abi!="x32"', {
110+ # 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
111+ #}],
112+ #['OS=="linux" and host_arch=="ia32"', {
113+ # 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
114+ #}],
115
116 # linux_use_bundled_gold: whether to use the gold linker binary checked
117 # into third_party/binutils. Force this off via GYP_DEFINES when you
118diff -urp v8.t5.4.259/include/v8.h v8/include/v8.h
119--- v8.t5.4.259/include/v8.h 2016-11-14 15:48:15.328011922 -0800
120+++ v8/include/v8.h 2016-11-14 15:08:43.242024669 -0800
121@@ -7562,7 +7562,7 @@ class Internals {
122 1 * kApiPointerSize + kApiIntSize;
123 static const int kStringResourceOffset = 3 * kApiPointerSize;
124
125- static const int kOddballKindOffset = 4 * kApiPointerSize + sizeof(double);
126+ static const int kOddballKindOffset = 5 * kApiPointerSize + sizeof(double);
127 static const int kForeignAddressOffset = kApiPointerSize;
128 static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
129 static const int kFixedArrayHeaderSize = 2 * kApiPointerSize;
130diff -urp v8.t5.4.259/include/v8config.h v8/include/v8config.h
131--- v8.t5.4.259/include/v8config.h 2016-11-14 15:48:15.328011922 -0800
132+++ v8/include/v8config.h 2016-11-14 15:08:43.242024669 -0800
133@@ -139,6 +139,8 @@
134 #elif defined(__BIONIC__)
135 # define V8_LIBC_BIONIC 1
136 # define V8_LIBC_BSD 1
137+#elif defined(__MUSL__)
138+# define V8_LIBC_MUSL 1
139 #elif defined(__UCLIBC__)
140 // Must test for UCLIBC before GLIBC, as UCLIBC pretends to be GLIBC.
141 # define V8_LIBC_UCLIBC 1
142@@ -148,7 +150,6 @@
143 # define V8_LIBC_BSD V8_OS_BSD
144 #endif
145
146-
147 // -----------------------------------------------------------------------------
148 // Compiler detection
149 //
150diff -urp v8.t5.4.259/src/api.cc v8/src/api.cc
151--- v8.t5.4.259/src/api.cc 2016-11-14 15:48:15.367013423 -0800
152+++ v8/src/api.cc 2016-11-14 15:08:43.245024787 -0800
153@@ -468,7 +468,7 @@ Isolate* SnapshotCreator::GetIsolate() {
154 }
155
156 size_t SnapshotCreator::AddContext(Local<Context> context) {
157- DCHECK(!context.IsEmpty());
158+ //DCHECK(!context.IsEmpty());
159 SnapshotCreatorData* data = SnapshotCreatorData::cast(data_);
160 DCHECK(!data->created_);
161 Isolate* isolate = data->isolate_;
162diff -urp v8.t5.4.259/src/api.h v8/src/api.h
163--- v8.t5.4.259/src/api.h 2016-11-14 15:48:15.367013423 -0800
164+++ v8/src/api.h 2016-11-14 15:08:43.245024787 -0800
165@@ -396,13 +396,13 @@ MAKE_TO_LOCAL(CallableToLocal, JSReceive
166 v8::internal::Handle<v8::internal::To> Utils::OpenHandle( \
167 const v8::From* that, bool allow_empty_handle) { \
168 DCHECK(allow_empty_handle || that != NULL); \
169- DCHECK(that == NULL || \
170- (*reinterpret_cast<v8::internal::Object* const*>(that))->Is##To()); \
171 return v8::internal::Handle<v8::internal::To>( \
172 reinterpret_cast<v8::internal::To**>(const_cast<v8::From*>(that))); \
173 }
174
175 OPEN_HANDLE_LIST(MAKE_OPEN_HANDLE)
176+// DCHECK(that == NULL ||
177+// (*reinterpret_cast<v8::internal::Object* const*>(that))->Is##To());
178
179 #undef MAKE_OPEN_HANDLE
180 #undef OPEN_HANDLE_LIST
181diff -urp v8.t5.4.259/src/assembler.h v8/src/assembler.h
182--- v8.t5.4.259/src/assembler.h 2016-11-14 15:48:15.423015580 -0800
183+++ v8/src/assembler.h 2016-11-14 15:08:43.246024826 -0800
184@@ -276,7 +276,7 @@ class Label {
185 }
186
187 INLINE(~Label()) {
188- DCHECK(!is_linked());
189+// DCHECK(!is_linked());//omt
190 DCHECK(!is_near_linked());
191 }
192
193diff -urp v8.t5.4.259/src/base/build_config.h v8/src/base/build_config.h
194--- v8.t5.4.259/src/base/build_config.h 2016-11-14 15:48:15.441016273 -0800
195+++ v8/src/base/build_config.h 2016-11-14 15:08:43.246024826 -0800
196@@ -107,13 +107,13 @@
197 #if V8_TARGET_ARCH_IA32
198 #define V8_TARGET_ARCH_32_BIT 1
199 #elif V8_TARGET_ARCH_X64
200-#if !V8_TARGET_ARCH_32_BIT && !V8_TARGET_ARCH_64_BIT
201+//#if !V8_TARGET_ARCH_32_BIT && !V8_TARGET_ARCH_64_BIT
202 #if defined(__x86_64__) && __SIZEOF_POINTER__ == 4 // Check for x32.
203 #define V8_TARGET_ARCH_32_BIT 1
204 #else
205 #define V8_TARGET_ARCH_64_BIT 1
206 #endif
207-#endif
208+//#endif
209 #elif V8_TARGET_ARCH_ARM
210 #define V8_TARGET_ARCH_32_BIT 1
211 #elif V8_TARGET_ARCH_ARM64
212diff -urp v8.t5.4.259/src/builtins/builtins-array.cc v8/src/builtins/builtins-array.cc
213--- v8.t5.4.259/src/builtins/builtins-array.cc 2016-11-14 15:48:15.466017236 -0800
214+++ v8/src/builtins/builtins-array.cc 2016-11-14 15:08:43.246024826 -0800
215@@ -287,7 +287,11 @@ BUILTIN(ArraySlice) {
216 !IsJSArrayFastElementMovingAllowed(isolate, array) ||
217 !isolate->IsArraySpeciesLookupChainIntact() ||
218 // If this is a subclass of Array, then call out to JS
219+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
220+ !array->map()->new_target_is_base())) {
221+#else
222 !array->HasArrayPrototype(isolate))) {
223+#endif
224 AllowHeapAllocation allow_allocation;
225 return CallJsIntrinsic(isolate, isolate->array_slice(), args);
226 }
227@@ -348,7 +352,11 @@ BUILTIN(ArraySplice) {
228 if (V8_UNLIKELY(
229 !EnsureJSArrayWithWritableFastElements(isolate, receiver, &args, 3) ||
230 // If this is a subclass of Array, then call out to JS.
231+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
232+ !JSArray::cast(*receiver)->map()->new_target_is_base() ||
233+#else
234 !Handle<JSArray>::cast(receiver)->HasArrayPrototype(isolate) ||
235+#endif
236 // If anything with @@species has been messed with, call out to JS.
237 !isolate->IsArraySpeciesLookupChainIntact())) {
238 return CallJsIntrinsic(isolate, isolate->array_splice(), args);
239@@ -1217,7 +1225,11 @@ BUILTIN(ArrayConcat) {
240
241 // Avoid a real species read to avoid extra lookups to the array constructor
242 if (V8_LIKELY(receiver->IsJSArray() &&
243+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
244+ JSArray::cast(*receiver)->map()->new_target_is_base() &&
245+#else
246 Handle<JSArray>::cast(receiver)->HasArrayPrototype(isolate) &&
247+#endif
248 isolate->IsArraySpeciesLookupChainIntact())) {
249 if (Fast_ArrayConcat(isolate, &args).ToHandle(&result_array)) {
250 return *result_array;
251diff -urp v8.t5.4.259/src/builtins/builtins-conversion.cc v8/src/builtins/builtins-conversion.cc
252--- v8.t5.4.259/src/builtins/builtins-conversion.cc 2016-11-14 15:48:15.469017351 -0800
253+++ v8/src/builtins/builtins-conversion.cc 2016-11-14 15:08:43.247024865 -0800
254@@ -9,6 +9,7 @@
255 namespace v8 {
256 namespace internal {
257
258+#if 0
259 Handle<Code> Builtins::NonPrimitiveToPrimitive(ToPrimitiveHint hint) {
260 switch (hint) {
261 case ToPrimitiveHint::kDefault:
262@@ -320,6 +321,6 @@ void Builtins::Generate_ToBoolean(CodeSt
263 assembler->Bind(&return_false);
264 assembler->Return(assembler->BooleanConstant(false));
265 }
266-
267+#endif
268 } // namespace internal
269 } // namespace v8
270diff -urp v8.t5.4.259/src/builtins/builtins-handler.cc v8/src/builtins/builtins-handler.cc
271--- v8.t5.4.259/src/builtins/builtins-handler.cc 2016-11-14 15:48:15.470017390 -0800
272+++ v8/src/builtins/builtins-handler.cc 2016-11-14 15:08:43.247024865 -0800
273@@ -37,6 +37,11 @@ void Builtins::Generate_KeyedStoreIC_Slo
274 ElementHandlerCompiler::GenerateStoreSlow(masm);
275 }
276
277+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
278+void Builtins::Generate_LoadGlobalIC_Miss(MacroAssembler* masm) {
279+ LoadGlobalIC::GenerateMiss(masm);
280+}
281+#else
282 void Builtins::Generate_LoadGlobalIC_Miss(CodeStubAssembler* assembler) {
283 typedef compiler::Node Node;
284 typedef LoadGlobalWithVectorDescriptor Descriptor;
285@@ -48,7 +53,9 @@ void Builtins::Generate_LoadGlobalIC_Mis
286 assembler->TailCallRuntime(Runtime::kLoadGlobalIC_Miss, context, slot,
287 vector);
288 }
289+#endif
290
291+#if 0
292 namespace {
293 void Generate_LoadGlobalIC_Slow(CodeStubAssembler* assembler, TypeofMode mode) {
294 typedef compiler::Node Node;
295@@ -63,21 +70,39 @@ void Generate_LoadGlobalIC_Slow(CodeStub
296 typeof_mode);
297 }
298 } // anonymous namespace
299+#endif
300
301+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
302+void Builtins::Generate_LoadGlobalIC_SlowInsideTypeof(MacroAssembler* masm) {
303+ LoadGlobalIC::GenerateRuntimeGetProperty(masm);
304+}
305+#else
306 void Builtins::Generate_LoadGlobalIC_SlowInsideTypeof(
307 CodeStubAssembler* assembler) {
308 Generate_LoadGlobalIC_Slow(assembler, INSIDE_TYPEOF);
309 }
310+#endif
311
312+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
313+void Builtins::Generate_LoadGlobalIC_SlowNotInsideTypeof(MacroAssembler* masm) {
314+ LoadGlobalIC::GenerateRuntimeGetProperty(masm);
315+}
316+#else
317 void Builtins::Generate_LoadGlobalIC_SlowNotInsideTypeof(
318 CodeStubAssembler* assembler) {
319 Generate_LoadGlobalIC_Slow(assembler, NOT_INSIDE_TYPEOF);
320 }
321+#endif
322
323 void Builtins::Generate_LoadIC_Getter_ForDeopt(MacroAssembler* masm) {
324 NamedLoadHandlerCompiler::GenerateLoadViaGetterForDeopt(masm);
325 }
326
327+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
328+void Builtins::Generate_LoadIC_Miss(MacroAssembler* masm) {
329+ LoadIC::GenerateMiss(masm);
330+}
331+#else
332 void Builtins::Generate_LoadIC_Miss(CodeStubAssembler* assembler) {
333 typedef compiler::Node Node;
334 typedef LoadWithVectorDescriptor Descriptor;
335@@ -91,11 +116,17 @@ void Builtins::Generate_LoadIC_Miss(Code
336 assembler->TailCallRuntime(Runtime::kLoadIC_Miss, context, receiver, name,
337 slot, vector);
338 }
339+#endif
340
341 void Builtins::Generate_LoadIC_Normal(MacroAssembler* masm) {
342 LoadIC::GenerateNormal(masm);
343 }
344
345+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
346+void Builtins::Generate_LoadIC_Slow(MacroAssembler* masm) {
347+ LoadIC::GenerateRuntimeGetProperty(masm);
348+}
349+#else
350 void Builtins::Generate_LoadIC_Slow(CodeStubAssembler* assembler) {
351 typedef compiler::Node Node;
352 typedef LoadWithVectorDescriptor Descriptor;
353@@ -106,7 +137,13 @@ void Builtins::Generate_LoadIC_Slow(Code
354
355 assembler->TailCallRuntime(Runtime::kGetProperty, context, receiver, name);
356 }
357+#endif
358
359+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
360+void Builtins::Generate_StoreIC_Miss(MacroAssembler* masm) {
361+ StoreIC::GenerateMiss(masm);
362+}
363+#else
364 void Builtins::Generate_StoreIC_Miss(CodeStubAssembler* assembler) {
365 typedef compiler::Node Node;
366 typedef StoreWithVectorDescriptor Descriptor;
367@@ -121,6 +158,7 @@ void Builtins::Generate_StoreIC_Miss(Cod
368 assembler->TailCallRuntime(Runtime::kStoreIC_Miss, context, receiver, name,
369 value, slot, vector);
370 }
371+#endif
372
373 void Builtins::Generate_StoreIC_Normal(MacroAssembler* masm) {
374 StoreIC::GenerateNormal(masm);
375@@ -130,7 +168,9 @@ void Builtins::Generate_StoreIC_Setter_F
376 NamedStoreHandlerCompiler::GenerateStoreViaSetterForDeopt(masm);
377 }
378
379+
380 namespace {
381+#if 0
382 void Generate_StoreIC_Slow(CodeStubAssembler* assembler,
383 LanguageMode language_mode) {
384 typedef compiler::Node Node;
385@@ -147,8 +187,16 @@ void Generate_StoreIC_Slow(CodeStubAssem
386 assembler->TailCallRuntime(Runtime::kSetProperty, context, receiver, name,
387 value, lang_mode);
388 }
389+#endif
390 } // anonymous namespace
391
392+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
393+void Builtins::Generate_StoreIC_Slow(MacroAssembler* masm) {
394+ NamedStoreHandlerCompiler::GenerateSlow(masm);
395+}
396+#endif
397+
398+#if 0
399 void Builtins::Generate_StoreIC_SlowSloppy(CodeStubAssembler* assembler) {
400 Generate_StoreIC_Slow(assembler, SLOPPY);
401 }
402@@ -156,6 +204,7 @@ void Builtins::Generate_StoreIC_SlowSlop
403 void Builtins::Generate_StoreIC_SlowStrict(CodeStubAssembler* assembler) {
404 Generate_StoreIC_Slow(assembler, STRICT);
405 }
406+#endif
407
408 } // namespace internal
409 } // namespace v8
410diff -urp v8.t5.4.259/src/builtins/builtins-object.cc v8/src/builtins/builtins-object.cc
411--- v8.t5.4.259/src/builtins/builtins-object.cc 2016-11-14 15:48:15.470017390 -0800
412+++ v8/src/builtins/builtins-object.cc 2016-11-14 15:08:43.247024865 -0800
413@@ -14,6 +14,7 @@ namespace internal {
414 // -----------------------------------------------------------------------------
415 // ES6 section 19.1 Object Objects
416
417+#if 0
418 void Builtins::Generate_ObjectHasOwnProperty(CodeStubAssembler* assembler) {
419 typedef compiler::Node Node;
420 typedef CodeStubAssembler::Label Label;
421@@ -59,6 +60,7 @@ void Builtins::Generate_ObjectHasOwnProp
422 assembler->Return(assembler->CallRuntime(Runtime::kObjectHasOwnProperty,
423 context, object, key));
424 }
425+#endif
426
427 namespace {
428
429diff -urp v8.t5.4.259/src/builtins/builtins.cc v8/src/builtins/builtins.cc
430--- v8.t5.4.259/src/builtins/builtins.cc 2016-11-14 15:48:15.471017429 -0800
431+++ v8/src/builtins/builtins.cc 2016-11-14 15:08:43.248024904 -0800
432@@ -10,15 +10,99 @@
433 #include "src/isolate.h"
434 #include "src/macro-assembler.h"
435 #include "src/objects.h"
436+#include "src/builtins/builtins-utils.h"
437+
438
439 namespace v8 {
440 namespace internal {
441
442+
443 // Forward declarations for C++ builtins.
444 #define FORWARD_DECLARE(Name) \
445 Object* Builtin_##Name(int argc, Object** args, Isolate* isolate);
446 BUILTIN_LIST_C(FORWARD_DECLARE)
447
448+#if 1
449+// ES6 19.1.3.2
450+BUILTIN(ObjectHasOwnProperty) {
451+ HandleScope scope(isolate);
452+ Handle<Object> property = args.at<Object>(1);
453+
454+ Handle<Name> key;
455+ uint32_t index;
456+ bool key_is_array_index = property->ToArrayIndex(&index);
457+
458+ if (!key_is_array_index) {
459+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, key,
460+ Object::ToName(isolate, property));
461+ key_is_array_index = key->AsArrayIndex(&index);
462+ }
463+
464+ Handle<Object> object = args.at<Object>(0);
465+
466+ if (object->IsJSObject()) {
467+ Handle<JSObject> js_obj = Handle<JSObject>::cast(object);
468+ // Fast case: either the key is a real named property or it is not
469+ // an array index and there are no interceptors or hidden
470+ // prototypes.
471+ // TODO(jkummerow): Make JSReceiver::HasOwnProperty fast enough to
472+ // handle all cases directly (without this custom fast path).
473+ {
474+ LookupIterator::Configuration c = LookupIterator::OWN_SKIP_INTERCEPTOR;
475+ LookupIterator it =
476+ key_is_array_index ? LookupIterator(isolate, js_obj, index, js_obj, c)
477+ : LookupIterator(js_obj, key, js_obj, c);
478+ Maybe<bool> maybe = JSReceiver::HasProperty(&it);
479+ if (maybe.IsNothing()) return isolate->heap()->exception();
480+ DCHECK(!isolate->has_pending_exception());
481+ if (maybe.FromJust()) return isolate->heap()->true_value();
482+ }
483+
484+ Map* map = js_obj->map();
485+ if (!map->has_hidden_prototype() &&
486+ (key_is_array_index ? !map->has_indexed_interceptor()
487+ : !map->has_named_interceptor())) {
488+ return isolate->heap()->false_value();
489+ }
490+
491+ // Slow case.
492+ LookupIterator::Configuration c = LookupIterator::OWN;
493+ LookupIterator it = key_is_array_index
494+ ? LookupIterator(isolate, js_obj, index, js_obj, c)
495+ : LookupIterator(js_obj, key, js_obj, c);
496+
497+ Maybe<bool> maybe = JSReceiver::HasProperty(&it);
498+ if (maybe.IsNothing()) return isolate->heap()->exception();
499+ DCHECK(!isolate->has_pending_exception());
500+ return isolate->heap()->ToBoolean(maybe.FromJust());
501+
502+ } else if (object->IsJSProxy()) {
503+ if (key.is_null()) {
504+ DCHECK(key_is_array_index);
505+ key = isolate->factory()->Uint32ToString(index);
506+ }
507+
508+ Maybe<bool> result =
509+ JSReceiver::HasOwnProperty(Handle<JSProxy>::cast(object), key);
510+ if (!result.IsJust()) return isolate->heap()->exception();
511+ return isolate->heap()->ToBoolean(result.FromJust());
512+
513+ } else if (object->IsString()) {
514+ return isolate->heap()->ToBoolean(
515+ key_is_array_index
516+ ? index < static_cast<uint32_t>(String::cast(*object)->length())
517+ : key->Equals(isolate->heap()->length_string()));
518+ } else if (object->IsNull(isolate) || object->IsUndefined(isolate)) {
519+ THROW_NEW_ERROR_RETURN_FAILURE(
520+ isolate, NewTypeError(MessageTemplate::kUndefinedOrNullToObject));
521+ }
522+
523+ return isolate->heap()->false_value();
524+}
525+
526+#endif
527+
528+
529 Builtins::Builtins() : initialized_(false) {
530 memset(builtins_, 0, sizeof(builtins_[0]) * builtin_count);
531 }
532@@ -91,6 +175,7 @@ Code* BuildWithCodeStubAssemblerJS(Isola
533 return *code;
534 }
535
536+#if 0
537 // Builder for builtins implemented in TurboFan with CallStub linkage.
538 Code* BuildWithCodeStubAssemblerCS(Isolate* isolate,
539 CodeAssemblerGenerator generator,
540@@ -109,6 +194,7 @@ Code* BuildWithCodeStubAssemblerCS(Isola
541 PostBuildProfileAndTracing(isolate, *code, name);
542 return *code;
543 }
544+#endif
545 } // anonymous namespace
546
547 void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) {
548@@ -133,12 +219,14 @@ void Builtins::SetUp(Isolate* isolate, b
549 code = BuildWithCodeStubAssemblerJS(isolate, &Generate_##Name, Argc, \
550 kBuiltinFlags, #Name); \
551 builtins_[index++] = code;
552+#if 0
553 #define BUILD_TFS(Name, Kind, Extra, InterfaceDescriptor) \
554 { InterfaceDescriptor##Descriptor descriptor(isolate); } \
555 code = BuildWithCodeStubAssemblerCS( \
556 isolate, &Generate_##Name, CallDescriptors::InterfaceDescriptor, \
557 Code::ComputeFlags(Code::Kind, Extra), #Name); \
558 builtins_[index++] = code;
559+#endif
560 #define BUILD_ASM(Name) \
561 code = \
562 BuildWithMacroAssembler(isolate, Generate_##Name, kBuiltinFlags, #Name); \
563@@ -147,9 +235,13 @@ void Builtins::SetUp(Isolate* isolate, b
564 code = BuildWithMacroAssembler( \
565 isolate, Generate_##Name, Code::ComputeFlags(Code::Kind, Extra), #Name); \
566 builtins_[index++] = code;
567+#define BUILD_ASH2(Name, Kind, Extra) \
568+ code = BuildWithMacroAssembler( \
569+ isolate, Generate_##Name, Code::ComputeHandlerFlags(Code::Kind), #Name); \
570+ builtins_[index++] = code;
571
572 BUILTIN_LIST(BUILD_CPP, BUILD_API, BUILD_TFJ, BUILD_TFS, BUILD_ASM,
573- BUILD_ASH, BUILD_ASM);
574+ BUILD_ASH, BUILD_ASH2, BUILD_ASM);
575
576 #undef BUILD_CPP
577 #undef BUILD_API
578@@ -157,6 +249,7 @@ void Builtins::SetUp(Isolate* isolate, b
579 #undef BUILD_TFS
580 #undef BUILD_ASM
581 #undef BUILD_ASH
582+#undef BUILD_ASH2
583 CHECK_EQ(builtin_count, index);
584 for (int i = 0; i < builtin_count; i++) {
585 Code::cast(builtins_[i])->set_builtin_index(i);
586diff -urp v8.t5.4.259/src/builtins/builtins.h v8/src/builtins/builtins.h
587--- v8.t5.4.259/src/builtins/builtins.h 2016-11-14 15:48:15.472017467 -0800
588+++ v8/src/builtins/builtins.h 2016-11-14 15:08:43.248024904 -0800
589@@ -47,7 +47,23 @@ namespace internal {
590 // Args: name, code kind, extra IC state
591 // DBG: Builtin in platform-dependent assembly, used by the debugger.
592 // Args: name
593-#define BUILTIN_LIST(CPP, API, TFJ, TFS, ASM, ASH, DBG) \
594+/*
595+// TFS(LoadGlobalIC_Miss, BUILTIN, kNoExtraICState, LoadGlobalWithVector) \
596+// TFS(LoadGlobalIC_SlowInsideTypeof, HANDLER, Code::LOAD_GLOBAL_IC, \
597+// LoadGlobalWithVector) \
598+// TFS(LoadGlobalIC_SlowNotInsideTypeof, HANDLER, Code::LOAD_GLOBAL_IC, \
599+// LoadGlobalWithVector) \
600+// TFS(LoadIC_Miss, BUILTIN, kNoExtraICState, LoadWithVector) \
601+// ASH(LoadIC_Normal, HANDLER, Code::LOAD_IC) \
602+// TFS(LoadIC_Slow, HANDLER, Code::LOAD_IC, LoadWithVector) \
603+// TFS(StoreIC_Miss, BUILTIN, kNoExtraICState, StoreWithVector) \
604+// ASH(StoreIC_Normal, HANDLER, Code::STORE_IC) \
605+// TFS(StoreIC_SlowSloppy, HANDLER, Code::STORE_IC, StoreWithVector) \
606+// TFS(StoreIC_SlowStrict, HANDLER, Code::STORE_IC, StoreWithVector) \
607+
608+
609+*/
610+#define BUILTIN_LIST(CPP, API, TFJ, TFS, ASM, ASH, ASH2, DBG) \
611 ASM(Abort) \
612 /* Handlers */ \
613 ASH(KeyedLoadIC_Megamorphic, KEYED_LOAD_IC, kNoExtraICState) \
614@@ -58,20 +74,17 @@ namespace internal {
615 StoreICState::kStrictModeState) \
616 ASM(KeyedStoreIC_Miss) \
617 ASH(KeyedStoreIC_Slow, HANDLER, Code::KEYED_STORE_IC) \
618- TFS(LoadGlobalIC_Miss, BUILTIN, kNoExtraICState, LoadGlobalWithVector) \
619- TFS(LoadGlobalIC_SlowInsideTypeof, HANDLER, Code::LOAD_GLOBAL_IC, \
620- LoadGlobalWithVector) \
621- TFS(LoadGlobalIC_SlowNotInsideTypeof, HANDLER, Code::LOAD_GLOBAL_IC, \
622- LoadGlobalWithVector) \
623 ASH(LoadIC_Getter_ForDeopt, LOAD_IC, kNoExtraICState) \
624- TFS(LoadIC_Miss, BUILTIN, kNoExtraICState, LoadWithVector) \
625- ASH(LoadIC_Normal, HANDLER, Code::LOAD_IC) \
626- TFS(LoadIC_Slow, HANDLER, Code::LOAD_IC, LoadWithVector) \
627- TFS(StoreIC_Miss, BUILTIN, kNoExtraICState, StoreWithVector) \
628- ASH(StoreIC_Normal, HANDLER, Code::STORE_IC) \
629 ASH(StoreIC_Setter_ForDeopt, STORE_IC, StoreICState::kStrictModeState) \
630- TFS(StoreIC_SlowSloppy, HANDLER, Code::STORE_IC, StoreWithVector) \
631- TFS(StoreIC_SlowStrict, HANDLER, Code::STORE_IC, StoreWithVector) \
632+ ASH2(LoadIC_Normal, Code::LOAD_IC, kNoExtraICState) \
633+ ASH2(StoreIC_Normal, Code::STORE_IC, kNoExtraICState) \
634+ ASH(LoadGlobalIC_Miss, BUILTIN, kNoExtraICState) \
635+ ASH2(LoadGlobalIC_SlowNotInsideTypeof, Code::LOAD_GLOBAL_IC, kNoExtraICState) \
636+ ASH2(LoadGlobalIC_SlowInsideTypeof, Code::LOAD_GLOBAL_IC, kNoExtraICState) \
637+ ASH(LoadIC_Miss, BUILTIN, kNoExtraICState) \
638+ ASH2(LoadIC_Slow, Code::LOAD_IC, kNoExtraICState) \
639+ ASH(StoreIC_Miss, BUILTIN, kNoExtraICState) \
640+ ASH2(StoreIC_Slow, Code::STORE_IC, kNoExtraICState) \
641 \
642 /* Code aging */ \
643 CODE_AGE_LIST_WITH_ARG(DECLARE_CODE_AGE_BUILTIN, ASM) \
644@@ -165,18 +178,7 @@ namespace internal {
645 DBG(Slot_DebugBreak) \
646 \
647 /* Type conversions */ \
648- TFS(ToBoolean, BUILTIN, kNoExtraICState, TypeConversion) \
649- TFS(OrdinaryToPrimitive_Number, BUILTIN, kNoExtraICState, TypeConversion) \
650- TFS(OrdinaryToPrimitive_String, BUILTIN, kNoExtraICState, TypeConversion) \
651- TFS(NonPrimitiveToPrimitive_Default, BUILTIN, kNoExtraICState, \
652- TypeConversion) \
653- TFS(NonPrimitiveToPrimitive_Number, BUILTIN, kNoExtraICState, \
654- TypeConversion) \
655- TFS(NonPrimitiveToPrimitive_String, BUILTIN, kNoExtraICState, \
656- TypeConversion) \
657 ASM(StringToNumber) \
658- TFS(NonNumberToNumber, BUILTIN, kNoExtraICState, TypeConversion) \
659- ASM(ToNumber) \
660 \
661 /* Built-in functions for Javascript */ \
662 /* Special internal builtins */ \
663@@ -443,7 +445,7 @@ namespace internal {
664 CPP(ObjectGetOwnPropertySymbols) \
665 CPP(ObjectGetPrototypeOf) \
666 /* ES6 section 19.1.3.2 Object.prototype.hasOwnProperty */ \
667- TFJ(ObjectHasOwnProperty, 2) \
668+ CPP(ObjectHasOwnProperty) \
669 CPP(ObjectIs) \
670 CPP(ObjectIsExtensible) \
671 CPP(ObjectIsFrozen) \
672@@ -521,19 +523,19 @@ namespace internal {
673
674 #define IGNORE_BUILTIN(...)
675
676-#define BUILTIN_LIST_ALL(V) BUILTIN_LIST(V, V, V, V, V, V, V)
677+#define BUILTIN_LIST_ALL(V) BUILTIN_LIST(V, V, V, V, V, V, V, V)
678
679 #define BUILTIN_LIST_C(V) \
680 BUILTIN_LIST(V, V, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \
681- IGNORE_BUILTIN, IGNORE_BUILTIN)
682+ IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN)
683
684 #define BUILTIN_LIST_A(V) \
685 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \
686- V, V, V)
687+ V, V, V, V)
688
689 #define BUILTIN_LIST_DBG(V) \
690 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, \
691- IGNORE_BUILTIN, IGNORE_BUILTIN, V)
692+ IGNORE_BUILTIN, IGNORE_BUILTIN, IGNORE_BUILTIN, V)
693
694 // Forward declarations.
695 class CodeStubAssembler;
696@@ -572,9 +574,6 @@ class Builtins {
697 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny,
698 TailCallMode tail_call_mode = TailCallMode::kDisallow);
699 Handle<Code> CallBoundFunction(TailCallMode tail_call_mode);
700- Handle<Code> NonPrimitiveToPrimitive(
701- ToPrimitiveHint hint = ToPrimitiveHint::kDefault);
702- Handle<Code> OrdinaryToPrimitive(OrdinaryToPrimitiveHint hint);
703 Handle<Code> InterpreterPushArgsAndCall(
704 TailCallMode tail_call_mode,
705 CallableType function_type = CallableType::kAny);
706@@ -631,7 +630,7 @@ class Builtins {
707 static void Generate_##Name(CodeStubAssembler* csasm);
708
709 BUILTIN_LIST(IGNORE_BUILTIN, IGNORE_BUILTIN, DECLARE_TF, DECLARE_TF,
710- DECLARE_ASM, DECLARE_ASM, DECLARE_ASM)
711+ DECLARE_ASM, DECLARE_ASM, DECLARE_ASM, DECLARE_ASM)
712
713 #undef DECLARE_ASM
714 #undef DECLARE_TF
715diff -urp v8.t5.4.259/src/builtins/x64/builtins-x64.cc v8/src/builtins/x64/builtins-x64.cc
716--- v8.t5.4.259/src/builtins/x64/builtins-x64.cc 2016-11-14 15:48:15.479017737 -0800
717+++ v8/src/builtins/x64/builtins-x64.cc 2016-11-14 15:08:43.249024943 -0800
718@@ -538,8 +538,8 @@ void Builtins::Generate_ResumeGeneratorT
719 // the generator was suspended.
720 FrameScope scope(masm, StackFrame::MANUAL);
721 __ PushReturnAddressFrom(rax); // Return address.
722- __ Push(rbp); // Caller's frame pointer.
723- __ Move(rbp, rsp);
724+ __ pushq(rbp); // Caller's frame pointer. // Don't change to Push( for x32 ABI
725+ __ movp(rbp, rsp); // Don't change to Move( for x32 ABI
726 __ Push(rsi); // Callee's context.
727 __ Push(rdi); // Callee's JS Function.
728
729@@ -645,8 +645,8 @@ void Builtins::Generate_InterpreterEntry
730 // MANUAL indicates that the scope shouldn't actually generate code to set up
731 // the frame (that is done below).
732 FrameScope frame_scope(masm, StackFrame::MANUAL);
733- __ pushq(rbp); // Caller's frame pointer.
734- __ movp(rbp, rsp);
735+ __ pushq(rbp); // Caller's frame pointer. // Don't change to Push( for x32 ABI
736+ __ movp(rbp, rsp); // Don't change to Move( for x32 ABI
737 __ Push(rsi); // Callee's context.
738 __ Push(rdi); // Callee's JS function.
739 __ Push(rdx); // Callee's new target.
740@@ -1149,8 +1149,8 @@ void Builtins::Generate_MarkCodeAsExecut
741
742 // Perform prologue operations usually performed by the young code stub.
743 __ PopReturnAddressTo(kScratchRegister);
744- __ pushq(rbp); // Caller's frame pointer.
745- __ movp(rbp, rsp);
746+ __ pushq(rbp); // Caller's frame pointer. // Don't change to Push( for x32 ABI
747+ __ movp(rbp, rsp); // Don't change to Move( for x32 ABI
748 __ Push(rsi); // Callee's context.
749 __ Push(rdi); // Callee's JS Function.
750 __ PushReturnAddressFrom(kScratchRegister);
751@@ -1679,7 +1679,12 @@ void Builtins::Generate_MathMaxMin(Macro
752 __ Push(rcx);
753 __ Push(rdx);
754 __ movp(rax, rbx);
755+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
756+ ToNumberStub stub(masm->isolate());
757+ __ CallStub(&stub);
758+#else
759 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
760+#endif
761 __ movp(rbx, rax);
762 __ Pop(rdx);
763 __ Pop(rcx);
764@@ -1770,7 +1775,12 @@ void Builtins::Generate_NumberConstructo
765 __ Integer32ToSmi(rax, rax);
766 __ EnterBuiltinFrame(rsi, rdi, rax);
767 __ movp(rax, rbx);
768+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
769+ ToNumberStub stub(masm->isolate());
770+ __ CallStub(&stub);
771+#else
772 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
773+#endif
774 __ LeaveBuiltinFrame(rsi, rdi, rbx); // Argc popped to rbx.
775 __ SmiToInteger32(rbx, rbx);
776 }
777@@ -1831,7 +1841,12 @@ void Builtins::Generate_NumberConstructo
778 __ EnterBuiltinFrame(rsi, rdi, r8);
779 __ Push(rdx);
780 __ Move(rax, rbx);
781+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
782+ ToNumberStub stub(masm->isolate());
783+ __ CallStub(&stub);
784+#else
785 __ Call(masm->isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
786+#endif
787 __ Move(rbx, rax);
788 __ Pop(rdx);
789 __ LeaveBuiltinFrame(rsi, rdi, r8);
790@@ -2153,6 +2168,7 @@ void Builtins::Generate_StringToNumber(M
791 __ Ret();
792 }
793
794+#if !(defined(__x86_64__) && __SIZEOF_POINTER__ == 4)
795 // static
796 void Builtins::Generate_ToNumber(MacroAssembler* masm) {
797 // The ToNumber stub takes one argument in rax.
798@@ -2171,6 +2187,7 @@ void Builtins::Generate_ToNumber(MacroAs
799 __ Jump(masm->isolate()->builtins()->NonNumberToNumber(),
800 RelocInfo::CODE_TARGET);
801 }
802+#endif
803
804 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
805 // ----------- S t a t e -------------
806@@ -2590,11 +2607,19 @@ void Builtins::Generate_CallFunction(Mac
807
808 __ LoadSharedFunctionInfoSpecialField(
809 rbx, rdx, SharedFunctionInfo::kFormalParameterCountOffset);
810+#if __SIZEOF_POINTER__ == 4
811+ __ movp(r8, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
812+#endif
813 ParameterCount actual(rax);
814 ParameterCount expected(rbx);
815
816+#if __SIZEOF_POINTER__ == 4
817+ __ InvokeFunctionCode(r8, no_reg, expected, actual, JUMP_FUNCTION,
818+ NullCallWrapper());
819+#else
820 __ InvokeFunctionCode(rdi, no_reg, expected, actual, JUMP_FUNCTION,
821 CheckDebugStepCallWrapper());
822+#endif
823
824 // The function is a "classConstructor", need to raise an exception.
825 __ bind(&class_constructor);
826diff -urp v8.t5.4.259/src/code-factory.cc v8/src/code-factory.cc
827--- v8.t5.4.259/src/code-factory.cc 2016-11-14 15:48:15.481017814 -0800
828+++ v8/src/code-factory.cc 2016-11-14 15:08:43.250024983 -0800
829@@ -138,29 +138,38 @@ Callable CodeFactory::InstanceOf(Isolate
830
831
832 // static
833-Callable CodeFactory::GetProperty(Isolate* isolate) {
834- GetPropertyStub stub(isolate);
835- return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
836-}
837-
838-// static
839 Callable CodeFactory::ToBoolean(Isolate* isolate) {
840+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
841+ ToBooleanStub stub(isolate);
842+ return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
843+#else
844 return Callable(isolate->builtins()->ToBoolean(),
845 TypeConversionDescriptor(isolate));
846+#endif
847 }
848
849
850 // static
851 Callable CodeFactory::ToNumber(Isolate* isolate) {
852+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
853+ ToNumberStub stub(isolate);
854+ return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
855+#else
856 return Callable(isolate->builtins()->ToNumber(),
857 TypeConversionDescriptor(isolate));
858+#endif
859 }
860
861
862 // static
863 Callable CodeFactory::NonNumberToNumber(Isolate* isolate) {
864+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
865+ NonNumberToNumberStub stub(isolate);
866+ return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
867+#else
868 return Callable(isolate->builtins()->NonNumberToNumber(),
869 TypeConversionDescriptor(isolate));
870+#endif
871 }
872
873 // static
874@@ -202,19 +211,6 @@ Callable CodeFactory::ToObject(Isolate*
875 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
876 }
877
878-// static
879-Callable CodeFactory::NonPrimitiveToPrimitive(Isolate* isolate,
880- ToPrimitiveHint hint) {
881- return Callable(isolate->builtins()->NonPrimitiveToPrimitive(hint),
882- TypeConversionDescriptor(isolate));
883-}
884-
885-// static
886-Callable CodeFactory::OrdinaryToPrimitive(Isolate* isolate,
887- OrdinaryToPrimitiveHint hint) {
888- return Callable(isolate->builtins()->OrdinaryToPrimitive(hint),
889- TypeConversionDescriptor(isolate));
890-}
891
892 // static
893 Callable CodeFactory::NumberToString(Isolate* isolate) {
894@@ -222,6 +218,7 @@ Callable CodeFactory::NumberToString(Iso
895 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
896 }
897
898+
899 // static
900 Callable CodeFactory::RegExpConstructResult(Isolate* isolate) {
901 RegExpConstructResultStub stub(isolate);
902@@ -478,8 +475,10 @@ Callable CodeFactory::FastNewContext(Iso
903
904
905 // static
906-Callable CodeFactory::FastNewClosure(Isolate* isolate) {
907- FastNewClosureStub stub(isolate);
908+Callable CodeFactory::FastNewClosure(Isolate* isolate,
909+ LanguageMode language_mode,
910+ FunctionKind kind) {
911+ FastNewClosureStub stub(isolate, language_mode, kind);
912 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
913 }
914
915diff -urp v8.t5.4.259/src/code-factory.h v8/src/code-factory.h
916--- v8.t5.4.259/src/code-factory.h 2016-11-14 15:48:15.481017814 -0800
917+++ v8/src/code-factory.h 2016-11-14 15:08:43.250024983 -0800
918@@ -65,8 +65,6 @@ class CodeFactory final {
919 // code-stubs.h.
920 static Callable InstanceOf(Isolate* isolate);
921
922- static Callable GetProperty(Isolate* isolate);
923-
924 static Callable ToBoolean(Isolate* isolate);
925
926 static Callable ToNumber(Isolate* isolate);
927@@ -77,10 +75,6 @@ class CodeFactory final {
928 static Callable ToInteger(Isolate* isolate);
929 static Callable ToLength(Isolate* isolate);
930 static Callable ToObject(Isolate* isolate);
931- static Callable NonPrimitiveToPrimitive(
932- Isolate* isolate, ToPrimitiveHint hint = ToPrimitiveHint::kDefault);
933- static Callable OrdinaryToPrimitive(Isolate* isolate,
934- OrdinaryToPrimitiveHint hint);
935 static Callable NumberToString(Isolate* isolate);
936
937 static Callable RegExpConstructResult(Isolate* isolate);
938@@ -126,7 +120,8 @@ class CodeFactory final {
939 static Callable FastCloneShallowObject(Isolate* isolate, int length);
940
941 static Callable FastNewContext(Isolate* isolate, int slot_count);
942- static Callable FastNewClosure(Isolate* isolate);
943+ static Callable FastNewClosure(Isolate* isolate, LanguageMode language_mode,
944+ FunctionKind kind);
945 static Callable FastNewObject(Isolate* isolate);
946 static Callable FastNewRestParameter(Isolate* isolate,
947 bool skip_stub_frame = false);
948diff -urp v8.t5.4.259/src/code-stub-assembler.cc v8/src/code-stub-assembler.cc
949--- v8.t5.4.259/src/code-stub-assembler.cc 2016-11-14 15:48:15.483017891 -0800
950+++ v8/src/code-stub-assembler.cc 2016-11-14 15:08:43.251025022 -0800
951@@ -605,79 +605,6 @@ Node* CodeStubAssembler::InnerAllocate(N
952 return InnerAllocate(previous, IntPtrConstant(offset));
953 }
954
955-void CodeStubAssembler::BranchIfToBooleanIsTrue(Node* value, Label* if_true,
956- Label* if_false) {
957- Label if_valueissmi(this), if_valueisnotsmi(this), if_valueisstring(this),
958- if_valueisheapnumber(this), if_valueisother(this);
959-
960- // Fast check for Boolean {value}s (common case).
961- GotoIf(WordEqual(value, BooleanConstant(true)), if_true);
962- GotoIf(WordEqual(value, BooleanConstant(false)), if_false);
963-
964- // Check if {value} is a Smi or a HeapObject.
965- Branch(WordIsSmi(value), &if_valueissmi, &if_valueisnotsmi);
966-
967- Bind(&if_valueissmi);
968- {
969- // The {value} is a Smi, only need to check against zero.
970- BranchIfSmiEqual(value, SmiConstant(0), if_false, if_true);
971- }
972-
973- Bind(&if_valueisnotsmi);
974- {
975- // The {value} is a HeapObject, load its map.
976- Node* value_map = LoadMap(value);
977-
978- // Load the {value}s instance type.
979- Node* value_instance_type = LoadMapInstanceType(value_map);
980-
981- // Dispatch based on the instance type; we distinguish all String instance
982- // types, the HeapNumber type and everything else.
983- GotoIf(Word32Equal(value_instance_type, Int32Constant(HEAP_NUMBER_TYPE)),
984- &if_valueisheapnumber);
985- Branch(
986- Int32LessThan(value_instance_type, Int32Constant(FIRST_NONSTRING_TYPE)),
987- &if_valueisstring, &if_valueisother);
988-
989- Bind(&if_valueisstring);
990- {
991- // Load the string length field of the {value}.
992- Node* value_length = LoadObjectField(value, String::kLengthOffset);
993-
994- // Check if the {value} is the empty string.
995- BranchIfSmiEqual(value_length, SmiConstant(0), if_false, if_true);
996- }
997-
998- Bind(&if_valueisheapnumber);
999- {
1000- // Load the floating point value of {value}.
1001- Node* value_value = LoadObjectField(value, HeapNumber::kValueOffset,
1002- MachineType::Float64());
1003-
1004- // Check if the floating point {value} is neither 0.0, -0.0 nor NaN.
1005- Node* zero = Float64Constant(0.0);
1006- GotoIf(Float64LessThan(zero, value_value), if_true);
1007- BranchIfFloat64LessThan(value_value, zero, if_true, if_false);
1008- }
1009-
1010- Bind(&if_valueisother);
1011- {
1012- // Load the bit field from the {value}s map. The {value} is now either
1013- // Null or Undefined, which have the undetectable bit set (so we always
1014- // return false for those), or a Symbol or Simd128Value, whose maps never
1015- // have the undetectable bit set (so we always return true for those), or
1016- // a JSReceiver, which may or may not have the undetectable bit set.
1017- Node* value_map_bitfield = LoadMapBitField(value_map);
1018- Node* value_map_undetectable = Word32And(
1019- value_map_bitfield, Int32Constant(1 << Map::kIsUndetectable));
1020-
1021- // Check if the {value} is undetectable.
1022- BranchIfWord32Equal(value_map_undetectable, Int32Constant(0), if_true,
1023- if_false);
1024- }
1025- }
1026-}
1027-
1028 compiler::Node* CodeStubAssembler::LoadFromFrame(int offset, MachineType rep) {
1029 Node* frame_pointer = LoadFramePointer();
1030 return Load(rep, frame_pointer, IntPtrConstant(offset));
1031@@ -1115,6 +1042,10 @@ Node* CodeStubAssembler::AllocateJSArray
1032 }
1033 }
1034 } else {
1035+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
1036+ // TODO(danno): Add a loop for initialization
1037+ UNIMPLEMENTED();
1038+#else
1039 Variable current(this, MachineRepresentation::kTagged);
1040 Label test(this);
1041 Label decrement(this, ¤t);
1042@@ -1158,6 +1089,7 @@ Node* CodeStubAssembler::AllocateJSArray
1043 Branch(compare, &decrement, &done);
1044
1045 Bind(&done);
1046+#endif
1047 }
1048
1049 return array;
1050diff -urp v8.t5.4.259/src/code-stub-assembler.h v8/src/code-stub-assembler.h
1051--- v8.t5.4.259/src/code-stub-assembler.h 2016-11-14 15:48:15.483017891 -0800
1052+++ v8/src/code-stub-assembler.h 2016-11-14 15:08:43.251025022 -0800
1053@@ -99,11 +99,6 @@ class CodeStubAssembler : public compile
1054 // Check that the value is a positive smi.
1055 compiler::Node* WordIsPositiveSmi(compiler::Node* a);
1056
1057- void BranchIfSmiEqual(compiler::Node* a, compiler::Node* b, Label* if_true,
1058- Label* if_false) {
1059- BranchIf(SmiEqual(a, b), if_true, if_false);
1060- }
1061-
1062 void BranchIfSmiLessThan(compiler::Node* a, compiler::Node* b, Label* if_true,
1063 Label* if_false) {
1064 BranchIf(SmiLessThan(a, b), if_true, if_false);
1065@@ -119,11 +114,6 @@ class CodeStubAssembler : public compile
1066 BranchIfFloat64Equal(value, value, if_false, if_true);
1067 }
1068
1069- // Branches to {if_true} if ToBoolean applied to {value} yields true,
1070- // otherwise goes to {if_false}.
1071- void BranchIfToBooleanIsTrue(compiler::Node* value, Label* if_true,
1072- Label* if_false);
1073-
1074 // Load value from current frame by given offset in bytes.
1075 compiler::Node* LoadFromFrame(int offset,
1076 MachineType rep = MachineType::AnyTagged());
1077diff -urp v8.t5.4.259/src/code-stubs-hydrogen.cc v8/src/code-stubs-hydrogen.cc
1078--- v8.t5.4.259/src/code-stubs-hydrogen.cc 2016-11-14 15:48:15.485017968 -0800
1079+++ v8/src/code-stubs-hydrogen.cc 2016-11-14 15:08:43.252025061 -0800
1080@@ -83,6 +83,29 @@ class CodeStubGraphBuilderBase : public
1081 HValue* BuildPushElement(HValue* object, HValue* argc,
1082 HValue* argument_elements, ElementsKind kind);
1083
1084+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
1085+ enum ArgumentClass {
1086+ NONE,
1087+ SINGLE,
1088+ MULTIPLE
1089+ };
1090+ HValue* BuildArrayConstructor(ElementsKind kind,
1091+ AllocationSiteOverrideMode override_mode);
1092+ HValue* BuildInternalArrayConstructor(ElementsKind kind);
1093+#endif
1094+
1095+#if !(defined(__x86_64__) && __SIZEOF_POINTER__ == 4)
1096+ HValue* BuildArrayConstructor(ElementsKind kind,
1097+ AllocationSiteOverrideMode override_mode);
1098+ HValue* BuildInternalArrayConstructor(ElementsKind kind);
1099+#else
1100+ HValue* BuildArrayConstructor(ElementsKind kind,
1101+ AllocationSiteOverrideMode override_mode,
1102+ ArgumentClass argument_class);
1103+ HValue* BuildInternalArrayConstructor(ElementsKind kind,
1104+ ArgumentClass argument_class);
1105+#endif
1106+
1107 HValue* UnmappedCase(HValue* elements, HValue* key, HValue* value);
1108 HValue* EmitKeyedSloppyArguments(HValue* receiver, HValue* key,
1109 HValue* value);
1110@@ -91,6 +114,11 @@ class CodeStubGraphBuilderBase : public
1111 HValue* BuildToPrimitive(HValue* input, HValue* input_map);
1112
1113 private:
1114+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
1115+ HValue* BuildArraySingleArgumentConstructor(JSArrayBuilder* builder);
1116+ HValue* BuildArrayNArgumentsConstructor(JSArrayBuilder* builder,
1117+ ElementsKind kind);
1118+#endif
1119 std::unique_ptr<HParameter* []> parameters_;
1120 HValue* arguments_length_;
1121 CompilationInfo* info_;
1122@@ -100,6 +128,133 @@ class CodeStubGraphBuilderBase : public
1123 };
1124
1125
1126+#if !(defined(__x86_64__) && __SIZEOF_POINTER__ == 4)
1127+HValue* CodeStubGraphBuilderBase::BuildArrayConstructor(
1128+ ElementsKind kind, AllocationSiteOverrideMode override_mode) {
1129+ HValue* constructor = GetParameter(ArrayConstructorStubBase::kConstructor);
1130+ HValue* alloc_site = GetParameter(ArrayConstructorStubBase::kAllocationSite);
1131+ JSArrayBuilder array_builder(this, kind, alloc_site, constructor,
1132+ override_mode);
1133+ return BuildArrayNArgumentsConstructor(&array_builder, kind);
1134+}
1135+#else
1136+HValue* CodeStubGraphBuilderBase::BuildArrayConstructor(
1137+ ElementsKind kind,
1138+ AllocationSiteOverrideMode override_mode,
1139+ ArgumentClass argument_class) {
1140+ HValue* constructor = GetParameter(ArrayConstructorStubBase::kConstructor);
1141+ HValue* alloc_site = GetParameter(ArrayConstructorStubBase::kAllocationSite);
1142+ JSArrayBuilder array_builder(this, kind, alloc_site, constructor,
1143+ override_mode);
1144+ HValue* result = NULL;
1145+ switch (argument_class) {
1146+ case NONE:
1147+ // This stub is very performance sensitive, the generated code must be
1148+ // tuned so that it doesn't build and eager frame.
1149+ info()->MarkMustNotHaveEagerFrame();
1150+ result = array_builder.AllocateEmptyArray();
1151+ break;
1152+ case SINGLE:
1153+ result = BuildArraySingleArgumentConstructor(&array_builder);
1154+ break;
1155+ case MULTIPLE:
1156+ result = BuildArrayNArgumentsConstructor(&array_builder, kind);
1157+ break;
1158+ }
1159+
1160+ return result;
1161+}
1162+
1163+HValue* CodeStubGraphBuilderBase::BuildArraySingleArgumentConstructor(
1164+ JSArrayBuilder* array_builder) {
1165+ // Smi check and range check on the input arg.
1166+ HValue* constant_one = graph()->GetConstant1();
1167+ HValue* constant_zero = graph()->GetConstant0();
1168+ HInstruction* elements = Add<HArgumentsElements>(false);
1169+ HInstruction* argument = Add<HAccessArgumentsAt>(
1170+ elements, constant_one, constant_zero);
1171+ return BuildAllocateArrayFromLength(array_builder, argument);
1172+}
1173+
1174+HValue* CodeStubGraphBuilderBase::BuildArrayNArgumentsConstructor(
1175+ JSArrayBuilder* array_builder, ElementsKind kind) {
1176+ // Insert a bounds check because the number of arguments might exceed
1177+ // the kInitialMaxFastElementArray limit. This cannot happen for code
1178+ // that was parsed, but calling via Array.apply(thisArg, [...]) might
1179+ // trigger it.
1180+ HValue* length = GetArgumentsLength();
1181+ HConstant* max_alloc_length =
1182+ Add<HConstant>(JSArray::kInitialMaxFastElementArray);
1183+ HValue* checked_length = Add<HBoundsCheck>(length, max_alloc_length);
1184+ // We need to fill with the hole if it's a smi array in the multi-argument
1185+ // case because we might have to bail out while copying arguments into
1186+ // the array because they aren't compatible with a smi array.
1187+ // If it's a double array, no problem, and if it's fast then no
1188+ // problem either because doubles are boxed.
1189+ //
1190+ // TODO(mvstanton): consider an instruction to memset fill the array
1191+ // with zero in this case instead.
1192+ JSArrayBuilder::FillMode fill_mode = IsFastSmiElementsKind(kind)
1193+ ? JSArrayBuilder::FILL_WITH_HOLE
1194+ : JSArrayBuilder::DONT_FILL_WITH_HOLE;
1195+// max_alloc_length,
1196+ HValue* new_object = array_builder->AllocateArray(checked_length,
1197+ checked_length,
1198+ fill_mode);
1199+ HValue* elements = array_builder->GetElementsLocation();
1200+ DCHECK(elements != NULL);
1201+ // Now populate the elements correctly.
1202+ LoopBuilder builder(this,
1203+ context(),
1204+ LoopBuilder::kPostIncrement);
1205+ HValue* start = graph()->GetConstant0();
1206+ HValue* key = builder.BeginBody(start, checked_length, Token::LT);
1207+ HInstruction* argument_elements = Add<HArgumentsElements>(false);
1208+ HInstruction* argument = Add<HAccessArgumentsAt>(
1209+ argument_elements, checked_length, key);
1210+ Add<HStoreKeyed>(elements, key, argument, nullptr, kind);
1211+ builder.EndBody();
1212+ return new_object;
1213+}
1214+
1215+#endif
1216+
1217+#if !(defined(__x86_64__) && __SIZEOF_POINTER__ == 4)
1218+HValue* CodeStubGraphBuilderBase::BuildInternalArrayConstructor(
1219+ ElementsKind kind) {
1220+ ElementsKind kind, ArgumentClass argument_class) {
1221+ HValue* constructor = GetParameter(
1222+ InternalArrayConstructorStubBase::kConstructor);
1223+ JSArrayBuilder array_builder(this, kind, constructor);
1224+ return BuildArrayNArgumentsConstructor(&array_builder, kind);
1225+}
1226+
1227+#else
1228+HValue* CodeStubGraphBuilderBase::BuildInternalArrayConstructor(
1229+ ElementsKind kind, ArgumentClass argument_class) {
1230+ HValue* constructor = GetParameter(
1231+ InternalArrayConstructorStubBase::kConstructor);
1232+ JSArrayBuilder array_builder(this, kind, constructor);
1233+
1234+ HValue* result = NULL;
1235+ switch (argument_class) {
1236+ case NONE:
1237+ // This stub is very performance sensitive, the generated code must be
1238+ // tuned so that it doesn't build and eager frame.
1239+ info()->MarkMustNotHaveEagerFrame();
1240+ result = array_builder.AllocateEmptyArray();
1241+ break;
1242+ case SINGLE:
1243+ result = BuildArraySingleArgumentConstructor(&array_builder);
1244+ break;
1245+ case MULTIPLE:
1246+ result = BuildArrayNArgumentsConstructor(&array_builder, kind);
1247+ break;
1248+ }
1249+ return result;
1250+}
1251+#endif
1252+
1253 bool CodeStubGraphBuilderBase::BuildGraph() {
1254 // Update the static counter each time a new code stub is generated.
1255 isolate()->counters()->code_stubs()->Increment();
1256@@ -298,6 +453,85 @@ Handle<Code> NumberToStringStub::Generat
1257 return DoGenerateCode(this);
1258 }
1259
1260+#if !(defined(__x86_64__) && __SIZEOF_POINTER__ == 4)
1261+template <>
1262+HValue* CodeStubGraphBuilder<ArrayNArgumentsConstructorStub>::BuildCodeStub() {
1263+ ElementsKind kind = casted_stub()->elements_kind();
1264+ AllocationSiteOverrideMode override_mode = casted_stub()->override_mode();
1265+ return BuildArrayConstructor(kind, override_mode);
1266+}
1267+
1268+template <>
1269+HValue* CodeStubGraphBuilder<InternalArrayNArgumentsConstructorStub>::
1270+ BuildCodeStub() {
1271+ ElementsKind kind = casted_stub()->elements_kind();
1272+ return BuildInternalArrayConstructor(kind);
1273+}
1274+
1275+template <>
1276+HValue* CodeStubGraphBuilder<ArrayNArgumentsConstructorStub>::BuildCodeStub() {
1277+ ElementsKind kind = casted_stub()->elements_kind();
1278+ AllocationSiteOverrideMode override_mode = casted_stub()->override_mode();
1279+ return BuildArrayConstructor(kind, override_mode, MULTIPLE);
1280+}
1281+
1282+template <>
1283+HValue* CodeStubGraphBuilder<InternalArrayNArgumentsConstructorStub>::
1284+ BuildCodeStub() {
1285+ ElementsKind kind = casted_stub()->elements_kind();
1286+ return BuildInternalArrayConstructor(kind, MULTIPLE);
1287+}
1288+
1289+#else
1290+template <>
1291+HValue* CodeStubGraphBuilder<ArrayNoArgumentConstructorStub>::BuildCodeStub() {
1292+ ElementsKind kind = casted_stub()->elements_kind();
1293+ AllocationSiteOverrideMode override_mode = casted_stub()->override_mode();
1294+ return BuildArrayConstructor(kind, override_mode, NONE);
1295+}
1296+
1297+Handle<Code> ArrayNoArgumentConstructorStub::GenerateCode() {
1298+ return DoGenerateCode(this);
1299+}
1300+
1301+template <>
1302+HValue* CodeStubGraphBuilder<InternalArrayNoArgumentConstructorStub>::
1303+ BuildCodeStub() {
1304+ ElementsKind kind = casted_stub()->elements_kind();
1305+ return BuildInternalArrayConstructor(kind, NONE);
1306+}
1307+
1308+Handle<Code> InternalArrayNoArgumentConstructorStub::GenerateCode() {
1309+ return DoGenerateCode(this);
1310+}
1311+
1312+template <>
1313+HValue* CodeStubGraphBuilder<ArraySingleArgumentConstructorStub>::
1314+ BuildCodeStub() {
1315+ ElementsKind kind = casted_stub()->elements_kind();
1316+ AllocationSiteOverrideMode override_mode = casted_stub()->override_mode();
1317+ return BuildArrayConstructor(kind, override_mode, SINGLE);
1318+}
1319+
1320+Handle<Code> ArraySingleArgumentConstructorStub::GenerateCode() {
1321+ return DoGenerateCode(this);
1322+}
1323+
1324+template <>
1325+HValue* CodeStubGraphBuilder<InternalArraySingleArgumentConstructorStub>::
1326+ BuildCodeStub() {
1327+ ElementsKind kind = casted_stub()->elements_kind();
1328+ return BuildInternalArrayConstructor(kind, SINGLE);
1329+}
1330+
1331+
1332+Handle<Code> InternalArraySingleArgumentConstructorStub::GenerateCode() {
1333+ return DoGenerateCode(this);
1334+}
1335+
1336+#endif
1337+
1338+
1339
1340 // Returns the type string of a value; see ECMA-262, 11.4.3 (p 47).
1341 template <>
1342@@ -1516,6 +1750,115 @@ Handle<Code> TransitionElementsKindStub:
1343 return DoGenerateCode(this);
1344 }
1345
1346+#if 1
1347+HValue* CodeStubGraphBuilderBase::BuildArrayConstructor(
1348+ ElementsKind kind, AllocationSiteOverrideMode override_mode) {
1349+ HValue* constructor = GetParameter(ArrayConstructorStubBase::kConstructor);
1350+ HValue* alloc_site = GetParameter(ArrayConstructorStubBase::kAllocationSite);
1351+ JSArrayBuilder array_builder(this, kind, alloc_site, constructor,
1352+ override_mode);
1353+ return BuildArrayNArgumentsConstructor(&array_builder, kind);
1354+}
1355+#endif
1356+
1357+#if 1
1358+HValue* CodeStubGraphBuilderBase::BuildInternalArrayConstructor(
1359+ ElementsKind kind) {
1360+ HValue* constructor = GetParameter(
1361+ InternalArrayConstructorStubBase::kConstructor);
1362+ JSArrayBuilder array_builder(this, kind, constructor);
1363+ return BuildArrayNArgumentsConstructor(&array_builder, kind);
1364+}
1365+#endif
1366+
1367+#if 0
1368+HValue* CodeStubGraphBuilderBase::BuildArraySingleArgumentConstructor(
1369+ JSArrayBuilder* array_builder) {
1370+ // Smi check and range check on the input arg.
1371+ HValue* constant_one = graph()->GetConstant1();
1372+ HValue* constant_zero = graph()->GetConstant0();
1373+
1374+ HInstruction* elements = Add<HArgumentsElements>(false);
1375+ HInstruction* argument = Add<HAccessArgumentsAt>(
1376+ elements, constant_one, constant_zero);
1377+
1378+ return BuildAllocateArrayFromLength(array_builder, argument);
1379+}
1380+#endif
1381+
1382+#if 0
1383+HValue* CodeStubGraphBuilderBase::BuildArrayNArgumentsConstructor(
1384+ JSArrayBuilder* array_builder, ElementsKind kind) {
1385+ // Insert a bounds check because the number of arguments might exceed
1386+ // the kInitialMaxFastElementArray limit. This cannot happen for code
1387+ // that was parsed, but calling via Array.apply(thisArg, [...]) might
1388+ // trigger it.
1389+ HValue* length = GetArgumentsLength();
1390+ HConstant* max_alloc_length =
1391+ Add<HConstant>(JSArray::kInitialMaxFastElementArray);
1392+ HValue* checked_length = Add<HBoundsCheck>(length, max_alloc_length);
1393+
1394+ // We need to fill with the hole if it's a smi array in the multi-argument
1395+ // case because we might have to bail out while copying arguments into
1396+ // the array because they aren't compatible with a smi array.
1397+ // If it's a double array, no problem, and if it's fast then no
1398+ // problem either because doubles are boxed.
1399+ //
1400+ // TODO(mvstanton): consider an instruction to memset fill the array
1401+ // with zero in this case instead.
1402+ JSArrayBuilder::FillMode fill_mode = IsFastSmiElementsKind(kind)
1403+ ? JSArrayBuilder::FILL_WITH_HOLE
1404+ : JSArrayBuilder::DONT_FILL_WITH_HOLE;
1405+ HValue* new_object = array_builder->AllocateArray(checked_length,
1406+ checked_length,
1407+ fill_mode);
1408+ HValue* elements = array_builder->GetElementsLocation();
1409+ DCHECK(elements != NULL);
1410+
1411+ // Now populate the elements correctly.
1412+ LoopBuilder builder(this,
1413+ context(),
1414+ LoopBuilder::kPostIncrement);
1415+ HValue* start = graph()->GetConstant0();
1416+ HValue* key = builder.BeginBody(start, checked_length, Token::LT);
1417+ HInstruction* argument_elements = Add<HArgumentsElements>(false);
1418+ HInstruction* argument = Add<HAccessArgumentsAt>(
1419+ argument_elements, checked_length, key);
1420+
1421+ Add<HStoreKeyed>(elements, key, argument, nullptr, kind);
1422+ builder.EndBody();
1423+ return new_object;
1424+}
1425+#endif
1426+
1427+#if 1
1428+template <>
1429+HValue* CodeStubGraphBuilder<ArrayNArgumentsConstructorStub>::BuildCodeStub() {
1430+ ElementsKind kind = casted_stub()->elements_kind();
1431+ AllocationSiteOverrideMode override_mode = casted_stub()->override_mode();
1432+ return BuildArrayConstructor(kind, override_mode);
1433+}
1434+
1435+Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode() {
1436+ return DoGenerateCode(this);
1437+}
1438+#endif
1439+
1440+#if 1
1441+template <>
1442+HValue* CodeStubGraphBuilder<InternalArrayNArgumentsConstructorStub>::
1443+ BuildCodeStub() {
1444+ ElementsKind kind = casted_stub()->elements_kind();
1445+ return BuildInternalArrayConstructor(kind);
1446+}
1447+
1448+
1449+Handle<Code> InternalArrayNArgumentsConstructorStub::GenerateCode() {
1450+ return DoGenerateCode(this);
1451+}
1452+#endif
1453+
1454+
1455 template <>
1456 HValue* CodeStubGraphBuilder<BinaryOpICStub>::BuildCodeInitializedStub() {
1457 BinaryOpICState state = casted_stub()->state();
1458@@ -1592,7 +1935,6 @@ Handle<Code> BinaryOpICStub::GenerateCod
1459 return DoGenerateCode(this);
1460 }
1461
1462-
1463 template <>
1464 HValue* CodeStubGraphBuilder<BinaryOpWithAllocationSiteStub>::BuildCodeStub() {
1465 BinaryOpICState state = casted_stub()->state();
1466@@ -1947,6 +2289,66 @@ Handle<Code> LoadDictionaryElementStub::
1467 return DoGenerateCode(this);
1468 }
1469
1470+
1471+
1472+template<>
1473+HValue* CodeStubGraphBuilder<FastNewClosureStub>::BuildCodeStub() {
1474+ Counters* counters = isolate()->counters();
1475+ Factory* factory = isolate()->factory();
1476+ HInstruction* empty_fixed_array =
1477+ Add<HConstant>(factory->empty_fixed_array());
1478+ HInstruction* empty_literals_array =
1479+ Add<HConstant>(factory->empty_literals_array());
1480+ HValue* shared_info = GetParameter(0);
1481+
1482+ AddIncrementCounter(counters->fast_new_closure_total());
1483+
1484+ // Create a new closure from the given function info in new space
1485+ HValue* size = Add<HConstant>(JSFunction::kSize);
1486+ HInstruction* js_function =
1487+ Add<HAllocate>(size, HType::JSObject(), NOT_TENURED, JS_FUNCTION_TYPE,
1488+ graph()->GetConstant0());
1489+
1490+ int map_index = Context::FunctionMapIndex(casted_stub()->language_mode(),
1491+ casted_stub()->kind());
1492+
1493+ // Compute the function map in the current native context and set that
1494+ // as the map of the allocated object.
1495+ HInstruction* native_context = BuildGetNativeContext();
1496+ HInstruction* map_slot_value = Add<HLoadNamedField>(
1497+ native_context, nullptr, HObjectAccess::ForContextSlot(map_index));
1498+ Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value);
1499+
1500+ // Initialize the rest of the function.
1501+ Add<HStoreNamedField>(js_function, HObjectAccess::ForPropertiesPointer(),
1502+ empty_fixed_array);
1503+ Add<HStoreNamedField>(js_function, HObjectAccess::ForElementsPointer(),
1504+ empty_fixed_array);
1505+ Add<HStoreNamedField>(js_function, HObjectAccess::ForLiteralsPointer(),
1506+ empty_literals_array);
1507+ Add<HStoreNamedField>(js_function, HObjectAccess::ForPrototypeOrInitialMap(),
1508+ graph()->GetConstantHole());
1509+ Add<HStoreNamedField>(
1510+ js_function, HObjectAccess::ForSharedFunctionInfoPointer(), shared_info);
1511+ Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(),
1512+ context());
1513+
1514+ Handle<Code> lazy_builtin(
1515+ isolate()->builtins()->builtin(Builtins::kCompileLazy));
1516+ HConstant* lazy = Add<HConstant>(lazy_builtin);
1517+ Add<HStoreCodeEntry>(js_function, lazy);
1518+ Add<HStoreNamedField>(js_function,
1519+ HObjectAccess::ForNextFunctionLinkPointer(),
1520+ graph()->GetConstantUndefined());
1521+
1522+ return js_function;
1523+}
1524+
1525+
1526+Handle<Code> FastNewClosureStub::GenerateCode() {
1527+ return DoGenerateCode(this);
1528+}
1529+
1530
1531 template<>
1532 HValue* CodeStubGraphBuilder<RegExpConstructResultStub>::BuildCodeStub() {
1533diff -urp v8.t5.4.259/src/code-stubs.cc v8/src/code-stubs.cc
1534--- v8.t5.4.259/src/code-stubs.cc 2016-11-14 15:48:15.487018045 -0800
1535+++ v8/src/code-stubs.cc 2016-11-14 15:19:37.582563345 -0800
1536@@ -67,6 +67,7 @@ void CodeStubDescriptor::Initialize(Regi
1537 }
1538
1539
1540+
1541 bool CodeStub::FindCodeInCache(Code** code_out) {
1542 UnseededNumberDictionary* stubs = isolate()->heap()->code_stubs();
1543 int index = stubs->FindEntry(GetKey());
1544@@ -619,9 +620,9 @@ compiler::Node* AddStub::Generate(CodeSt
1545 assembler->Bind(&if_rhsisreceiver);
1546 {
1547 // Convert {rhs} to a primitive first passing no hint.
1548- Callable callable =
1549- CodeFactory::NonPrimitiveToPrimitive(assembler->isolate());
1550- var_rhs.Bind(assembler->CallStub(callable, context, rhs));
1551+ // TODO(bmeurer): Hook up ToPrimitiveStub here, once it's there.
1552+ var_rhs.Bind(
1553+ assembler->CallRuntime(Runtime::kToPrimitive, context, rhs));
1554 assembler->Goto(&loop);
1555 }
1556
1557@@ -697,9 +698,9 @@ compiler::Node* AddStub::Generate(CodeSt
1558 assembler->Bind(&if_lhsisreceiver);
1559 {
1560 // Convert {lhs} to a primitive first passing no hint.
1561- Callable callable =
1562- CodeFactory::NonPrimitiveToPrimitive(assembler->isolate());
1563- var_lhs.Bind(assembler->CallStub(callable, context, lhs));
1564+ // TODO(bmeurer): Hook up ToPrimitiveStub here, once it's there.
1565+ var_lhs.Bind(
1566+ assembler->CallRuntime(Runtime::kToPrimitive, context, lhs));
1567 assembler->Goto(&loop);
1568 }
1569
1570@@ -774,9 +775,9 @@ compiler::Node* AddStub::Generate(CodeSt
1571 assembler->Bind(&if_rhsisreceiver);
1572 {
1573 // Convert {rhs} to a primitive first passing no hint.
1574- Callable callable = CodeFactory::NonPrimitiveToPrimitive(
1575- assembler->isolate());
1576- var_rhs.Bind(assembler->CallStub(callable, context, rhs));
1577+ // TODO(bmeurer): Hook up ToPrimitiveStub here too.
1578+ var_rhs.Bind(assembler->CallRuntime(Runtime::kToPrimitive,
1579+ context, rhs));
1580 assembler->Goto(&loop);
1581 }
1582
1583@@ -805,9 +806,9 @@ compiler::Node* AddStub::Generate(CodeSt
1584 assembler->Bind(&if_lhsisreceiver);
1585 {
1586 // Convert {lhs} to a primitive first passing no hint.
1587- Callable callable =
1588- CodeFactory::NonPrimitiveToPrimitive(assembler->isolate());
1589- var_lhs.Bind(assembler->CallStub(callable, context, lhs));
1590+ // TODO(bmeurer): Hook up ToPrimitiveStub here, once it's there.
1591+ var_lhs.Bind(assembler->CallRuntime(Runtime::kToPrimitive,
1592+ context, lhs));
1593 assembler->Goto(&loop);
1594 }
1595
1596@@ -825,9 +826,9 @@ compiler::Node* AddStub::Generate(CodeSt
1597 assembler->Bind(&if_rhsisreceiver);
1598 {
1599 // Convert {rhs} to a primitive first passing no hint.
1600- Callable callable = CodeFactory::NonPrimitiveToPrimitive(
1601- assembler->isolate());
1602- var_rhs.Bind(assembler->CallStub(callable, context, rhs));
1603+ // TODO(bmeurer): Hook up ToPrimitiveStub here too.
1604+ var_rhs.Bind(assembler->CallRuntime(Runtime::kToPrimitive,
1605+ context, rhs));
1606 assembler->Goto(&loop);
1607 }
1608
1609@@ -2165,9 +2166,9 @@ compiler::Node* GenerateAbstractRelation
1610 assembler->Bind(&if_rhsisreceiver);
1611 {
1612 // Convert {rhs} to a primitive first passing Number hint.
1613- Callable callable = CodeFactory::NonPrimitiveToPrimitive(
1614- assembler->isolate(), ToPrimitiveHint::kNumber);
1615- var_rhs.Bind(assembler->CallStub(callable, context, rhs));
1616+ // TODO(bmeurer): Hook up ToPrimitiveStub here, once it's there.
1617+ var_rhs.Bind(assembler->CallRuntime(
1618+ Runtime::kToPrimitive_Number, context, rhs));
1619 assembler->Goto(&loop);
1620 }
1621
1622@@ -2199,9 +2200,9 @@ compiler::Node* GenerateAbstractRelation
1623 assembler->Bind(&if_lhsisreceiver);
1624 {
1625 // Convert {lhs} to a primitive first passing Number hint.
1626- Callable callable = CodeFactory::NonPrimitiveToPrimitive(
1627- assembler->isolate(), ToPrimitiveHint::kNumber);
1628- var_lhs.Bind(assembler->CallStub(callable, context, lhs));
1629+ // TODO(bmeurer): Hook up ToPrimitiveStub here, once it's there.
1630+ var_lhs.Bind(assembler->CallRuntime(Runtime::kToPrimitive_Number,
1631+ context, lhs));
1632 assembler->Goto(&loop);
1633 }
1634
1635@@ -2525,9 +2526,9 @@ compiler::Node* GenerateEqual(CodeStubAs
1636 assembler->Bind(&if_rhsisreceiver);
1637 {
1638 // Convert {rhs} to a primitive first (passing no hint).
1639- Callable callable = CodeFactory::NonPrimitiveToPrimitive(
1640- assembler->isolate());
1641- var_rhs.Bind(assembler->CallStub(callable, context, rhs));
1642+ // TODO(bmeurer): Hook up ToPrimitiveStub here once it exists.
1643+ var_rhs.Bind(assembler->CallRuntime(Runtime::kToPrimitive,
1644+ context, rhs));
1645 assembler->Goto(&loop);
1646 }
1647
1648@@ -2883,9 +2884,9 @@ compiler::Node* GenerateEqual(CodeStubAs
1649 {
1650 // The {rhs} is some Primitive different from Null and
1651 // Undefined, need to convert {lhs} to Primitive first.
1652- Callable callable =
1653- CodeFactory::NonPrimitiveToPrimitive(assembler->isolate());
1654- var_lhs.Bind(assembler->CallStub(callable, context, lhs));
1655+ // TODO(bmeurer): Hook up ToPrimitiveStub here once it exists.
1656+ var_lhs.Bind(assembler->CallRuntime(Runtime::kToPrimitive,
1657+ context, lhs));
1658 assembler->Goto(&loop);
1659 }
1660 }
1661@@ -3741,6 +3742,130 @@ void ToLengthStub::GenerateAssembly(Code
1662 }
1663 }
1664
1665+// static
1666+compiler::Node* ToBooleanStub::Generate(CodeStubAssembler* assembler,
1667+ compiler::Node* value,
1668+ compiler::Node* context) {
1669+ typedef compiler::Node Node;
1670+ typedef CodeStubAssembler::Label Label;
1671+ typedef CodeStubAssembler::Variable Variable;
1672+
1673+ Variable result(assembler, MachineRepresentation::kTagged);
1674+ Label if_valueissmi(assembler), if_valueisnotsmi(assembler),
1675+ return_true(assembler), return_false(assembler), end(assembler);
1676+
1677+ // Check if {value} is a Smi or a HeapObject.
1678+ assembler->Branch(assembler->WordIsSmi(value), &if_valueissmi,
1679+ &if_valueisnotsmi);
1680+
1681+ assembler->Bind(&if_valueissmi);
1682+ {
1683+ // The {value} is a Smi, only need to check against zero.
1684+ assembler->Branch(assembler->SmiEqual(value, assembler->SmiConstant(0)),
1685+ &return_false, &return_true);
1686+ }
1687+
1688+ assembler->Bind(&if_valueisnotsmi);
1689+ {
1690+ Label if_valueisstring(assembler), if_valueisnotstring(assembler),
1691+ if_valueisheapnumber(assembler), if_valueisoddball(assembler),
1692+ if_valueisother(assembler);
1693+
1694+ // The {value} is a HeapObject, load its map.
1695+ Node* value_map = assembler->LoadMap(value);
1696+
1697+ // Load the {value}s instance type.
1698+ Node* value_instance_type = assembler->Load(
1699+ MachineType::Uint8(), value_map,
1700+ assembler->IntPtrConstant(Map::kInstanceTypeOffset - kHeapObjectTag));
1701+
1702+ // Dispatch based on the instance type; we distinguish all String instance
1703+ // types, the HeapNumber type and the Oddball type.
1704+ assembler->Branch(assembler->Int32LessThan(
1705+ value_instance_type,
1706+ assembler->Int32Constant(FIRST_NONSTRING_TYPE)),
1707+ &if_valueisstring, &if_valueisnotstring);
1708+ assembler->Bind(&if_valueisnotstring);
1709+ size_t const kNumCases = 2;
1710+ Label* case_labels[kNumCases];
1711+ int32_t case_values[kNumCases];
1712+ case_labels[0] = &if_valueisheapnumber;
1713+ case_values[0] = HEAP_NUMBER_TYPE;
1714+ case_labels[1] = &if_valueisoddball;
1715+ case_values[1] = ODDBALL_TYPE;
1716+ assembler->Switch(value_instance_type, &if_valueisother, case_values,
1717+ case_labels, arraysize(case_values));
1718+
1719+ assembler->Bind(&if_valueisstring);
1720+ {
1721+ // Load the string length field of the {value}.
1722+ Node* value_length =
1723+ assembler->LoadObjectField(value, String::kLengthOffset);
1724+
1725+ // Check if the {value} is the empty string.
1726+ assembler->Branch(
1727+ assembler->SmiEqual(value_length, assembler->SmiConstant(0)),
1728+ &return_false, &return_true);
1729+ }
1730+
1731+ assembler->Bind(&if_valueisheapnumber);
1732+ {
1733+ Node* value_value = assembler->Load(
1734+ MachineType::Float64(), value,
1735+ assembler->IntPtrConstant(HeapNumber::kValueOffset - kHeapObjectTag));
1736+
1737+ Label if_valueisnotpositive(assembler);
1738+ assembler->Branch(assembler->Float64LessThan(
1739+ assembler->Float64Constant(0.0), value_value),
1740+ &return_true, &if_valueisnotpositive);
1741+
1742+ assembler->Bind(&if_valueisnotpositive);
1743+ assembler->Branch(assembler->Float64LessThan(
1744+ value_value, assembler->Float64Constant(0.0)),
1745+ &return_true, &return_false);
1746+ }
1747+
1748+ assembler->Bind(&if_valueisoddball);
1749+ {
1750+ // The {value} is an Oddball, and every Oddball knows its boolean value.
1751+ Node* value_toboolean =
1752+ assembler->LoadObjectField(value, Oddball::kToBooleanOffset);
1753+ result.Bind(value_toboolean);
1754+ assembler->Goto(&end);
1755+ }
1756+
1757+ assembler->Bind(&if_valueisother);
1758+ {
1759+ Node* value_map_bitfield = assembler->Load(
1760+ MachineType::Uint8(), value_map,
1761+ assembler->IntPtrConstant(Map::kBitFieldOffset - kHeapObjectTag));
1762+ Node* value_map_undetectable = assembler->Word32And(
1763+ value_map_bitfield,
1764+ assembler->Int32Constant(1 << Map::kIsUndetectable));
1765+
1766+ // Check if the {value} is undetectable.
1767+ assembler->Branch(assembler->Word32Equal(value_map_undetectable,
1768+ assembler->Int32Constant(0)),
1769+ &return_true, &return_false);
1770+ }
1771+ }
1772+
1773+ assembler->Bind(&return_false);
1774+ {
1775+ result.Bind(assembler->BooleanConstant(false));
1776+ assembler->Goto(&end);
1777+ }
1778+
1779+ assembler->Bind(&return_true);
1780+ {
1781+ result.Bind(assembler->BooleanConstant(true));
1782+ assembler->Goto(&end);
1783+ }
1784+
1785+ assembler->Bind(&end);
1786+ return result.value();
1787+}
1788+
1789 void ToIntegerStub::GenerateAssembly(CodeStubAssembler* assembler) const {
1790 typedef CodeStubAssembler::Label Label;
1791 typedef compiler::Node Node;
1792@@ -4070,6 +4195,9 @@ void StoreTransitionStub::InitializeDesc
1793 FUNCTION_ADDR(Runtime_TransitionStoreIC_MissFromStubFailure));
1794 }
1795
1796+void FastNewClosureStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {}
1797+
1798+
1799 void TypeofStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {}
1800
1801 void NumberToStringStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
1802@@ -4336,6 +4464,7 @@ void GetPropertyStub::GenerateAssembly(C
1803 assembler->Return(var_result.value());
1804 }
1805
1806+#if 0
1807 // static
1808 compiler::Node* FastNewClosureStub::Generate(CodeStubAssembler* assembler,
1809 compiler::Node* shared_info,
1810@@ -4478,11 +4607,14 @@ compiler::Node* FastNewClosureStub::Gene
1811
1812 return result;
1813 }
1814+#endif
1815
1816+#if 0
1817 void FastNewClosureStub::GenerateAssembly(CodeStubAssembler* assembler) const {
1818 assembler->Return(
1819 Generate(assembler, assembler->Parameter(0), assembler->Parameter(1)));
1820 }
1821+#endif
1822
1823 void FastNewFunctionContextStub::GenerateAssembly(
1824 CodeStubAssembler* assembler) const {
1825@@ -4586,6 +4718,16 @@ void ArrayConstructorStub::PrintName(std
1826 }
1827
1828
1829+std::ostream& ArrayConstructorStubBase::BasePrintName(
1830+ std::ostream& os, // NOLINT
1831+ const char* name) const {
1832+ os << name << "_" << ElementsKindToString(elements_kind());
1833+ if (override_mode() == DISABLE_ALLOCATION_SITES) {
1834+ os << "_DISABLE_ALLOCATION_SITES";
1835+ }
1836+ return os;
1837+}
1838+
1839 bool ToBooleanICStub::UpdateStatus(Handle<Object> object) {
1840 Types new_types = types();
1841 Types old_types = new_types;
1842@@ -4679,6 +4821,7 @@ void ProfileEntryHookStub::EntryHookTram
1843 entry_hook(function, stack_pointer);
1844 }
1845
1846+#if !(defined(__x86_64__) && __SIZEOF_POINTER__ == 4)
1847 void ArrayNoArgumentConstructorStub::GenerateAssembly(
1848 CodeStubAssembler* assembler) const {
1849 typedef compiler::Node Node;
1850@@ -4711,7 +4854,9 @@ void InternalArrayNoArgumentConstructorS
1851 assembler->IntPtrConstant(0), nullptr);
1852 assembler->Return(array);
1853 }
1854+#endif
1855
1856+#if 0
1857 namespace {
1858
1859 template <typename Descriptor>
1860@@ -4777,7 +4922,9 @@ void SingleArgumentConstructorCommon(Cod
1861 }
1862 }
1863 } // namespace
1864+#endif
1865
1866+#if 0
1867 void ArraySingleArgumentConstructorStub::GenerateAssembly(
1868 CodeStubAssembler* assembler) const {
1869 typedef compiler::Node Node;
1870@@ -4793,7 +4940,9 @@ void ArraySingleArgumentConstructorStub:
1871 SingleArgumentConstructorCommon<Descriptor>(assembler, elements_kind(),
1872 array_map, allocation_site, mode);
1873 }
1874+#endif
1875
1876+#if 0
1877 void InternalArraySingleArgumentConstructorStub::GenerateAssembly(
1878 CodeStubAssembler* assembler) const {
1879 typedef compiler::Node Node;
1880@@ -4804,10 +4953,14 @@ void InternalArraySingleArgumentConstruc
1881 assembler, elements_kind(), array_map, assembler->UndefinedConstant(),
1882 DONT_TRACK_ALLOCATION_SITE);
1883 }
1884+#endif
1885
1886 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate)
1887 : PlatformCodeStub(isolate) {
1888 minor_key_ = ArgumentCountBits::encode(ANY);
1889+#if 1
1890+ ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
1891+#endif
1892 }
1893
1894
1895@@ -4823,10 +4976,15 @@ ArrayConstructorStub::ArrayConstructorSt
1896 } else {
1897 UNREACHABLE();
1898 }
1899+ ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
1900+}
1901+
1902+
1903+InternalArrayConstructorStub::InternalArrayConstructorStub(
1904+ Isolate* isolate) : PlatformCodeStub(isolate) {
1905+ InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
1906 }
1907
1908-InternalArrayConstructorStub::InternalArrayConstructorStub(Isolate* isolate)
1909- : PlatformCodeStub(isolate) {}
1910
1911 Representation RepresentationFromType(Type* type) {
1912 if (type->Is(Type::UntaggedIntegral())) {
1913diff -urp v8.t5.4.259/src/code-stubs.h v8/src/code-stubs.h
1914--- v8.t5.4.259/src/code-stubs.h 2016-11-14 15:48:15.489018122 -0800
1915+++ v8/src/code-stubs.h 2016-11-14 15:08:43.256025218 -0800
1916@@ -18,6 +18,7 @@
1917 namespace v8 {
1918 namespace internal {
1919
1920+
1921 // List of code stubs used on all platforms.
1922 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \
1923 /* PlatformCodeStubs */ \
1924@@ -46,6 +47,8 @@ namespace internal {
1925 V(StoreElement) \
1926 V(StubFailureTrampoline) \
1927 V(SubString) \
1928+ V(ToNumber) \
1929+ V(NonNumberToNumber) \
1930 V(ToString) \
1931 V(ToName) \
1932 V(ToObject) \
1933@@ -54,6 +57,8 @@ namespace internal {
1934 V(StoreIC) \
1935 V(KeyedStoreIC) \
1936 /* HydrogenCodeStubs */ \
1937+ V(ArraySingleArgumentConstructor) \
1938+ V(ArrayNoArgumentConstructor) \
1939 V(BinaryOpIC) \
1940 V(BinaryOpWithAllocationSite) \
1941 V(CreateAllocationSite) \
1942@@ -96,9 +101,6 @@ namespace internal {
1943 V(AllocateInt8x16) \
1944 V(AllocateUint8x16) \
1945 V(AllocateBool8x16) \
1946- V(ArrayNoArgumentConstructor) \
1947- V(ArraySingleArgumentConstructor) \
1948- V(ArrayNArgumentsConstructor) \
1949 V(StringLength) \
1950 V(Add) \
1951 V(Subtract) \
1952@@ -112,13 +114,13 @@ namespace internal {
1953 V(BitwiseOr) \
1954 V(BitwiseXor) \
1955 V(Inc) \
1956- V(InternalArrayNoArgumentConstructor) \
1957 V(InternalArraySingleArgumentConstructor) \
1958 V(Dec) \
1959 V(FastCloneShallowObject) \
1960 V(FastNewClosure) \
1961 V(FastNewFunctionContext) \
1962 V(InstanceOf) \
1963+ V(InternalArrayNoArgumentConstructor) \
1964 V(LessThan) \
1965 V(LessThanOrEqual) \
1966 V(GreaterThan) \
1967@@ -133,6 +135,7 @@ namespace internal {
1968 V(StringLessThanOrEqual) \
1969 V(StringGreaterThan) \
1970 V(StringGreaterThanOrEqual) \
1971+ V(ToBoolean) \
1972 V(ToInteger) \
1973 V(ToLength) \
1974 V(HasProperty) \
1975@@ -151,7 +154,14 @@ namespace internal {
1976 V(StoreField) \
1977 V(StoreGlobal) \
1978 V(StoreInterceptor) \
1979- V(StoreTransition)
1980+ V(StoreTransition) \
1981+ V(InternalArrayNArgumentsConstructor) \
1982+ V(ArrayNArgumentsConstructor)
1983+
1984+//turbofan
1985+
1986+// V(ArrayNArgumentsConstructor)
1987+// V(ArraySingleArgumentConstructor)
1988
1989 // List of code stubs only used on ARM 32 bits platforms.
1990 #if V8_TARGET_ARCH_ARM
1991@@ -934,6 +944,14 @@ class StringGreaterThanOrEqualStub final
1992 DEFINE_TURBOFAN_CODE_STUB(StringGreaterThanOrEqual, TurboFanCodeStub);
1993 };
1994
1995+class ToBooleanStub final : public TurboFanCodeStub {
1996+ public:
1997+ explicit ToBooleanStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
1998+
1999+ DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion);
2000+ DEFINE_TURBOFAN_UNARY_OP_CODE_STUB(ToBoolean, TurboFanCodeStub);
2001+};
2002+
2003 class ToIntegerStub final : public TurboFanCodeStub {
2004 public:
2005 explicit ToIntegerStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
2006@@ -1039,16 +1057,32 @@ class TypeofStub final : public Hydrogen
2007 DEFINE_HYDROGEN_CODE_STUB(Typeof, HydrogenCodeStub);
2008 };
2009
2010-class FastNewClosureStub : public TurboFanCodeStub {
2011+
2012+class FastNewClosureStub : public HydrogenCodeStub {
2013 public:
2014- explicit FastNewClosureStub(Isolate* isolate) : TurboFanCodeStub(isolate) {}
2015+ FastNewClosureStub(Isolate* isolate, LanguageMode language_mode,
2016+ FunctionKind kind)
2017+ : HydrogenCodeStub(isolate) {
2018+ DCHECK(IsValidFunctionKind(kind));
2019+ set_sub_minor_key(LanguageModeBits::encode(language_mode) |
2020+ FunctionKindBits::encode(kind));
2021+ }
2022
2023- static compiler::Node* Generate(CodeStubAssembler* assembler,
2024- compiler::Node* shared_info,
2025- compiler::Node* context);
2026+ LanguageMode language_mode() const {
2027+ return LanguageModeBits::decode(sub_minor_key());
2028+ }
2029+
2030+ FunctionKind kind() const {
2031+ return FunctionKindBits::decode(sub_minor_key());
2032+ }
2033+
2034+ private:
2035+ STATIC_ASSERT(LANGUAGE_END == 3);
2036+ class LanguageModeBits : public BitField<LanguageMode, 0, 2> {};
2037+ class FunctionKindBits : public BitField<FunctionKind, 2, 9> {};
2038
2039 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure);
2040- DEFINE_TURBOFAN_CODE_STUB(FastNewClosure, TurboFanCodeStub);
2041+ DEFINE_HYDROGEN_CODE_STUB(FastNewClosure, HydrogenCodeStub);
2042 };
2043
2044 class FastNewFunctionContextStub final : public TurboFanCodeStub {
2045@@ -1293,7 +1327,7 @@ class ArrayConstructorStub: public Platf
2046
2047 class ArgumentCountBits : public BitField<ArgumentCountKey, 0, 2> {};
2048
2049- DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayNArgumentsConstructor);
2050+ DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructor);
2051 DEFINE_PLATFORM_CODE_STUB(ArrayConstructor, PlatformCodeStub);
2052 };
2053
2054@@ -1305,7 +1339,7 @@ class InternalArrayConstructorStub: publ
2055 private:
2056 void GenerateCase(MacroAssembler* masm, ElementsKind kind);
2057
2058- DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayNArgumentsConstructor);
2059+ DEFINE_CALL_INTERFACE_DESCRIPTOR(InternalArrayConstructor);
2060 DEFINE_PLATFORM_CODE_STUB(InternalArrayConstructor, PlatformCodeStub);
2061 };
2062
2063@@ -2738,6 +2772,52 @@ class AllocateHeapNumberStub : public Tu
2064 SIMD128_TYPES(SIMD128_ALLOC_STUB)
2065 #undef SIMD128_ALLOC_STUB
2066
2067+#if 0
2068+class ArrayConstructorStubBase : public HydrogenCodeStub {
2069+ public:
2070+ ArrayConstructorStubBase(Isolate* isolate,
2071+ ElementsKind kind,
2072+ AllocationSiteOverrideMode override_mode)
2073+ : HydrogenCodeStub(isolate) {
2074+ // It only makes sense to override local allocation site behavior
2075+ // if there is a difference between the global allocation site policy
2076+ // for an ElementsKind and the desired usage of the stub.
2077+ DCHECK(override_mode != DISABLE_ALLOCATION_SITES ||
2078+ AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE);
2079+ set_sub_minor_key(ElementsKindBits::encode(kind) |
2080+ AllocationSiteOverrideModeBits::encode(override_mode));
2081+ }
2082+
2083+ ElementsKind elements_kind() const {
2084+ return ElementsKindBits::decode(sub_minor_key());
2085+ }
2086+
2087+ AllocationSiteOverrideMode override_mode() const {
2088+ return AllocationSiteOverrideModeBits::decode(sub_minor_key());
2089+ }
2090+
2091+ static void GenerateStubsAheadOfTime(Isolate* isolate);
2092+
2093+ // Parameters accessed via CodeStubGraphBuilder::GetParameter()
2094+ static const int kConstructor = 0;
2095+ static const int kAllocationSite = 1;
2096+
2097+ protected:
2098+ std::ostream& BasePrintName(std::ostream& os,
2099+ const char* name) const; // NOLINT
2100+
2101+ private:
2102+ // Ensure data fits within available bits.
2103+ STATIC_ASSERT(LAST_ALLOCATION_SITE_OVERRIDE_MODE == 1);
2104+
2105+ class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
2106+ class AllocationSiteOverrideModeBits: public
2107+ BitField<AllocationSiteOverrideMode, 8, 1> {}; // NOLINT
2108+
2109+ DEFINE_CODE_STUB_BASE(ArrayConstructorStubBase, HydrogenCodeStub);
2110+};
2111+#endif
2112+
2113 class CommonArrayConstructorStub : public TurboFanCodeStub {
2114 protected:
2115 CommonArrayConstructorStub(Isolate* isolate, ElementsKind kind,
2116@@ -2768,8 +2848,6 @@ class CommonArrayConstructorStub : publi
2117 return AllocationSiteOverrideModeBits::decode(sub_minor_key());
2118 }
2119
2120- static void GenerateStubsAheadOfTime(Isolate* isolate);
2121-
2122 private:
2123 // Ensure data fits within available bits.
2124 STATIC_ASSERT(LAST_ALLOCATION_SITE_OVERRIDE_MODE == 1);
2125@@ -2779,6 +2857,98 @@ class CommonArrayConstructorStub : publi
2126 : public BitField<AllocationSiteOverrideMode, 8, 1> {}; // NOLINT
2127 };
2128
2129+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
2130+class ArrayConstructorStubBase : public HydrogenCodeStub {
2131+ public:
2132+ ArrayConstructorStubBase(Isolate* isolate,
2133+ ElementsKind kind,
2134+ AllocationSiteOverrideMode override_mode)
2135+ : HydrogenCodeStub(isolate) {
2136+ // It only makes sense to override local allocation site behavior
2137+ // if there is a difference between the global allocation site policy
2138+ // for an ElementsKind and the desired usage of the stub.
2139+ DCHECK(override_mode != DISABLE_ALLOCATION_SITES ||
2140+ AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE);
2141+ set_sub_minor_key(ElementsKindBits::encode(kind) |
2142+ AllocationSiteOverrideModeBits::encode(override_mode));
2143+ }
2144+ ElementsKind elements_kind() const {
2145+ return ElementsKindBits::decode(sub_minor_key());
2146+ }
2147+ AllocationSiteOverrideMode override_mode() const {
2148+ return AllocationSiteOverrideModeBits::decode(sub_minor_key());
2149+ }
2150+ static void GenerateStubsAheadOfTime(Isolate* isolate);
2151+ // Parameters accessed via CodeStubGraphBuilder::GetParameter()
2152+ static const int kConstructor = 0;
2153+ static const int kAllocationSite = 1;
2154+ protected:
2155+ std::ostream& BasePrintName(std::ostream& os,
2156+ const char* name) const; // NOLINT
2157+ private:
2158+ // Ensure data fits within available bits.
2159+ STATIC_ASSERT(LAST_ALLOCATION_SITE_OVERRIDE_MODE == 1);
2160+ class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
2161+ class AllocationSiteOverrideModeBits: public
2162+ BitField<AllocationSiteOverrideMode, 8, 1> {}; // NOLINT
2163+ DEFINE_CODE_STUB_BASE(ArrayConstructorStubBase, HydrogenCodeStub);
2164+};
2165+
2166+class ArrayNoArgumentConstructorStub : public ArrayConstructorStubBase {
2167+ public:
2168+ ArrayNoArgumentConstructorStub(
2169+ Isolate* isolate,
2170+ ElementsKind kind,
2171+ AllocationSiteOverrideMode override_mode = DONT_OVERRIDE)
2172+ : ArrayConstructorStubBase(isolate, kind, override_mode) {
2173+ }
2174+
2175+ private:
2176+ void PrintName(std::ostream& os) const override { // NOLINT
2177+ os << "ArrayNoArgumentConstructorStub";
2178+ }
2179+
2180+ DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructorConstantArgCount);
2181+ DEFINE_HYDROGEN_CODE_STUB(ArrayNoArgumentConstructor,
2182+ ArrayConstructorStubBase);
2183+};
2184+
2185+
2186+class InternalArrayConstructorStubBase : public HydrogenCodeStub {
2187+ public:
2188+ InternalArrayConstructorStubBase(Isolate* isolate, ElementsKind kind)
2189+ : HydrogenCodeStub(isolate) {
2190+ set_sub_minor_key(ElementsKindBits::encode(kind));
2191+ }
2192+
2193+ static void GenerateStubsAheadOfTime(Isolate* isolate);
2194+
2195+ // Parameters accessed via CodeStubGraphBuilder::GetParameter()
2196+ static const int kConstructor = 0;
2197+
2198+ ElementsKind elements_kind() const {
2199+ return ElementsKindBits::decode(sub_minor_key());
2200+ }
2201+
2202+ private:
2203+ class ElementsKindBits : public BitField<ElementsKind, 0, 8> {};
2204+
2205+ DEFINE_CODE_STUB_BASE(InternalArrayConstructorStubBase, HydrogenCodeStub);
2206+};
2207+
2208+class InternalArrayNoArgumentConstructorStub : public
2209+ InternalArrayConstructorStubBase {
2210+ public:
2211+ InternalArrayNoArgumentConstructorStub(Isolate* isolate,
2212+ ElementsKind kind)
2213+ : InternalArrayConstructorStubBase(isolate, kind) { }
2214+
2215+ DEFINE_CALL_INTERFACE_DESCRIPTOR(InternalArrayConstructorConstantArgCount);
2216+ DEFINE_HYDROGEN_CODE_STUB(InternalArrayNoArgumentConstructor,
2217+ InternalArrayConstructorStubBase);
2218+};
2219+
2220+#else
2221 class ArrayNoArgumentConstructorStub : public CommonArrayConstructorStub {
2222 public:
2223 ArrayNoArgumentConstructorStub(
2224@@ -2811,7 +2981,40 @@ class InternalArrayNoArgumentConstructor
2225 DEFINE_TURBOFAN_CODE_STUB(InternalArrayNoArgumentConstructor,
2226 CommonArrayConstructorStub);
2227 };
2228+#endif
2229+
2230+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
2231+class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase {
2232+ public:
2233+ ArraySingleArgumentConstructorStub(
2234+ Isolate* isolate, ElementsKind kind,
2235+ AllocationSiteOverrideMode override_mode = DONT_OVERRIDE)
2236+ : ArrayConstructorStubBase(isolate, kind, override_mode) {
2237+ }
2238+
2239+ DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructor);
2240+ DEFINE_HYDROGEN_CODE_STUB(ArraySingleArgumentConstructor,
2241+ ArrayConstructorStubBase);
2242+};
2243+
2244+class InternalArraySingleArgumentConstructorStub : public
2245+ InternalArrayConstructorStubBase {
2246+ public:
2247+ InternalArraySingleArgumentConstructorStub(Isolate* isolate,
2248+ ElementsKind kind)
2249+ : InternalArrayConstructorStubBase(isolate, kind) { }
2250+
2251+ private:
2252+ void PrintName(std::ostream& os) const override { // NOLINT
2253+ os << "InternalArraySingleArgumentConstructorStub";
2254+ }
2255+
2256+ DEFINE_CALL_INTERFACE_DESCRIPTOR(InternalArrayConstructor);
2257+ DEFINE_HYDROGEN_CODE_STUB(InternalArraySingleArgumentConstructor,
2258+ InternalArrayConstructorStubBase);
2259+};
2260
2261+#else
2262 class ArraySingleArgumentConstructorStub : public CommonArrayConstructorStub {
2263 public:
2264 ArraySingleArgumentConstructorStub(
2265@@ -2845,19 +3048,63 @@ class InternalArraySingleArgumentConstru
2266 DEFINE_TURBOFAN_CODE_STUB(InternalArraySingleArgumentConstructor,
2267 CommonArrayConstructorStub);
2268 };
2269+#endif
2270
2271-class ArrayNArgumentsConstructorStub : public PlatformCodeStub {
2272+class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase {
2273 public:
2274- explicit ArrayNArgumentsConstructorStub(Isolate* isolate)
2275- : PlatformCodeStub(isolate) {}
2276+ ArrayNArgumentsConstructorStub(
2277+ Isolate* isolate,
2278+ ElementsKind kind,
2279+ AllocationSiteOverrideMode override_mode = DONT_OVERRIDE)
2280+ : ArrayConstructorStubBase(isolate, kind, override_mode) {
2281+ }
2282
2283- CallInterfaceDescriptor GetCallInterfaceDescriptor() const override {
2284- return ArrayNArgumentsConstructorDescriptor(isolate());
2285+ private:
2286+ void PrintName(std::ostream& os) const override { // NOLINT
2287+ BasePrintName(os, "ArrayNArgumentsConstructorStub");
2288+ }
2289+
2290+ DEFINE_CALL_INTERFACE_DESCRIPTOR(ArrayConstructor);
2291+ DEFINE_HYDROGEN_CODE_STUB(ArrayNArgumentsConstructor,
2292+ ArrayConstructorStubBase);
2293+};
2294+
2295+#if 0
2296+class InternalArrayConstructorStubBase : public HydrogenCodeStub {
2297+ public:
2298+ InternalArrayConstructorStubBase(Isolate* isolate, ElementsKind kind)
2299+ : HydrogenCodeStub(isolate) {
2300+ set_sub_minor_key(ElementsKindBits::encode(kind));
2301+ }
2302+
2303+ static void GenerateStubsAheadOfTime(Isolate* isolate);
2304+
2305+ // Parameters accessed via CodeStubGraphBuilder::GetParameter()
2306+ static const int kConstructor = 0;
2307+
2308+ ElementsKind elements_kind() const {
2309+ return ElementsKindBits::decode(sub_minor_key());
2310 }
2311
2312 private:
2313- DEFINE_PLATFORM_CODE_STUB(ArrayNArgumentsConstructor, PlatformCodeStub);
2314+ class ElementsKindBits : public BitField<ElementsKind, 0, 8> {};
2315+
2316+ DEFINE_CODE_STUB_BASE(InternalArrayConstructorStubBase, HydrogenCodeStub);
2317 };
2318+#endif
2319+
2320+
2321+class InternalArrayNArgumentsConstructorStub : public
2322+ InternalArrayConstructorStubBase {
2323+ public:
2324+ InternalArrayNArgumentsConstructorStub(Isolate* isolate, ElementsKind kind)
2325+ : InternalArrayConstructorStubBase(isolate, kind) { }
2326+
2327+ DEFINE_CALL_INTERFACE_DESCRIPTOR(InternalArrayConstructor);
2328+ DEFINE_HYDROGEN_CODE_STUB(InternalArrayNArgumentsConstructor,
2329+ InternalArrayConstructorStubBase);
2330+};
2331+
2332
2333 class StoreElementStub : public PlatformCodeStub {
2334 public:
2335@@ -2991,7 +3238,6 @@ class ElementsTransitionAndStoreStub : p
2336 DEFINE_HYDROGEN_CODE_STUB(ElementsTransitionAndStore, HydrogenCodeStub);
2337 };
2338
2339-
2340 class StubFailureTrampolineStub : public PlatformCodeStub {
2341 public:
2342 StubFailureTrampolineStub(Isolate* isolate, StubFunctionMode function_mode)
2343@@ -3063,6 +3309,25 @@ class SubStringStub : public PlatformCod
2344 DEFINE_PLATFORM_CODE_STUB(SubString, PlatformCodeStub);
2345 };
2346
2347+#if (defined(__x86_64__) && __SIZEOF_POINTER__ == 4) || 1
2348+class ToNumberStub final : public PlatformCodeStub {
2349+ public:
2350+ explicit ToNumberStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
2351+
2352+ DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion);
2353+ DEFINE_PLATFORM_CODE_STUB(ToNumber, PlatformCodeStub);
2354+};
2355+
2356+class NonNumberToNumberStub final : public PlatformCodeStub {
2357+ public:
2358+ explicit NonNumberToNumberStub(Isolate* isolate)
2359+ : PlatformCodeStub(isolate) {}
2360+
2361+ DEFINE_CALL_INTERFACE_DESCRIPTOR(TypeConversion);
2362+ DEFINE_PLATFORM_CODE_STUB(NonNumberToNumber, PlatformCodeStub);
2363+};
2364+#endif
2365+
2366 class ToStringStub final : public PlatformCodeStub {
2367 public:
2368 explicit ToStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
2369diff -urp v8.t5.4.259/src/compiler/code-assembler.cc v8/src/compiler/code-assembler.cc
2370--- v8.t5.4.259/src/compiler/code-assembler.cc 2016-11-14 15:48:15.513019046 -0800
2371+++ v8/src/compiler/code-assembler.cc 2016-11-14 15:08:43.257025258 -0800
2372@@ -402,13 +402,6 @@ Node* CodeAssembler::TailCallRuntime(Run
2373 context);
2374 }
2375
2376-Node* CodeAssembler::TailCallRuntime(Runtime::FunctionId function_id,
2377- Node* context, Node* arg1, Node* arg2,
2378- Node* arg3, Node* arg4, Node* arg5) {
2379- return raw_assembler_->TailCallRuntime5(function_id, arg1, arg2, arg3, arg4,
2380- arg5, context);
2381-}
2382-
2383 Node* CodeAssembler::CallStub(Callable const& callable, Node* context,
2384 Node* arg1, size_t result_size) {
2385 Node* target = HeapConstant(callable.code());
2386@@ -632,13 +625,6 @@ Node* CodeAssembler::CallStubN(const Cal
2387 }
2388
2389 Node* CodeAssembler::TailCallStub(Callable const& callable, Node* context,
2390- Node* arg1, size_t result_size) {
2391- Node* target = HeapConstant(callable.code());
2392- return TailCallStub(callable.descriptor(), target, context, arg1,
2393- result_size);
2394-}
2395-
2396-Node* CodeAssembler::TailCallStub(Callable const& callable, Node* context,
2397 Node* arg1, Node* arg2, size_t result_size) {
2398 Node* target = HeapConstant(callable.code());
2399 return TailCallStub(callable.descriptor(), target, context, arg1, arg2,
2400@@ -655,21 +641,6 @@ Node* CodeAssembler::TailCallStub(Callab
2401
2402 Node* CodeAssembler::TailCallStub(const CallInterfaceDescriptor& descriptor,
2403 Node* target, Node* context, Node* arg1,
2404- size_t result_size) {
2405- CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
2406- isolate(), zone(), descriptor, descriptor.GetStackParameterCount(),
2407- CallDescriptor::kSupportsTailCalls, Operator::kNoProperties,
2408- MachineType::AnyTagged(), result_size);
2409-
2410- Node** args = zone()->NewArray<Node*>(2);
2411- args[0] = arg1;
2412- args[1] = context;
2413-
2414- return raw_assembler_->TailCallN(call_descriptor, target, args);
2415-}
2416-
2417-Node* CodeAssembler::TailCallStub(const CallInterfaceDescriptor& descriptor,
2418- Node* target, Node* context, Node* arg1,
2419 Node* arg2, size_t result_size) {
2420 CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
2421 isolate(), zone(), descriptor, descriptor.GetStackParameterCount(),
2422@@ -875,27 +846,6 @@ void CodeAssembler::Switch(Node* index,
2423 labels, case_count);
2424 }
2425
2426-Node* CodeAssembler::Select(Node* condition, Node* true_value,
2427- Node* false_value, MachineRepresentation rep) {
2428- Variable value(this, rep);
2429- Label vtrue(this), vfalse(this), end(this);
2430- Branch(condition, &vtrue, &vfalse);
2431-
2432- Bind(&vtrue);
2433- {
2434- value.Bind(true_value);
2435- Goto(&end);
2436- }
2437- Bind(&vfalse);
2438- {
2439- value.Bind(false_value);
2440- Goto(&end);
2441- }
2442-
2443- Bind(&end);
2444- return value.value();
2445-}
2446-
2447 // RawMachineAssembler delegate helpers:
2448 Isolate* CodeAssembler::isolate() const { return raw_assembler_->isolate(); }
2449
2450diff -urp v8.t5.4.259/src/compiler/code-assembler.h v8/src/compiler/code-assembler.h
2451--- v8.t5.4.259/src/compiler/code-assembler.h 2016-11-14 15:48:15.513019046 -0800
2452+++ v8/src/compiler/code-assembler.h 2016-11-14 15:08:43.257025258 -0800
2453@@ -249,9 +249,6 @@ class CodeAssembler {
2454 void Switch(Node* index, Label* default_label, int32_t* case_values,
2455 Label** case_labels, size_t case_count);
2456
2457- Node* Select(Node* condition, Node* true_value, Node* false_value,
2458- MachineRepresentation rep = MachineRepresentation::kTagged);
2459-
2460 // Access to the frame pointer
2461 Node* LoadFramePointer();
2462 Node* LoadParentFramePointer();
2463@@ -322,9 +319,6 @@ class CodeAssembler {
2464 Node* arg1, Node* arg2, Node* arg3);
2465 Node* TailCallRuntime(Runtime::FunctionId function_id, Node* context,
2466 Node* arg1, Node* arg2, Node* arg3, Node* arg4);
2467- Node* TailCallRuntime(Runtime::FunctionId function_id, Node* context,
2468- Node* arg1, Node* arg2, Node* arg3, Node* arg4,
2469- Node* arg5);
2470
2471 // A pair of a zero-based argument index and a value.
2472 // It helps writing arguments order independent code.
2473@@ -378,14 +372,10 @@ class CodeAssembler {
2474 Node** args, size_t result_size = 1);
2475
2476 Node* TailCallStub(Callable const& callable, Node* context, Node* arg1,
2477- size_t result_size = 1);
2478- Node* TailCallStub(Callable const& callable, Node* context, Node* arg1,
2479 Node* arg2, size_t result_size = 1);
2480 Node* TailCallStub(Callable const& callable, Node* context, Node* arg1,
2481 Node* arg2, Node* arg3, size_t result_size = 1);
2482 Node* TailCallStub(const CallInterfaceDescriptor& descriptor, Node* target,
2483- Node* context, Node* arg1, size_t result_size = 1);
2484- Node* TailCallStub(const CallInterfaceDescriptor& descriptor, Node* target,
2485 Node* context, Node* arg1, Node* arg2,
2486 size_t result_size = 1);
2487 Node* TailCallStub(const CallInterfaceDescriptor& descriptor, Node* target,
2488diff -urp v8.t5.4.259/src/compiler/instruction-selector.cc v8/src/compiler/instruction-selector.cc
2489--- v8.t5.4.259/src/compiler/instruction-selector.cc 2016-11-14 15:48:15.526019547 -0800
2490+++ v8/src/compiler/instruction-selector.cc 2016-11-14 15:08:43.258025297 -0800
2491@@ -1484,7 +1484,7 @@ void InstructionSelector::VisitBitcastWo
2492 }
2493
2494 // 32 bit targets do not implement the following instructions.
2495-#if V8_TARGET_ARCH_32_BIT
2496+#if V8_TARGET_ARCH_32_BIT && !(defined(__x86_64__) && __SIZEOF_POINTER__ == 4)
2497
2498 void InstructionSelector::VisitWord64And(Node* node) { UNIMPLEMENTED(); }
2499
2500@@ -1637,7 +1637,7 @@ void InstructionSelector::VisitBitcastIn
2501 #endif // V8_TARGET_ARCH_32_BIT
2502
2503 // 64 bit targets do not implement the following instructions.
2504-#if V8_TARGET_ARCH_64_BIT
2505+#if V8_TARGET_ARCH_64_BIT || (defined(__x86_64__) && __SIZEOF_POINTER__ == 4)
2506 void InstructionSelector::VisitInt32PairAdd(Node* node) { UNIMPLEMENTED(); }
2507
2508 void InstructionSelector::VisitInt32PairSub(Node* node) { UNIMPLEMENTED(); }
2509diff -urp v8.t5.4.259/src/compiler/js-create-lowering.cc v8/src/compiler/js-create-lowering.cc
2510--- v8.t5.4.259/src/compiler/js-create-lowering.cc 2016-11-14 15:48:15.530019701 -0800
2511+++ v8/src/compiler/js-create-lowering.cc 2016-11-14 15:08:43.259025336 -0800
2512@@ -626,7 +626,12 @@ Reduction JSCreateLowering::ReduceNewArr
2513 }
2514
2515 DCHECK(arity > 1);
2516+#if 1
2517+ ArrayNArgumentsConstructorStub stub(isolate(), elements_kind,
2518+ override_mode);
2519+#else
2520 ArrayNArgumentsConstructorStub stub(isolate());
2521+#endif
2522 CallDescriptor* desc = Linkage::GetStubCallDescriptor(
2523 isolate(), graph()->zone(), stub.GetCallInterfaceDescriptor(), arity + 1,
2524 CallDescriptor::kNeedsFrameState);
2525diff -urp v8.t5.4.259/src/compiler/js-generic-lowering.cc v8/src/compiler/js-generic-lowering.cc
2526--- v8.t5.4.259/src/compiler/js-generic-lowering.cc 2016-11-14 15:48:15.531019740 -0800
2527+++ v8/src/compiler/js-generic-lowering.cc 2016-11-14 15:08:43.259025336 -0800
2528@@ -432,7 +432,8 @@ void JSGenericLowering::LowerJSCreateClo
2529
2530 // Use the FastNewClosureStub only for functions allocated in new space.
2531 if (p.pretenure() == NOT_TENURED) {
2532- Callable callable = CodeFactory::FastNewClosure(isolate());
2533+ Callable callable = CodeFactory::FastNewClosure(
2534+ isolate(), shared_info->language_mode(), shared_info->kind());
2535 ReplaceWithStubCall(node, callable, flags);
2536 } else {
2537 ReplaceWithRuntimeCall(node, (p.pretenure() == TENURED)
2538diff -urp v8.t5.4.259/src/compiler/js-graph.cc v8/src/compiler/js-graph.cc
2539--- v8.t5.4.259/src/compiler/js-graph.cc 2016-11-14 15:48:15.531019740 -0800
2540+++ v8/src/compiler/js-graph.cc 2016-11-14 15:08:43.259025336 -0800
2541@@ -25,8 +25,14 @@ Node* JSGraph::AllocateInOldSpaceStubCon
2542 }
2543
2544 Node* JSGraph::ToNumberBuiltinConstant() {
2545+#if 1
2546+ ToNumberStub stub(isolate());
2547+ return CACHED(kToNumberBuiltinConstant,
2548+ Constant(stub.GetCode()));
2549+#else
2550 return CACHED(kToNumberBuiltinConstant,
2551 HeapConstant(isolate()->builtins()->ToNumber()));
2552+#endif
2553 }
2554
2555 Node* JSGraph::CEntryStubConstant(int result_size) {
2556diff -urp v8.t5.4.259/src/compiler/raw-machine-assembler.cc v8/src/compiler/raw-machine-assembler.cc
2557--- v8.t5.4.259/src/compiler/raw-machine-assembler.cc 2016-11-14 15:48:15.553020587 -0800
2558+++ v8/src/compiler/raw-machine-assembler.cc 2016-11-14 15:08:43.259025336 -0800
2559@@ -112,6 +112,7 @@ void RawMachineAssembler::Switch(Node* i
2560 current_block_ = nullptr;
2561 }
2562
2563+
2564 void RawMachineAssembler::Return(Node* value) {
2565 Node* ret = MakeNode(common()->Return(), 1, &value);
2566 schedule()->AddReturn(CurrentBlock(), ret);
2567@@ -368,29 +369,6 @@ Node* RawMachineAssembler::TailCallRunti
2568 Node* tail_call = MakeNode(common()->TailCall(desc), arraysize(nodes), nodes);
2569
2570 schedule()->AddTailCall(CurrentBlock(), tail_call);
2571- current_block_ = nullptr;
2572- return tail_call;
2573-}
2574-
2575-Node* RawMachineAssembler::TailCallRuntime5(Runtime::FunctionId function,
2576- Node* arg1, Node* arg2, Node* arg3,
2577- Node* arg4, Node* arg5,
2578- Node* context) {
2579- const int kArity = 5;
2580- CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor(
2581- zone(), function, kArity, Operator::kNoProperties,
2582- CallDescriptor::kSupportsTailCalls);
2583- int return_count = static_cast<int>(desc->ReturnCount());
2584-
2585- Node* centry = HeapConstant(CEntryStub(isolate(), return_count).GetCode());
2586- Node* ref = AddNode(
2587- common()->ExternalConstant(ExternalReference(function, isolate())));
2588- Node* arity = Int32Constant(kArity);
2589-
2590- Node* nodes[] = {centry, arg1, arg2, arg3, arg4, arg5, ref, arity, context};
2591- Node* tail_call = MakeNode(common()->TailCall(desc), arraysize(nodes), nodes);
2592-
2593- schedule()->AddTailCall(CurrentBlock(), tail_call);
2594 current_block_ = nullptr;
2595 return tail_call;
2596 }
2597diff -urp v8.t5.4.259/src/compiler/raw-machine-assembler.h v8/src/compiler/raw-machine-assembler.h
2598--- v8.t5.4.259/src/compiler/raw-machine-assembler.h 2016-11-14 15:48:15.553020587 -0800
2599+++ v8/src/compiler/raw-machine-assembler.h 2016-11-14 15:08:43.260025375 -0800
2600@@ -742,9 +742,6 @@ class RawMachineAssembler {
2601 // Tail call to a runtime function with four arguments.
2602 Node* TailCallRuntime4(Runtime::FunctionId function, Node* arg1, Node* arg2,
2603 Node* arg3, Node* arg4, Node* context);
2604- // Tail call to a runtime function with five arguments.
2605- Node* TailCallRuntime5(Runtime::FunctionId function, Node* arg1, Node* arg2,
2606- Node* arg3, Node* arg4, Node* arg5, Node* context);
2607
2608 // ===========================================================================
2609 // The following utility methods deal with control flow, hence might switch
2610diff -urp v8.t5.4.259/src/compiler/schedule.cc v8/src/compiler/schedule.cc
2611--- v8.t5.4.259/src/compiler/schedule.cc 2016-11-14 15:48:15.560020856 -0800
2612+++ v8/src/compiler/schedule.cc 2016-11-14 15:08:43.260025375 -0800
2613@@ -344,7 +344,7 @@ void Schedule::EnsureSplitEdgeForm(Basic
2614 split_edge_block->set_control(BasicBlock::kGoto);
2615 split_edge_block->successors().push_back(block);
2616 split_edge_block->predecessors().push_back(pred);
2617- split_edge_block->set_deferred(pred->deferred());
2618+ split_edge_block->set_deferred(block->deferred());
2619 *current_pred = split_edge_block;
2620 // Find a corresponding successor in the previous block, replace it
2621 // with the split edge block... but only do it once, since we only
2622diff -urp v8.t5.4.259/src/contexts.h v8/src/contexts.h
2623--- v8.t5.4.259/src/contexts.h 2016-11-14 15:48:15.578021550 -0800
2624+++ v8/src/contexts.h 2016-11-14 15:08:43.260025375 -0800
2625@@ -520,7 +520,6 @@ class Context: public FixedArray {
2626 }
2627
2628 static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind) {
2629- // Note: Must be kept in sync with FastNewClosureStub::Generate.
2630 if (IsGeneratorFunction(kind)) {
2631 return is_strict(language_mode) ? STRICT_GENERATOR_FUNCTION_MAP_INDEX
2632 : SLOPPY_GENERATOR_FUNCTION_MAP_INDEX;
2633diff -urp v8.t5.4.259/src/crankshaft/hydrogen.cc v8/src/crankshaft/hydrogen.cc
2634--- v8.t5.4.259/src/crankshaft/hydrogen.cc 2016-11-14 15:48:15.608022705 -0800
2635+++ v8/src/crankshaft/hydrogen.cc 2016-11-14 15:08:43.264025532 -0800
2636@@ -5508,7 +5508,8 @@ void HOptimizedGraphBuilder::VisitFuncti
2637 HConstant* shared_info_value = Add<HConstant>(shared_info);
2638 HInstruction* instr;
2639 if (!expr->pretenure()) {
2640- FastNewClosureStub stub(isolate());
2641+ FastNewClosureStub stub(isolate(), shared_info->language_mode(),
2642+ shared_info->kind());
2643 FastNewClosureDescriptor descriptor(isolate());
2644 HValue* values[] = {context(), shared_info_value};
2645 HConstant* stub_value = Add<HConstant>(stub.GetCode());
2646@@ -13426,5 +13427,186 @@ HPhase::~HPhase() {
2647 #endif
2648 }
2649
2650+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
2651+HGraphBuilder::JSArrayBuilder::JSArrayBuilder(HGraphBuilder* builder,
2652+ ElementsKind kind,
2653+ HValue* allocation_site_payload,
2654+ HValue* constructor_function,
2655+ AllocationSiteOverrideMode override_mode) :
2656+ builder_(builder),
2657+ kind_(kind),
2658+ allocation_site_payload_(allocation_site_payload),
2659+ constructor_function_(constructor_function) {
2660+ DCHECK(!allocation_site_payload->IsConstant() ||
2661+ HConstant::cast(allocation_site_payload)->handle(
2662+ builder_->isolate())->IsAllocationSite());
2663+ mode_ = override_mode == DISABLE_ALLOCATION_SITES
2664+ ? DONT_TRACK_ALLOCATION_SITE
2665+ : AllocationSite::GetMode(kind);
2666+}
2667+
2668+HGraphBuilder::JSArrayBuilder::JSArrayBuilder(HGraphBuilder* builder,
2669+ ElementsKind kind,
2670+ HValue* constructor_function) :
2671+ builder_(builder),
2672+ kind_(kind),
2673+ mode_(DONT_TRACK_ALLOCATION_SITE),
2674+ allocation_site_payload_(NULL),
2675+ constructor_function_(constructor_function) {
2676+}
2677+
2678+
2679+HValue* HGraphBuilder::JSArrayBuilder::EmitMapCode() {
2680+ if (!builder()->top_info()->IsStub()) {
2681+ // A constant map is fine.
2682+ Handle<Map> map(builder()->isolate()->get_initial_js_array_map(kind_),
2683+ builder()->isolate());
2684+ return builder()->Add<HConstant>(map);
2685+ }
2686+
2687+ if (constructor_function_ != NULL && kind_ == GetInitialFastElementsKind()) {
2688+ // No need for a context lookup if the kind_ matches the initial
2689+ // map, because we can just load the map in that case.
2690+ HObjectAccess access = HObjectAccess::ForPrototypeOrInitialMap();
2691+ return builder()->Add<HLoadNamedField>(constructor_function_, nullptr,
2692+ access);
2693+ }
2694+
2695+ // TODO(mvstanton): we should always have a constructor function if we
2696+ // are creating a stub.
2697+ HInstruction* native_context = constructor_function_ != NULL
2698+ ? builder()->BuildGetNativeContext(constructor_function_)
2699+ : builder()->BuildGetNativeContext();
2700+
2701+ HObjectAccess access =
2702+ HObjectAccess::ForContextSlot(Context::ArrayMapIndex(kind_));
2703+ return builder()->Add<HLoadNamedField>(native_context, nullptr, access);
2704+}
2705+
2706+HValue* HGraphBuilder::JSArrayBuilder::EmitInternalMapCode() {
2707+ // Find the map near the constructor function
2708+ HObjectAccess access = HObjectAccess::ForPrototypeOrInitialMap();
2709+ return builder()->Add<HLoadNamedField>(constructor_function_, nullptr,
2710+ access);
2711+}
2712+
2713+
2714+HAllocate* HGraphBuilder::JSArrayBuilder::AllocateEmptyArray() {
2715+ HConstant* capacity = builder()->Add<HConstant>(initial_capacity());
2716+ return AllocateArray(capacity,
2717+ builder()->graph()->GetConstant0());
2718+}
2719+
2720+HAllocate* HGraphBuilder::JSArrayBuilder::AllocateArray(
2721+ HValue* capacity,
2722+ HValue* length_field,
2723+ FillMode fill_mode) {
2724+ // These HForceRepresentations are because we store these as fields in the
2725+ // objects we construct, and an int32-to-smi HChange could deopt. Accept
2726+ // the deopt possibility now, before allocation occurs.
2727+ capacity =
2728+ builder()->AddUncasted<HForceRepresentation>(capacity,
2729+ Representation::Smi());
2730+ length_field =
2731+ builder()->AddUncasted<HForceRepresentation>(length_field,
2732+ Representation::Smi());
2733+
2734+ // Generate size calculation code here in order to make it dominate
2735+ // the JSArray allocation.
2736+ HValue* elements_size =
2737+ builder()->BuildCalculateElementsSize(kind_, capacity);
2738+
2739+ // Bail out for large objects.
2740+ HValue* max_regular_heap_object_size =
2741+ builder()->Add<HConstant>(Page::kMaxRegularHeapObjectSize);
2742+ builder()->Add<HBoundsCheck>(elements_size, max_regular_heap_object_size);
2743+
2744+ // Allocate (dealing with failure appropriately)
2745+ HAllocate* array_object = builder()->AllocateJSArrayObject(mode_);
2746+
2747+ // Fill in the fields: map, properties, length
2748+ HValue* map;
2749+ if (allocation_site_payload_ == NULL) {
2750+ map = EmitInternalMapCode();
2751+ } else {
2752+ map = EmitMapCode();
2753+ }
2754+
2755+ builder()->BuildJSArrayHeader(array_object,
2756+ map,
2757+ NULL, // set elements to empty fixed array
2758+ mode_,
2759+ kind_,
2760+ allocation_site_payload_,
2761+ length_field);
2762+
2763+ // Allocate and initialize the elements
2764+ elements_location_ = builder()->BuildAllocateElements(kind_, elements_size);
2765+
2766+ builder()->BuildInitializeElementsHeader(elements_location_, kind_, capacity);
2767+
2768+ // Set the elements
2769+ builder()->Add<HStoreNamedField>(
2770+ array_object, HObjectAccess::ForElementsPointer(), elements_location_);
2771+
2772+ if (fill_mode == FILL_WITH_HOLE) {
2773+ builder()->BuildFillElementsWithHole(elements_location_, kind_,
2774+ graph()->GetConstant0(), capacity);
2775+ }
2776+
2777+ return array_object;
2778+}
2779+
2780+HValue* HGraphBuilder::BuildAllocateArrayFromLength(
2781+ JSArrayBuilder* array_builder,
2782+ HValue* length_argument) {
2783+ if (length_argument->IsConstant() &&
2784+ HConstant::cast(length_argument)->HasSmiValue()) {
2785+ int array_length = HConstant::cast(length_argument)->Integer32Value();
2786+ if (array_length == 0) {
2787+ return array_builder->AllocateEmptyArray();
2788+ } else {
2789+ return array_builder->AllocateArray(length_argument,
2790+ length_argument);
2791+ }
2792+ }
2793+
2794+ HValue* constant_zero = graph()->GetConstant0();
2795+ HConstant* max_alloc_length =
2796+ Add<HConstant>(JSArray::kInitialMaxFastElementArray);
2797+ HInstruction* checked_length = Add<HBoundsCheck>(length_argument,
2798+ max_alloc_length);
2799+ IfBuilder if_builder(this);
2800+ if_builder.If<HCompareNumericAndBranch>(checked_length, constant_zero,
2801+ Token::EQ);
2802+ if_builder.Then();
2803+ const int initial_capacity = JSArray::kPreallocatedArrayElements;
2804+ HConstant* initial_capacity_node = Add<HConstant>(initial_capacity);
2805+ Push(initial_capacity_node); // capacity
2806+ Push(constant_zero); // length
2807+ if_builder.Else();
2808+ if (!(top_info()->IsStub()) &&
2809+ IsFastPackedElementsKind(array_builder->kind())) {
2810+ // We'll come back later with better (holey) feedback.
2811+ if_builder.Deopt(
2812+ DeoptimizeReason::kHoleyArrayDespitePackedElements_kindFeedback);
2813+ } else {
2814+ Push(checked_length); // capacity
2815+ Push(checked_length); // length
2816+ }
2817+ if_builder.End();
2818+
2819+ // Figure out total size
2820+ HValue* length = Pop();
2821+ HValue* capacity = Pop();
2822+ return array_builder->AllocateArray(capacity, length);
2823+}
2824+
2825+
2826+
2827+#endif
2828+
2829+
2830+
2831 } // namespace internal
2832 } // namespace v8
2833diff -urp v8.t5.4.259/src/crankshaft/hydrogen.h v8/src/crankshaft/hydrogen.h
2834--- v8.t5.4.259/src/crankshaft/hydrogen.h 2016-11-14 15:48:15.610022782 -0800
2835+++ v8/src/crankshaft/hydrogen.h 2016-11-14 15:08:43.265025571 -0800
2836@@ -1779,6 +1779,61 @@ class HGraphBuilder {
2837
2838 HValue* BuildNewElementsCapacity(HValue* old_capacity);
2839
2840+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
2841+ class JSArrayBuilder final {
2842+ public:
2843+ JSArrayBuilder(HGraphBuilder* builder,
2844+ ElementsKind kind,
2845+ HValue* allocation_site_payload,
2846+ HValue* constructor_function,
2847+ AllocationSiteOverrideMode override_mode);
2848+
2849+ JSArrayBuilder(HGraphBuilder* builder,
2850+ ElementsKind kind,
2851+ HValue* constructor_function = NULL);
2852+
2853+ enum FillMode {
2854+ DONT_FILL_WITH_HOLE,
2855+ FILL_WITH_HOLE
2856+ };
2857+
2858+ ElementsKind kind() { return kind_; }
2859+ HAllocate* elements_location() { return elements_location_; }
2860+
2861+ HAllocate* AllocateEmptyArray();
2862+ HAllocate* AllocateArray(HValue* capacity,
2863+ HValue* length_field,
2864+ FillMode fill_mode = FILL_WITH_HOLE);
2865+ HValue* GetElementsLocation() { return elements_location_; }
2866+ HValue* EmitMapCode();
2867+
2868+ private:
2869+ Zone* zone() const { return builder_->zone(); }
2870+ int elements_size() const {
2871+ return IsFastDoubleElementsKind(kind_) ? kDoubleSize : kPointerSize;
2872+ }
2873+ HGraphBuilder* builder() { return builder_; }
2874+ HGraph* graph() { return builder_->graph(); }
2875+ int initial_capacity() {
2876+ STATIC_ASSERT(JSArray::kPreallocatedArrayElements > 0);
2877+ return JSArray::kPreallocatedArrayElements;
2878+ }
2879+
2880+ HValue* EmitInternalMapCode();
2881+
2882+ HGraphBuilder* builder_;
2883+ ElementsKind kind_;
2884+ AllocationSiteMode mode_;
2885+ HValue* allocation_site_payload_;
2886+ HValue* constructor_function_;
2887+ HAllocate* elements_location_;
2888+ };
2889+
2890+ HValue* BuildAllocateArrayFromLength(JSArrayBuilder* array_builder,
2891+ HValue* length_argument);
2892+
2893+#endif
2894+
2895 HValue* BuildCalculateElementsSize(ElementsKind kind,
2896 HValue* capacity);
2897 HAllocate* AllocateJSArrayObject(AllocationSiteMode mode);
2898diff -urp v8.t5.4.259/src/crankshaft/x64/lithium-codegen-x64.cc v8/src/crankshaft/x64/lithium-codegen-x64.cc
2899--- v8.t5.4.259/src/crankshaft/x64/lithium-codegen-x64.cc 2016-11-14 15:48:15.669025055 -0800
2900+++ v8/src/crankshaft/x64/lithium-codegen-x64.cc 2016-11-14 15:08:43.267025650 -0800
2901@@ -281,10 +281,18 @@ void LCodeGen::GenerateBodyInstructionPo
2902
2903
2904 bool LCodeGen::GenerateJumpTable() {
2905+#if __SIZEOF_POINTER__ != 4
2906 if (jump_table_.length() == 0) return !is_aborted();
2907+#endif
2908
2909 Label needs_frame;
2910+#if __SIZEOF_POINTER__ == 4
2911+ if (jump_table_.length() > 0) {
2912+ Comment(";;; -------------------- Jump table --------------------");
2913+ }
2914+#else
2915 Comment(";;; -------------------- Jump table --------------------");
2916+#endif
2917 for (int i = 0; i < jump_table_.length(); i++) {
2918 Deoptimizer::JumpTableEntry* table_entry = &jump_table_[i];
2919 __ bind(&table_entry->label);
2920@@ -293,7 +301,27 @@ bool LCodeGen::GenerateJumpTable() {
2921 if (table_entry->needs_frame) {
2922 DCHECK(!info()->saves_caller_doubles());
2923 __ Move(kScratchRegister, ExternalReference::ForDeoptEntry(entry));
2924+#if __SIZEOF_POINTER__ == 4
2925+ if (needs_frame.is_bound()) {
2926+ __ jmp(&needs_frame);
2927+ } else {
2928+ __ bind(&needs_frame);
2929+ __ movp(rsi, MemOperand(rbp, StandardFrameConstants::kContextOffset));
2930+ __ pushq(rbp);
2931+ __ movp(rbp, rsp);
2932+ __ Push(rsi);
2933+ // This variant of deopt can only be used with stubs. Since we don't
2934+ // have a function pointer to install in the stack frame that we're
2935+ // building, install a special marker there instead.
2936+ DCHECK(info()->IsStub());
2937+ __ Move(rsi, Smi::FromInt(StackFrame::STUB));
2938+ __ Push(rsi);
2939+ __ movp(rsi, MemOperand(rsp, kPointerSize));
2940+ __ call(kScratchRegister);
2941+ }
2942+#else
2943 __ call(&needs_frame);
2944+#endif
2945 } else {
2946 if (info()->saves_caller_doubles()) {
2947 DCHECK(info()->IsStub());
2948@@ -303,6 +331,7 @@ bool LCodeGen::GenerateJumpTable() {
2949 }
2950 }
2951
2952+#if __SIZEOF_POINTER__ != 4
2953 if (needs_frame.is_linked()) {
2954 __ bind(&needs_frame);
2955 /* stack layout
2956@@ -342,6 +371,7 @@ bool LCodeGen::GenerateJumpTable() {
2957 */
2958 __ ret(0);
2959 }
2960+#endif
2961
2962 return !is_aborted();
2963 }
2964@@ -2942,7 +2972,15 @@ Operand LCodeGen::BuildFastArrayOperand(
2965 (constant_value << shift_size) + offset);
2966 } else {
2967 // Guaranteed by ArrayInstructionInterface::KeyedAccessIndexRequirement().
2968+#if __SIZEOF_POINTER__ != 4
2969 DCHECK(key_representation.IsInteger32());
2970+#else
2971+ // Take the tag bit into account while computing the shift size.
2972+ if (key_representation.IsSmi() && (shift_size >= 1)) {
2973+ DCHECK(SmiValuesAre31Bits());
2974+ shift_size -= kSmiTagSize;
2975+ }
2976+#endif
2977
2978 ScaleFactor scale_factor = static_cast<ScaleFactor>(shift_size);
2979 return Operand(elements_pointer_reg,
2980@@ -3709,7 +3747,14 @@ void LCodeGen::DoCallNewArray(LCallNewAr
2981 DCHECK(ToRegister(instr->result()).is(rax));
2982
2983 __ Set(rax, instr->arity());
2984- __ Move(rbx, instr->hydrogen()->site());
2985+ if (instr->arity() == 1) {
2986+ // We only need the allocation site for the case we have a length argument.
2987+ // The case may bail out to the runtime, which will determine the correct
2988+ // elements kind with the site.
2989+ __ Move(rbx, instr->hydrogen()->site());
2990+ } else {
2991+ __ LoadRoot(rbx, Heap::kUndefinedValueRootIndex);
2992+ }
2993
2994 ElementsKind kind = instr->hydrogen()->elements_kind();
2995 AllocationSiteOverrideMode override_mode =
2996@@ -3743,7 +3788,7 @@ void LCodeGen::DoCallNewArray(LCallNewAr
2997 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
2998 __ bind(&done);
2999 } else {
3000- ArrayNArgumentsConstructorStub stub(isolate());
3001+ ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode);
3002 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
3003 }
3004 }
3005diff -urp v8.t5.4.259/src/deoptimize-reason.h v8/src/deoptimize-reason.h
3006--- v8.t5.4.259/src/deoptimize-reason.h 2016-11-14 15:48:15.711026672 -0800
3007+++ v8/src/deoptimize-reason.h 2016-11-14 15:08:43.267025650 -0800
3008@@ -22,6 +22,8 @@ namespace internal {
3009 V(ExpectedSmi, "Expected smi") \
3010 V(ForcedDeoptToRuntime, "Forced deopt to runtime") \
3011 V(Hole, "hole") \
3012+ V(HoleyArrayDespitePackedElements_kindFeedback, \
3013+ "Holey array despite packed elements_kind feedback") \
3014 V(InstanceMigrationFailed, "instance migration failed") \
3015 V(InsufficientTypeFeedbackForCallWithArguments, \
3016 "Insufficient type feedback for call with arguments") \
3017diff -urp v8.t5.4.259/src/factory.cc v8/src/factory.cc
3018--- v8.t5.4.259/src/factory.cc 2016-11-14 15:48:15.721027058 -0800
3019+++ v8/src/factory.cc 2016-11-14 15:08:43.268025689 -0800
3020@@ -115,10 +115,11 @@ Factory::NewSloppyBlockWithEvalContextEx
3021 }
3022
3023 Handle<Oddball> Factory::NewOddball(Handle<Map> map, const char* to_string,
3024- Handle<Object> to_number,
3025+ Handle<Object> to_number, bool to_boolean,
3026 const char* type_of, byte kind) {
3027 Handle<Oddball> oddball = New<Oddball>(map, OLD_SPACE);
3028- Oddball::Initialize(isolate(), oddball, to_string, to_number, type_of, kind);
3029+ Oddball::Initialize(isolate(), oddball, to_string, to_number, to_boolean,
3030+ type_of, kind);
3031 return oddball;
3032 }
3033
3034@@ -2378,18 +2379,6 @@ Handle<Object> Factory::ToBoolean(bool v
3035 return value ? true_value() : false_value();
3036 }
3037
3038-Handle<String> Factory::ToPrimitiveHintString(ToPrimitiveHint hint) {
3039- switch (hint) {
3040- case ToPrimitiveHint::kDefault:
3041- return default_string();
3042- case ToPrimitiveHint::kNumber:
3043- return number_string();
3044- case ToPrimitiveHint::kString:
3045- return string_string();
3046- }
3047- UNREACHABLE();
3048- return Handle<String>::null();
3049-}
3050
3051 Handle<Map> Factory::CreateSloppyFunctionMap(FunctionMode function_mode) {
3052 Handle<Map> map = NewMap(JS_FUNCTION_TYPE, JSFunction::kSize);
3053diff -urp v8.t5.4.259/src/factory.h v8/src/factory.h
3054--- v8.t5.4.259/src/factory.h 2016-11-14 15:48:15.722027096 -0800
3055+++ v8/src/factory.h 2016-11-14 15:08:43.269025728 -0800
3056@@ -24,8 +24,8 @@ enum FunctionMode {
3057 class Factory final {
3058 public:
3059 Handle<Oddball> NewOddball(Handle<Map> map, const char* to_string,
3060- Handle<Object> to_number, const char* type_of,
3061- byte kind);
3062+ Handle<Object> to_number, bool to_boolean,
3063+ const char* type_of, byte kind);
3064
3065 // Allocates a fixed array initialized with undefined values.
3066 Handle<FixedArray> NewFixedArray(
3067@@ -702,9 +702,6 @@ class Factory final {
3068 // Converts the given boolean condition to JavaScript boolean value.
3069 Handle<Object> ToBoolean(bool value);
3070
3071- // Converts the given ToPrimitive hint to it's string representation.
3072- Handle<String> ToPrimitiveHintString(ToPrimitiveHint hint);
3073-
3074 private:
3075 Isolate* isolate() { return reinterpret_cast<Isolate*>(this); }
3076
3077diff -urp v8.t5.4.259/src/flag-definitions.h v8/src/flag-definitions.h
3078--- v8.t5.4.259/src/flag-definitions.h 2016-11-14 15:48:15.725027212 -0800
3079+++ v8/src/flag-definitions.h 2016-11-14 15:08:43.269025728 -0800
3080@@ -780,7 +780,11 @@ DEFINE_BOOL(use_idle_notification, true,
3081 // ic.cc
3082 DEFINE_BOOL(use_ic, true, "use inline caching")
3083 DEFINE_BOOL(trace_ic, false, "trace inline cache state transitions")
3084+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
3085+DEFINE_BOOL(tf_load_ic_stub, false, "use TF LoadIC stub")
3086+#else
3087 DEFINE_BOOL(tf_load_ic_stub, true, "use TF LoadIC stub")
3088+#endif
3089
3090 // macro-assembler-ia32.cc
3091 DEFINE_BOOL(native_code_counters, false,
3092diff -urp v8.t5.4.259/src/full-codegen/full-codegen.cc v8/src/full-codegen/full-codegen.cc
3093--- v8.t5.4.259/src/full-codegen/full-codegen.cc 2016-11-14 15:48:15.735027597 -0800
3094+++ v8/src/full-codegen/full-codegen.cc 2016-11-14 15:08:43.270025768 -0800
3095@@ -990,7 +990,7 @@ void FullCodeGenerator::EmitNewClosure(H
3096 // doesn't just get a copy of the existing unoptimized code.
3097 if (!FLAG_always_opt && !FLAG_prepare_always_opt && !pretenure &&
3098 scope()->is_function_scope()) {
3099- FastNewClosureStub stub(isolate());
3100+ FastNewClosureStub stub(isolate(), info->language_mode(), info->kind());
3101 __ Move(stub.GetCallInterfaceDescriptor().GetRegisterParameter(0), info);
3102 __ CallStub(&stub);
3103 } else {
3104diff -urp v8.t5.4.259/src/full-codegen/x64/full-codegen-x64.cc v8/src/full-codegen/x64/full-codegen-x64.cc
3105--- v8.t5.4.259/src/full-codegen/x64/full-codegen-x64.cc 2016-11-14 15:48:15.747028059 -0800
3106+++ v8/src/full-codegen/x64/full-codegen-x64.cc 2016-11-14 15:08:43.271025807 -0800
3107@@ -12,6 +12,9 @@
3108 #include "src/full-codegen/full-codegen.h"
3109 #include "src/ic/ic.h"
3110 #include "src/parsing/parser.h"
3111+#if 1
3112+#include "src/x64/code-stubs-x64.h"
3113+#endif
3114
3115 namespace v8 {
3116 namespace internal {
3117@@ -3173,7 +3176,12 @@ void FullCodeGenerator::VisitCountOperat
3118 }
3119
3120 // Convert old value into a number.
3121+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
3122+ ToNumberStub convert_stub(isolate());
3123+ __ CallStub(&convert_stub);
3124+#else
3125 __ Call(isolate()->builtins()->ToNumber(), RelocInfo::CODE_TARGET);
3126+#endif
3127 RestoreContext();
3128 PrepareForBailoutForId(expr->ToNumberId(), BailoutState::TOS_REGISTER);
3129
3130diff -urp v8.t5.4.259/src/globals.h v8/src/globals.h
3131--- v8.t5.4.259/src/globals.h 2016-11-14 15:48:15.751028213 -0800
3132+++ v8/src/globals.h 2016-11-14 15:08:43.272025846 -0800
3133@@ -787,14 +787,6 @@ inline std::ostream& operator<<(std::ost
3134 return os;
3135 }
3136
3137-// Valid hints for the abstract operation OrdinaryToPrimitive,
3138-// implemented according to ES6, section 7.1.1.
3139-enum class OrdinaryToPrimitiveHint { kNumber, kString };
3140-
3141-// Valid hints for the abstract operation ToPrimitive,
3142-// implemented according to ES6, section 7.1.1.
3143-enum class ToPrimitiveHint { kDefault, kNumber, kString };
3144-
3145 // Defines specifics about arguments object or rest parameter creation.
3146 enum class CreateArgumentsType : uint8_t {
3147 kMappedArguments,
3148diff -urp v8.t5.4.259/src/heap/heap.cc v8/src/heap/heap.cc
3149--- v8.t5.4.259/src/heap/heap.cc 2016-11-14 15:48:15.756028406 -0800
3150+++ v8/src/heap/heap.cc 2016-11-14 15:08:43.273025885 -0800
3151@@ -2604,60 +2604,62 @@ void Heap::CreateInitialObjects() {
3152
3153 // Finish initializing oddballs after creating the string table.
3154 Oddball::Initialize(isolate(), factory->undefined_value(), "undefined",
3155- factory->nan_value(), "undefined", Oddball::kUndefined);
3156+ factory->nan_value(), false, "undefined",
3157+ Oddball::kUndefined);
3158
3159 // Initialize the null_value.
3160 Oddball::Initialize(isolate(), factory->null_value(), "null",
3161- handle(Smi::FromInt(0), isolate()), "object",
3162+ handle(Smi::FromInt(0), isolate()), false, "object",
3163 Oddball::kNull);
3164
3165 // Initialize the_hole_value.
3166 Oddball::Initialize(isolate(), factory->the_hole_value(), "hole",
3167- handle(Smi::FromInt(-1), isolate()), "undefined",
3168+ handle(Smi::FromInt(-1), isolate()), false, "undefined",
3169 Oddball::kTheHole);
3170
3171 // Initialize the true_value.
3172 Oddball::Initialize(isolate(), factory->true_value(), "true",
3173- handle(Smi::FromInt(1), isolate()), "boolean",
3174+ handle(Smi::FromInt(1), isolate()), true, "boolean",
3175 Oddball::kTrue);
3176
3177 // Initialize the false_value.
3178 Oddball::Initialize(isolate(), factory->false_value(), "false",
3179- handle(Smi::FromInt(0), isolate()), "boolean",
3180+ handle(Smi::FromInt(0), isolate()), false, "boolean",
3181 Oddball::kFalse);
3182
3183 set_uninitialized_value(
3184 *factory->NewOddball(factory->uninitialized_map(), "uninitialized",
3185- handle(Smi::FromInt(-1), isolate()), "undefined",
3186- Oddball::kUninitialized));
3187+ handle(Smi::FromInt(-1), isolate()), false,
3188+ "undefined", Oddball::kUninitialized));
3189
3190 set_arguments_marker(
3191 *factory->NewOddball(factory->arguments_marker_map(), "arguments_marker",
3192- handle(Smi::FromInt(-4), isolate()), "undefined",
3193- Oddball::kArgumentsMarker));
3194+ handle(Smi::FromInt(-4), isolate()), false,
3195+ "undefined", Oddball::kArgumentsMarker));
3196
3197 set_no_interceptor_result_sentinel(*factory->NewOddball(
3198 factory->no_interceptor_result_sentinel_map(),
3199 "no_interceptor_result_sentinel", handle(Smi::FromInt(-2), isolate()),
3200- "undefined", Oddball::kOther));
3201+ false, "undefined", Oddball::kOther));
3202
3203 set_termination_exception(*factory->NewOddball(
3204 factory->termination_exception_map(), "termination_exception",
3205- handle(Smi::FromInt(-3), isolate()), "undefined", Oddball::kOther));
3206+ handle(Smi::FromInt(-3), isolate()), false, "undefined",
3207+ Oddball::kOther));
3208
3209 set_exception(*factory->NewOddball(factory->exception_map(), "exception",
3210- handle(Smi::FromInt(-5), isolate()),
3211+ handle(Smi::FromInt(-5), isolate()), false,
3212 "undefined", Oddball::kException));
3213
3214- set_optimized_out(*factory->NewOddball(factory->optimized_out_map(),
3215- "optimized_out",
3216- handle(Smi::FromInt(-6), isolate()),
3217- "undefined", Oddball::kOptimizedOut));
3218+ set_optimized_out(
3219+ *factory->NewOddball(factory->optimized_out_map(), "optimized_out",
3220+ handle(Smi::FromInt(-6), isolate()), false,
3221+ "undefined", Oddball::kOptimizedOut));
3222
3223 set_stale_register(
3224 *factory->NewOddball(factory->stale_register_map(), "stale_register",
3225- handle(Smi::FromInt(-7), isolate()), "undefined",
3226- Oddball::kStaleRegister));
3227+ handle(Smi::FromInt(-7), isolate()), false,
3228+ "undefined", Oddball::kStaleRegister));
3229
3230 for (unsigned i = 0; i < arraysize(constant_string_table); i++) {
3231 Handle<String> str =
3232diff -urp v8.t5.4.259/src/ic/arm/handler-compiler-arm.cc v8/src/ic/arm/handler-compiler-arm.cc
3233--- v8.t5.4.259/src/ic/arm/handler-compiler-arm.cc 2016-11-14 15:48:15.786029561 -0800
3234+++ v8/src/ic/arm/handler-compiler-arm.cc 2016-11-14 15:08:43.274025924 -0800
3235@@ -339,6 +339,15 @@ static void StoreIC_PushArgs(MacroAssemb
3236 }
3237
3238
3239+void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
3240+ StoreIC_PushArgs(masm);
3241+
3242+ // The slow case calls into the runtime to complete the store without causing
3243+ // an IC miss that would otherwise cause a transition to the generic stub.
3244+ __ TailCallRuntime(Runtime::kStoreIC_Slow);
3245+}
3246+
3247+
3248 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
3249 StoreIC_PushArgs(masm);
3250
3251diff -urp v8.t5.4.259/src/ic/arm64/handler-compiler-arm64.cc v8/src/ic/arm64/handler-compiler-arm64.cc
3252--- v8.t5.4.259/src/ic/arm64/handler-compiler-arm64.cc 2016-11-14 15:48:15.788029638 -0800
3253+++ v8/src/ic/arm64/handler-compiler-arm64.cc 2016-11-14 15:08:43.274025924 -0800
3254@@ -332,6 +332,15 @@ static void StoreIC_PushArgs(MacroAssemb
3255 }
3256
3257
3258+void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
3259+ StoreIC_PushArgs(masm);
3260+
3261+ // The slow case calls into the runtime to complete the store without causing
3262+ // an IC miss that would otherwise cause a transition to the generic stub.
3263+ __ TailCallRuntime(Runtime::kStoreIC_Slow);
3264+}
3265+
3266+
3267 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
3268 ASM_LOCATION("ElementHandlerCompiler::GenerateStoreSlow");
3269 StoreIC_PushArgs(masm);
3270diff -urp v8.t5.4.259/src/ic/handler-compiler.cc v8/src/ic/handler-compiler.cc
3271--- v8.t5.4.259/src/ic/handler-compiler.cc 2016-11-14 15:48:15.789029677 -0800
3272+++ v8/src/ic/handler-compiler.cc 2016-11-14 15:08:43.274025924 -0800
3273@@ -221,26 +221,30 @@ Handle<Code> NamedLoadHandlerCompiler::C
3274 return GetCode(kind(), name);
3275 }
3276
3277+
3278 Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback(
3279- Handle<Name> name, Handle<AccessorInfo> callback, Handle<Code> slow_stub) {
3280+ Handle<Name> name, Handle<AccessorInfo> callback) {
3281+ Register reg = Frontend(name);
3282 if (FLAG_runtime_call_stats) {
3283- GenerateTailCall(masm(), slow_stub);
3284+ TailCallBuiltin(masm(), Builtins::kLoadIC_Slow);
3285+ } else {
3286+ GenerateLoadCallback(reg, callback);
3287 }
3288- Register reg = Frontend(name);
3289- GenerateLoadCallback(reg, callback);
3290 return GetCode(kind(), name);
3291 }
3292
3293+
3294 Handle<Code> NamedLoadHandlerCompiler::CompileLoadCallback(
3295 Handle<Name> name, const CallOptimization& call_optimization,
3296- int accessor_index, Handle<Code> slow_stub) {
3297+ int accessor_index) {
3298 DCHECK(call_optimization.is_simple_api_call());
3299+ Register holder = Frontend(name);
3300 if (FLAG_runtime_call_stats) {
3301- GenerateTailCall(masm(), slow_stub);
3302+ TailCallBuiltin(masm(), Builtins::kLoadIC_Slow);
3303+ } else {
3304+ GenerateApiAccessorCall(masm(), call_optimization, map(), receiver(),
3305+ scratch2(), false, no_reg, holder, accessor_index);
3306 }
3307- Register holder = Frontend(name);
3308- GenerateApiAccessorCall(masm(), call_optimization, map(), receiver(),
3309- scratch2(), false, no_reg, holder, accessor_index);
3310 return GetCode(kind(), name);
3311 }
3312
3313@@ -559,17 +563,19 @@ Handle<Code> NamedStoreHandlerCompiler::
3314 return GetCode(kind(), name);
3315 }
3316
3317+
3318 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
3319 Handle<JSObject> object, Handle<Name> name,
3320- const CallOptimization& call_optimization, int accessor_index,
3321- Handle<Code> slow_stub) {
3322+ const CallOptimization& call_optimization, int accessor_index) {
3323+ Register holder = Frontend(name);
3324 if (FLAG_runtime_call_stats) {
3325- GenerateTailCall(masm(), slow_stub);
3326+ GenerateRestoreName(name);
3327+ TailCallBuiltin(masm(), Builtins::kStoreIC_Slow);
3328+ } else {
3329+ GenerateApiAccessorCall(masm(), call_optimization, handle(object->map()),
3330+ receiver(), scratch2(), true, value(), holder,
3331+ accessor_index);
3332 }
3333- Register holder = Frontend(name);
3334- GenerateApiAccessorCall(masm(), call_optimization, handle(object->map()),
3335- receiver(), scratch2(), true, value(), holder,
3336- accessor_index);
3337 return GetCode(kind(), name);
3338 }
3339
3340diff -urp v8.t5.4.259/src/ic/handler-compiler.h v8/src/ic/handler-compiler.h
3341--- v8.t5.4.259/src/ic/handler-compiler.h 2016-11-14 15:48:15.790029715 -0800
3342+++ v8/src/ic/handler-compiler.h 2016-11-14 15:08:43.275025963 -0800
3343@@ -123,12 +123,11 @@ class NamedLoadHandlerCompiler : public
3344 Handle<Code> CompileLoadField(Handle<Name> name, FieldIndex index);
3345
3346 Handle<Code> CompileLoadCallback(Handle<Name> name,
3347- Handle<AccessorInfo> callback,
3348- Handle<Code> slow_stub);
3349+ Handle<AccessorInfo> callback);
3350
3351 Handle<Code> CompileLoadCallback(Handle<Name> name,
3352 const CallOptimization& call_optimization,
3353- int accessor_index, Handle<Code> slow_stub);
3354+ int accessor_index);
3355
3356 Handle<Code> CompileLoadConstant(Handle<Name> name, int constant_index);
3357
3358@@ -227,7 +226,7 @@ class NamedStoreHandlerCompiler : public
3359 LanguageMode language_mode);
3360 Handle<Code> CompileStoreCallback(Handle<JSObject> object, Handle<Name> name,
3361 const CallOptimization& call_optimization,
3362- int accessor_index, Handle<Code> slow_stub);
3363+ int accessor_index);
3364 Handle<Code> CompileStoreViaSetter(Handle<JSObject> object, Handle<Name> name,
3365 int accessor_index,
3366 int expected_arguments);
3367@@ -242,6 +241,8 @@ class NamedStoreHandlerCompiler : public
3368 no_reg);
3369 }
3370
3371+ static void GenerateSlow(MacroAssembler* masm);
3372+
3373 protected:
3374 virtual Register FrontendHeader(Register object_reg, Handle<Name> name,
3375 Label* miss, ReturnHolder return_what);
3376@@ -266,6 +267,18 @@ class NamedStoreHandlerCompiler : public
3377 void GenerateFieldTypeChecks(FieldType* field_type, Register value_reg,
3378 Label* miss_label);
3379
3380+ static Builtins::Name SlowBuiltin(Code::Kind kind) {
3381+ switch (kind) {
3382+ case Code::STORE_IC:
3383+ return Builtins::kStoreIC_Slow;
3384+ case Code::KEYED_STORE_IC:
3385+ return Builtins::kKeyedStoreIC_Slow;
3386+ default:
3387+ UNREACHABLE();
3388+ }
3389+ return Builtins::kStoreIC_Slow;
3390+ }
3391+
3392 static Register value();
3393 };
3394
3395diff -urp v8.t5.4.259/src/ic/ia32/handler-compiler-ia32.cc v8/src/ic/ia32/handler-compiler-ia32.cc
3396--- v8.t5.4.259/src/ic/ia32/handler-compiler-ia32.cc 2016-11-14 15:48:15.790029715 -0800
3397+++ v8/src/ic/ia32/handler-compiler-ia32.cc 2016-11-14 15:08:43.275025963 -0800
3398@@ -333,6 +333,15 @@ static void StoreIC_PushArgs(MacroAssemb
3399 }
3400
3401
3402+void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
3403+ // Return address is on the stack.
3404+ StoreIC_PushArgs(masm);
3405+
3406+ // Do tail-call to runtime routine.
3407+ __ TailCallRuntime(Runtime::kStoreIC_Slow);
3408+}
3409+
3410+
3411 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
3412 // Return address is on the stack.
3413 StoreIC_PushArgs(masm);
3414diff -urp v8.t5.4.259/src/ic/ic.cc v8/src/ic/ic.cc
3415--- v8.t5.4.259/src/ic/ic.cc 2016-11-14 15:48:15.794029869 -0800
3416+++ v8/src/ic/ic.cc 2016-11-14 15:08:43.276026003 -0800
3417@@ -1131,12 +1131,14 @@ Handle<Object> LoadIC::GetMapIndependent
3418 // Ruled out by IsCompatibleReceiver() above.
3419 DCHECK(AccessorInfo::IsCompatibleReceiverMap(isolate(), info, map));
3420 if (!holder->HasFastProperties()) return slow_stub();
3421+#if !(__SIZEOF_POINTER__ == 4)
3422 if (receiver_is_holder) {
3423 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadApiGetterStub);
3424 int index = lookup->GetAccessorIndex();
3425 LoadApiGetterStub stub(isolate(), true, index);
3426 return stub.GetCode();
3427 }
3428+#endif
3429 if (info->is_sloppy() && !receiver->IsJSReceiver()) {
3430 TRACE_HANDLER_STATS(isolate(), LoadIC_SlowStub);
3431 return slow_stub();
3432@@ -1258,7 +1260,7 @@ Handle<Code> LoadIC::CompileHandler(Look
3433 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadCallback);
3434 int index = lookup->GetAccessorIndex();
3435 Handle<Code> code = compiler.CompileLoadCallback(
3436- lookup->name(), call_optimization, index, slow_stub());
3437+ lookup->name(), call_optimization, index);
3438 return code;
3439 }
3440 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadViaGetter);
3441@@ -1273,12 +1275,11 @@ Handle<Code> LoadIC::CompileHandler(Look
3442 DCHECK(v8::ToCData<Address>(info->getter()) != nullptr);
3443 DCHECK(AccessorInfo::IsCompatibleReceiverMap(isolate(), info, map));
3444 DCHECK(holder->HasFastProperties());
3445- DCHECK(!receiver_is_holder);
3446+// DCHECK(!receiver_is_holder);
3447 DCHECK(!info->is_sloppy() || receiver->IsJSReceiver());
3448 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadCallback);
3449 NamedLoadHandlerCompiler compiler(isolate(), map, holder, cache_holder);
3450- Handle<Code> code =
3451- compiler.CompileLoadCallback(lookup->name(), info, slow_stub());
3452+ Handle<Code> code = compiler.CompileLoadCallback(lookup->name(), info);
3453 return code;
3454 }
3455 UNREACHABLE();
3456@@ -1841,7 +1842,7 @@ Handle<Code> StoreIC::CompileHandler(Loo
3457 TRACE_HANDLER_STATS(isolate(), StoreIC_StoreCallback);
3458 Handle<Code> code = compiler.CompileStoreCallback(
3459 receiver, lookup->name(), call_optimization,
3460- lookup->GetAccessorIndex(), slow_stub());
3461+ lookup->GetAccessorIndex());
3462 return code;
3463 }
3464 TRACE_HANDLER_STATS(isolate(), StoreIC_StoreViaSetter);
3465@@ -2535,6 +2536,22 @@ RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Mi
3466 }
3467
3468
3469+RUNTIME_FUNCTION(Runtime_StoreIC_Slow) {
3470+ HandleScope scope(isolate);
3471+ DCHECK(args.length() == 5);
3472+ Handle<Object> object = args.at<Object>(0);
3473+ Handle<Object> key = args.at<Object>(1);
3474+ Handle<Object> value = args.at<Object>(2);
3475+ LanguageMode language_mode;
3476+ StoreICNexus nexus(isolate);
3477+ StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus);
3478+ language_mode = ic.language_mode();
3479+ RETURN_RESULT_OR_FAILURE(
3480+ isolate,
3481+ Runtime::SetObjectProperty(isolate, object, key, value, language_mode));
3482+}
3483+
3484+
3485 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Slow) {
3486 HandleScope scope(isolate);
3487 DCHECK_EQ(5, args.length());
3488diff -urp v8.t5.4.259/src/ic/ic.h v8/src/ic/ic.h
3489--- v8.t5.4.259/src/ic/ic.h 2016-11-14 15:48:15.795029908 -0800
3490+++ v8/src/ic/ic.h 2016-11-14 15:08:43.276026003 -0800
3491@@ -328,6 +328,10 @@ class LoadGlobalIC : public LoadIC {
3492
3493 static void Clear(Isolate* isolate, Code* host, LoadGlobalICNexus* nexus);
3494
3495+ // Code generators for stub routines. Only called once at startup.
3496+ static void GenerateSlow(MacroAssembler* masm);
3497+ static void GenerateMiss(MacroAssembler* masm);
3498+
3499 protected:
3500 Handle<Code> slow_stub() const override {
3501 if (LoadGlobalICState::GetTypeofMode(extra_ic_state()) ==
3502@@ -403,15 +407,7 @@ class StoreIC : public IC {
3503 protected:
3504 // Stub accessors.
3505 Handle<Code> slow_stub() const {
3506- switch (language_mode()) {
3507- case SLOPPY:
3508- return isolate()->builtins()->StoreIC_SlowSloppy();
3509- case STRICT:
3510- return isolate()->builtins()->StoreIC_SlowStrict();
3511- default:
3512- UNREACHABLE();
3513- return Handle<Code>();
3514- }
3515+ return isolate()->builtins()->StoreIC_Slow();
3516 }
3517
3518 // Update the inline cache and the global stub cache based on the
3519diff -urp v8.t5.4.259/src/ic/mips/handler-compiler-mips.cc v8/src/ic/mips/handler-compiler-mips.cc
3520--- v8.t5.4.259/src/ic/mips/handler-compiler-mips.cc 2016-11-14 15:48:15.796029946 -0800
3521+++ v8/src/ic/mips/handler-compiler-mips.cc 2016-11-14 15:08:43.277026042 -0800
3522@@ -326,6 +326,15 @@ static void StoreIC_PushArgs(MacroAssemb
3523 }
3524
3525
3526+void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
3527+ StoreIC_PushArgs(masm);
3528+
3529+ // The slow case calls into the runtime to complete the store without causing
3530+ // an IC miss that would otherwise cause a transition to the generic stub.
3531+ __ TailCallRuntime(Runtime::kStoreIC_Slow);
3532+}
3533+
3534+
3535 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
3536 StoreIC_PushArgs(masm);
3537
3538diff -urp v8.t5.4.259/src/ic/mips64/handler-compiler-mips64.cc v8/src/ic/mips64/handler-compiler-mips64.cc
3539--- v8.t5.4.259/src/ic/mips64/handler-compiler-mips64.cc 2016-11-14 15:48:15.798030023 -0800
3540+++ v8/src/ic/mips64/handler-compiler-mips64.cc 2016-11-14 15:08:43.277026042 -0800
3541@@ -326,6 +326,15 @@ static void StoreIC_PushArgs(MacroAssemb
3542 }
3543
3544
3545+void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
3546+ StoreIC_PushArgs(masm);
3547+
3548+ // The slow case calls into the runtime to complete the store without causing
3549+ // an IC miss that would otherwise cause a transition to the generic stub.
3550+ __ TailCallRuntime(Runtime::kStoreIC_Slow);
3551+}
3552+
3553+
3554 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
3555 StoreIC_PushArgs(masm);
3556
3557diff -urp v8.t5.4.259/src/ic/ppc/handler-compiler-ppc.cc v8/src/ic/ppc/handler-compiler-ppc.cc
3558--- v8.t5.4.259/src/ic/ppc/handler-compiler-ppc.cc 2016-11-14 15:48:15.800030100 -0800
3559+++ v8/src/ic/ppc/handler-compiler-ppc.cc 2016-11-14 15:08:43.277026042 -0800
3560@@ -334,6 +334,15 @@ static void StoreIC_PushArgs(MacroAssemb
3561 }
3562
3563
3564+void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
3565+ StoreIC_PushArgs(masm);
3566+
3567+ // The slow case calls into the runtime to complete the store without causing
3568+ // an IC miss that would otherwise cause a transition to the generic stub.
3569+ __ TailCallRuntime(Runtime::kStoreIC_Slow);
3570+}
3571+
3572+
3573 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
3574 StoreIC_PushArgs(masm);
3575
3576diff -urp v8.t5.4.259/src/ic/s390/handler-compiler-s390.cc v8/src/ic/s390/handler-compiler-s390.cc
3577--- v8.t5.4.259/src/ic/s390/handler-compiler-s390.cc 2016-11-14 15:48:15.802030177 -0800
3578+++ v8/src/ic/s390/handler-compiler-s390.cc 2016-11-14 15:08:43.278026081 -0800
3579@@ -317,6 +317,14 @@ static void StoreIC_PushArgs(MacroAssemb
3580 StoreWithVectorDescriptor::VectorRegister());
3581 }
3582
3583+void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
3584+ StoreIC_PushArgs(masm);
3585+
3586+ // The slow case calls into the runtime to complete the store without causing
3587+ // an IC miss that would otherwise cause a transition to the generic stub.
3588+ __ TailCallRuntime(Runtime::kStoreIC_Slow);
3589+}
3590+
3591 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
3592 StoreIC_PushArgs(masm);
3593
3594diff -urp v8.t5.4.259/src/ic/x64/handler-compiler-x64.cc v8/src/ic/x64/handler-compiler-x64.cc
3595--- v8.t5.4.259/src/ic/x64/handler-compiler-x64.cc 2016-11-14 15:48:15.804030255 -0800
3596+++ v8/src/ic/x64/handler-compiler-x64.cc 2016-11-14 15:08:43.278026081 -0800
3597@@ -340,6 +340,15 @@ static void StoreIC_PushArgs(MacroAssemb
3598 }
3599
3600
3601+void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
3602+ // Return address is on the stack.
3603+ StoreIC_PushArgs(masm);
3604+
3605+ // Do tail-call to runtime routine.
3606+ __ TailCallRuntime(Runtime::kStoreIC_Slow);
3607+}
3608+
3609+
3610 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
3611 // Return address is on the stack.
3612 StoreIC_PushArgs(masm);
3613diff -urp v8.t5.4.259/src/ic/x64/ic-x64.cc v8/src/ic/x64/ic-x64.cc
3614--- v8.t5.4.259/src/ic/x64/ic-x64.cc 2016-11-14 15:48:15.805030293 -0800
3615+++ v8/src/ic/x64/ic-x64.cc 2016-11-14 15:08:43.278026081 -0800
3616@@ -648,6 +648,21 @@ static void LoadIC_PushArgs(MacroAssembl
3617 __ PushReturnAddressFrom(rdi);
3618 }
3619
3620+static void LoadGlobalIC_PushArgs(MacroAssembler* masm) {
3621+ Register receiver = LoadDescriptor::ReceiverRegister();
3622+ Register name = LoadDescriptor::NameRegister();
3623+ Register slot = LoadDescriptor::SlotRegister();
3624+ Register vector = LoadWithVectorDescriptor::VectorRegister();
3625+ DCHECK(!rdi.is(receiver) && !rdi.is(name) && !rdi.is(slot) &&
3626+ !rdi.is(vector));
3627+
3628+ __ PopReturnAddressTo(rdi);
3629+ __ Push(receiver);
3630+ __ Push(name);
3631+ __ Push(slot);
3632+ __ Push(vector);
3633+ __ PushReturnAddressFrom(rdi);
3634+}
3635
3636 void LoadIC::GenerateMiss(MacroAssembler* masm) {
3637 // The return address is on the stack.
3638@@ -661,6 +676,18 @@ void LoadIC::GenerateMiss(MacroAssembler
3639 __ TailCallRuntime(Runtime::kLoadIC_Miss);
3640 }
3641
3642+void LoadGlobalIC::GenerateMiss(MacroAssembler* masm) {
3643+ // The return address is on the stack.
3644+
3645+ Counters* counters = masm->isolate()->counters();
3646+ __ IncrementCounter(counters->ic_load_miss(), 1);
3647+
3648+ LoadGlobalIC_PushArgs(masm);
3649+
3650+ // Perform tail call to the entry.
3651+ __ TailCallRuntime(Runtime::kLoadGlobalIC_Miss);
3652+}
3653+
3654 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
3655 // The return address is on the stack.
3656 Register receiver = LoadDescriptor::ReceiverRegister();
3657diff -urp v8.t5.4.259/src/ic/x87/handler-compiler-x87.cc v8/src/ic/x87/handler-compiler-x87.cc
3658--- v8.t5.4.259/src/ic/x87/handler-compiler-x87.cc 2016-11-14 15:48:15.806030332 -0800
3659+++ v8/src/ic/x87/handler-compiler-x87.cc 2016-11-14 15:08:43.279026121 -0800
3660@@ -333,6 +333,15 @@ static void StoreIC_PushArgs(MacroAssemb
3661 }
3662
3663
3664+void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
3665+ // Return address is on the stack.
3666+ StoreIC_PushArgs(masm);
3667+
3668+ // Do tail-call to runtime routine.
3669+ __ TailCallRuntime(Runtime::kStoreIC_Slow);
3670+}
3671+
3672+
3673 void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
3674 // Return address is on the stack.
3675 StoreIC_PushArgs(masm);
3676diff -urp v8.t5.4.259/src/interface-descriptors.cc v8/src/interface-descriptors.cc
3677--- v8.t5.4.259/src/interface-descriptors.cc 2016-11-14 15:48:15.808030409 -0800
3678+++ v8/src/interface-descriptors.cc 2016-11-14 15:08:43.279026121 -0800
3679@@ -506,6 +506,7 @@ ArrayNoArgumentConstructorDescriptor::Bu
3680 return function;
3681 }
3682
3683+#if 0
3684 FunctionType* ArraySingleArgumentConstructorDescriptor::
3685 BuildCallInterfaceDescriptorFunctionType(Isolate* isolate,
3686 int parameter_count) {
3687@@ -520,7 +521,9 @@ FunctionType* ArraySingleArgumentConstru
3688 function->InitParameter(kArraySizeSmiParameter, AnyTagged(zone));
3689 return function;
3690 }
3691+#endif
3692
3693+#if 0
3694 FunctionType*
3695 ArrayNArgumentsConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType(
3696 Isolate* isolate, int parameter_count) {
3697@@ -533,6 +536,7 @@ ArrayNArgumentsConstructorDescriptor::Bu
3698 function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone));
3699 return function;
3700 }
3701+#endif
3702
3703 FunctionType*
3704 ArgumentAdaptorDescriptor::BuildCallInterfaceDescriptorFunctionType(
3705@@ -604,5 +608,32 @@ InterpreterDispatchDescriptor::BuildCall
3706 return function;
3707 }
3708
3709+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
3710+FunctionType*
3711+ArrayConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType(
3712+ Isolate* isolate, int paramater_count) {
3713+ Zone* zone = isolate->interface_descriptor_zone();
3714+ FunctionType* function =
3715+ Type::Function(AnyTagged(zone), Type::Undefined(), 3, zone)->AsFunction();
3716+ function->InitParameter(0, Type::Receiver()); // JSFunction
3717+ function->InitParameter(1, AnyTagged(zone));
3718+ function->InitParameter(2, UntaggedIntegral32(zone));
3719+ return function;
3720+}
3721+
3722+FunctionType*
3723+InternalArrayConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType(
3724+ Isolate* isolate, int paramater_count) {
3725+ Zone* zone = isolate->interface_descriptor_zone();
3726+ FunctionType* function =
3727+ Type::Function(AnyTagged(zone), Type::Undefined(), 2, zone)->AsFunction();
3728+ function->InitParameter(0, Type::Receiver()); // JSFunction
3729+ function->InitParameter(1, UntaggedIntegral32(zone));
3730+ return function;
3731+}
3732+
3733+
3734+#endif
3735+
3736 } // namespace internal
3737 } // namespace v8
3738diff -urp v8.t5.4.259/src/interface-descriptors.h v8/src/interface-descriptors.h
3739--- v8.t5.4.259/src/interface-descriptors.h 2016-11-14 15:48:15.809030447 -0800
3740+++ v8/src/interface-descriptors.h 2016-11-14 15:28:41.252736646 -0800
3741@@ -15,6 +15,9 @@ namespace internal {
3742
3743 class PlatformInterfaceDescriptor;
3744
3745+// V(ToNumber)
3746+
3747+
3748 #define INTERFACE_DESCRIPTOR_LIST(V) \
3749 V(Void) \
3750 V(ContextOnly) \
3751@@ -68,8 +71,6 @@ class PlatformInterfaceDescriptor;
3752 V(AllocateUint8x16) \
3753 V(AllocateBool8x16) \
3754 V(ArrayNoArgumentConstructor) \
3755- V(ArraySingleArgumentConstructor) \
3756- V(ArrayNArgumentsConstructor) \
3757 V(Compare) \
3758 V(BinaryOp) \
3759 V(BinaryOpWithAllocationSite) \
3760@@ -100,7 +101,15 @@ class PlatformInterfaceDescriptor;
3761 V(InterpreterPushArgsAndCall) \
3762 V(InterpreterPushArgsAndConstruct) \
3763 V(InterpreterCEntry) \
3764- V(ResumeGenerator)
3765+ V(ResumeGenerator) \
3766+ V(ArrayConstructorConstantArgCount) \
3767+ V(InternalArrayConstructorConstantArgCount) \
3768+ V(InternalArrayConstructor) \
3769+ V(ArraySingleArgumentConstructor) \
3770+ V(ArrayConstructor)
3771+
3772+// V(ArrayNArgumentsConstructor)
3773+
3774
3775 class CallInterfaceDescriptorData {
3776 public:
3777@@ -475,6 +484,13 @@ class FastNewClosureDescriptor : public
3778 DECLARE_DESCRIPTOR(FastNewClosureDescriptor, CallInterfaceDescriptor)
3779 };
3780
3781+#if (defined(__x86_64__) && __SIZEOF_POINTER__ == 4) && 0
3782+class ToNumberDescriptor : public CallInterfaceDescriptor {
3783+ public:
3784+ DECLARE_DESCRIPTOR(ToNumberDescriptor, CallInterfaceDescriptor)
3785+};
3786+#endif
3787+
3788 class FastNewFunctionContextDescriptor : public CallInterfaceDescriptor {
3789 public:
3790 DEFINE_PARAMETERS(kFunction)
3791@@ -677,6 +693,7 @@ class ArrayNoArgumentConstructorDescript
3792 ArrayNoArgumentConstructorDescriptor, CallInterfaceDescriptor)
3793 };
3794
3795+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
3796 class ArraySingleArgumentConstructorDescriptor
3797 : public CallInterfaceDescriptor {
3798 public:
3799@@ -685,13 +702,25 @@ class ArraySingleArgumentConstructorDesc
3800 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
3801 ArraySingleArgumentConstructorDescriptor, CallInterfaceDescriptor)
3802 };
3803+#endif
3804+
3805+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
3806+class ArrayConstructorDescriptor : public CallInterfaceDescriptor {
3807+ public:
3808+ DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(ArrayConstructorDescriptor,
3809+ CallInterfaceDescriptor)
3810+};
3811+#endif
3812+
3813
3814+#if 0
3815 class ArrayNArgumentsConstructorDescriptor : public CallInterfaceDescriptor {
3816 public:
3817 DEFINE_PARAMETERS(kFunction, kAllocationSite, kActualArgumentsCount)
3818 DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
3819 ArrayNArgumentsConstructorDescriptor, CallInterfaceDescriptor)
3820 };
3821+#endif
3822
3823
3824 class CompareDescriptor : public CallInterfaceDescriptor {
3825@@ -700,6 +729,26 @@ class CompareDescriptor : public CallInt
3826 DECLARE_DESCRIPTOR(CompareDescriptor, CallInterfaceDescriptor)
3827 };
3828
3829+class InternalArrayConstructorDescriptor : public CallInterfaceDescriptor {
3830+ public:
3831+ DECLARE_DESCRIPTOR_WITH_CUSTOM_FUNCTION_TYPE(
3832+ InternalArrayConstructorDescriptor, CallInterfaceDescriptor)
3833+};
3834+
3835+#if 1
3836+class ArrayConstructorConstantArgCountDescriptor : public CallInterfaceDescriptor {
3837+ public:
3838+ DECLARE_DESCRIPTOR(ArrayConstructorConstantArgCountDescriptor, CallInterfaceDescriptor)
3839+};
3840+#endif
3841+
3842+#if 1
3843+class InternalArrayConstructorConstantArgCountDescriptor : public CallInterfaceDescriptor {
3844+ public:
3845+ DECLARE_DESCRIPTOR(InternalArrayConstructorConstantArgCountDescriptor, CallInterfaceDescriptor)
3846+};
3847+#endif
3848+
3849
3850 class BinaryOpDescriptor : public CallInterfaceDescriptor {
3851 public:
3852diff -urp v8.t5.4.259/src/interpreter/bytecode-array-builder.cc v8/src/interpreter/bytecode-array-builder.cc
3853--- v8.t5.4.259/src/interpreter/bytecode-array-builder.cc 2016-11-14 15:48:15.809030447 -0800
3854+++ v8/src/interpreter/bytecode-array-builder.cc 2016-11-14 15:08:43.280026160 -0800
3855@@ -330,10 +330,10 @@ BytecodeArrayBuilder& BytecodeArrayBuild
3856 }
3857
3858 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateClosure(
3859- Handle<SharedFunctionInfo> shared_info, int flags) {
3860+ Handle<SharedFunctionInfo> shared_info, PretenureFlag tenured) {
3861 size_t entry = GetConstantPoolEntry(shared_info);
3862 Output(Bytecode::kCreateClosure, UnsignedOperand(entry),
3863- UnsignedOperand(flags));
3864+ UnsignedOperand(static_cast<size_t>(tenured)));
3865 return *this;
3866 }
3867
3868diff -urp v8.t5.4.259/src/interpreter/bytecode-array-builder.h v8/src/interpreter/bytecode-array-builder.h
3869--- v8.t5.4.259/src/interpreter/bytecode-array-builder.h 2016-11-14 15:48:15.810030486 -0800
3870+++ v8/src/interpreter/bytecode-array-builder.h 2016-11-14 15:08:43.281026199 -0800
3871@@ -133,7 +133,7 @@ class BytecodeArrayBuilder final : publi
3872
3873 // Create a new closure for the SharedFunctionInfo.
3874 BytecodeArrayBuilder& CreateClosure(Handle<SharedFunctionInfo> shared_info,
3875- int flags);
3876+ PretenureFlag tenured);
3877
3878 // Create a new arguments object in the accumulator.
3879 BytecodeArrayBuilder& CreateArguments(CreateArgumentsType type);
3880diff -urp v8.t5.4.259/src/interpreter/bytecode-generator.cc v8/src/interpreter/bytecode-generator.cc
3881--- v8.t5.4.259/src/interpreter/bytecode-generator.cc 2016-11-14 15:48:15.812030563 -0800
3882+++ v8/src/interpreter/bytecode-generator.cc 2016-11-14 15:08:43.282026238 -0800
3883@@ -1363,9 +1363,8 @@ void BytecodeGenerator::VisitFunctionLit
3884 if (shared_info.is_null()) {
3885 return SetStackOverflow();
3886 }
3887- uint8_t flags = CreateClosureFlags::Encode(expr->pretenure(),
3888- scope()->is_function_scope());
3889- builder()->CreateClosure(shared_info, flags);
3890+ builder()->CreateClosure(shared_info,
3891+ expr->pretenure() ? TENURED : NOT_TENURED);
3892 execution_result()->SetResultInAccumulator();
3893 }
3894
3895@@ -1570,10 +1569,18 @@ void BytecodeGenerator::VisitRegExpLiter
3896
3897 void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
3898 // Copy the literal boilerplate.
3899- uint8_t flags = CreateObjectLiteralFlags::Encode(
3900- FastCloneShallowObjectStub::IsSupported(expr),
3901- FastCloneShallowObjectStub::PropertiesCount(expr->properties_count()),
3902- expr->ComputeFlags());
3903+ int fast_clone_properties_count = 0;
3904+ if (FastCloneShallowObjectStub::IsSupported(expr)) {
3905+ STATIC_ASSERT(
3906+ FastCloneShallowObjectStub::kMaximumClonedProperties <=
3907+ 1 << CreateObjectLiteralFlags::FastClonePropertiesCountBits::kShift);
3908+ fast_clone_properties_count =
3909+ FastCloneShallowObjectStub::PropertiesCount(expr->properties_count());
3910+ }
3911+ uint8_t flags =
3912+ CreateObjectLiteralFlags::FlagsBits::encode(expr->ComputeFlags()) |
3913+ CreateObjectLiteralFlags::FastClonePropertiesCountBits::encode(
3914+ fast_clone_properties_count);
3915 builder()->CreateObjectLiteral(expr->constant_properties(),
3916 expr->literal_index(), flags);
3917
3918diff -urp v8.t5.4.259/src/interpreter/interpreter.cc v8/src/interpreter/interpreter.cc
3919--- v8.t5.4.259/src/interpreter/interpreter.cc 2016-11-14 15:48:15.817030755 -0800
3920+++ v8/src/interpreter/interpreter.cc 2016-11-14 15:08:43.292026631 -0800
3921@@ -1079,18 +1079,19 @@ void Interpreter::DoDec(InterpreterAssem
3922 DoUnaryOp<DecStub>(assembler);
3923 }
3924
3925-// LogicalNot
3926-//
3927-// Perform logical-not on the accumulator, first casting the
3928-// accumulator to a boolean value if required.
3929-// ToBooleanLogicalNot
3930-void Interpreter::DoToBooleanLogicalNot(InterpreterAssembler* assembler) {
3931- Node* value = __ GetAccumulator();
3932+Node* Interpreter::BuildToBoolean(Node* value,
3933+ InterpreterAssembler* assembler) {
3934+ Node* context = __ GetContext();
3935+ return ToBooleanStub::Generate(assembler, value, context);
3936+}
3937+
3938+Node* Interpreter::BuildLogicalNot(Node* value,
3939+ InterpreterAssembler* assembler) {
3940 Variable result(assembler, MachineRepresentation::kTagged);
3941 Label if_true(assembler), if_false(assembler), end(assembler);
3942 Node* true_value = __ BooleanConstant(true);
3943 Node* false_value = __ BooleanConstant(false);
3944- __ BranchIfToBooleanIsTrue(value, &if_true, &if_false);
3945+ __ BranchIfWordEqual(value, true_value, &if_true, &if_false);
3946 __ Bind(&if_true);
3947 {
3948 result.Bind(false_value);
3949@@ -1098,11 +1099,27 @@ void Interpreter::DoToBooleanLogicalNot(
3950 }
3951 __ Bind(&if_false);
3952 {
3953+ if (FLAG_debug_code) {
3954+ __ AbortIfWordNotEqual(value, false_value,
3955+ BailoutReason::kExpectedBooleanValue);
3956+ }
3957 result.Bind(true_value);
3958 __ Goto(&end);
3959 }
3960 __ Bind(&end);
3961- __ SetAccumulator(result.value());
3962+ return result.value();
3963+}
3964+
3965+// LogicalNot
3966+//
3967+// Perform logical-not on the accumulator, first casting the
3968+// accumulator to a boolean value if required.
3969+// ToBooleanLogicalNot
3970+void Interpreter::DoToBooleanLogicalNot(InterpreterAssembler* assembler) {
3971+ Node* value = __ GetAccumulator();
3972+ Node* to_boolean_value = BuildToBoolean(value, assembler);
3973+ Node* result = BuildLogicalNot(to_boolean_value, assembler);
3974+ __ SetAccumulator(result);
3975 __ Dispatch();
3976 }
3977
3978@@ -1112,27 +1129,8 @@ void Interpreter::DoToBooleanLogicalNot(
3979 // value.
3980 void Interpreter::DoLogicalNot(InterpreterAssembler* assembler) {
3981 Node* value = __ GetAccumulator();
3982- Variable result(assembler, MachineRepresentation::kTagged);
3983- Label if_true(assembler), if_false(assembler), end(assembler);
3984- Node* true_value = __ BooleanConstant(true);
3985- Node* false_value = __ BooleanConstant(false);
3986- __ BranchIfWordEqual(value, true_value, &if_true, &if_false);
3987- __ Bind(&if_true);
3988- {
3989- result.Bind(false_value);
3990- __ Goto(&end);
3991- }
3992- __ Bind(&if_false);
3993- {
3994- if (FLAG_debug_code) {
3995- __ AbortIfWordNotEqual(value, false_value,
3996- BailoutReason::kExpectedBooleanValue);
3997- }
3998- result.Bind(true_value);
3999- __ Goto(&end);
4000- }
4001- __ Bind(&end);
4002- __ SetAccumulator(result.value());
4003+ Node* result = BuildLogicalNot(value, assembler);
4004+ __ SetAccumulator(result);
4005 __ Dispatch();
4006 }
4007
4008@@ -1467,14 +1465,11 @@ void Interpreter::DoJumpIfFalseConstant(
4009 // Jump by number of bytes represented by an immediate operand if the object
4010 // referenced by the accumulator is true when the object is cast to boolean.
4011 void Interpreter::DoJumpIfToBooleanTrue(InterpreterAssembler* assembler) {
4012- Node* value = __ GetAccumulator();
4013+ Node* accumulator = __ GetAccumulator();
4014+ Node* to_boolean_value = BuildToBoolean(accumulator, assembler);
4015 Node* relative_jump = __ BytecodeOperandImm(0);
4016- Label if_true(assembler), if_false(assembler);
4017- __ BranchIfToBooleanIsTrue(value, &if_true, &if_false);
4018- __ Bind(&if_true);
4019- __ Jump(relative_jump);
4020- __ Bind(&if_false);
4021- __ Dispatch();
4022+ Node* true_value = __ BooleanConstant(true);
4023+ __ JumpIfWordEqual(to_boolean_value, true_value, relative_jump);
4024 }
4025
4026 // JumpIfToBooleanTrueConstant <idx>
4027@@ -1484,16 +1479,13 @@ void Interpreter::DoJumpIfToBooleanTrue(
4028 // to boolean.
4029 void Interpreter::DoJumpIfToBooleanTrueConstant(
4030 InterpreterAssembler* assembler) {
4031- Node* value = __ GetAccumulator();
4032+ Node* accumulator = __ GetAccumulator();
4033+ Node* to_boolean_value = BuildToBoolean(accumulator, assembler);
4034 Node* index = __ BytecodeOperandIdx(0);
4035 Node* constant = __ LoadConstantPoolEntry(index);
4036 Node* relative_jump = __ SmiUntag(constant);
4037- Label if_true(assembler), if_false(assembler);
4038- __ BranchIfToBooleanIsTrue(value, &if_true, &if_false);
4039- __ Bind(&if_true);
4040- __ Jump(relative_jump);
4041- __ Bind(&if_false);
4042- __ Dispatch();
4043+ Node* true_value = __ BooleanConstant(true);
4044+ __ JumpIfWordEqual(to_boolean_value, true_value, relative_jump);
4045 }
4046
4047 // JumpIfToBooleanFalse <imm>
4048@@ -1501,14 +1493,11 @@ void Interpreter::DoJumpIfToBooleanTrueC
4049 // Jump by number of bytes represented by an immediate operand if the object
4050 // referenced by the accumulator is false when the object is cast to boolean.
4051 void Interpreter::DoJumpIfToBooleanFalse(InterpreterAssembler* assembler) {
4052- Node* value = __ GetAccumulator();
4053+ Node* accumulator = __ GetAccumulator();
4054+ Node* to_boolean_value = BuildToBoolean(accumulator, assembler);
4055 Node* relative_jump = __ BytecodeOperandImm(0);
4056- Label if_true(assembler), if_false(assembler);
4057- __ BranchIfToBooleanIsTrue(value, &if_true, &if_false);
4058- __ Bind(&if_true);
4059- __ Dispatch();
4060- __ Bind(&if_false);
4061- __ Jump(relative_jump);
4062+ Node* false_value = __ BooleanConstant(false);
4063+ __ JumpIfWordEqual(to_boolean_value, false_value, relative_jump);
4064 }
4065
4066 // JumpIfToBooleanFalseConstant <idx>
4067@@ -1518,16 +1507,13 @@ void Interpreter::DoJumpIfToBooleanFalse
4068 // to boolean.
4069 void Interpreter::DoJumpIfToBooleanFalseConstant(
4070 InterpreterAssembler* assembler) {
4071- Node* value = __ GetAccumulator();
4072+ Node* accumulator = __ GetAccumulator();
4073+ Node* to_boolean_value = BuildToBoolean(accumulator, assembler);
4074 Node* index = __ BytecodeOperandIdx(0);
4075 Node* constant = __ LoadConstantPoolEntry(index);
4076 Node* relative_jump = __ SmiUntag(constant);
4077- Label if_true(assembler), if_false(assembler);
4078- __ BranchIfToBooleanIsTrue(value, &if_true, &if_false);
4079- __ Bind(&if_true);
4080- __ Dispatch();
4081- __ Bind(&if_false);
4082- __ Jump(relative_jump);
4083+ Node* false_value = __ BooleanConstant(false);
4084+ __ JumpIfWordEqual(to_boolean_value, false_value, relative_jump);
4085 }
4086
4087 // JumpIfNull <imm>
4088@@ -1699,29 +1685,17 @@ void Interpreter::DoCreateObjectLiteral(
4089 // Creates a new closure for SharedFunctionInfo at position |index| in the
4090 // constant pool and with the PretenureFlag <tenured>.
4091 void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) {
4092+ // TODO(rmcilroy): Possibly call FastNewClosureStub when possible instead of
4093+ // calling into the runtime.
4094 Node* index = __ BytecodeOperandIdx(0);
4095 Node* shared = __ LoadConstantPoolEntry(index);
4096- Node* flags = __ BytecodeOperandFlag(1);
4097+ Node* tenured_raw = __ BytecodeOperandFlag(1);
4098+ Node* tenured = __ SmiTag(tenured_raw);
4099 Node* context = __ GetContext();
4100-
4101- Label call_runtime(assembler, Label::kDeferred);
4102- Node* fast_new_closure = __ Word32And(
4103- flags, __ Int32Constant(CreateClosureFlags::FastNewClosureBit::kMask));
4104- __ GotoUnless(fast_new_closure, &call_runtime);
4105- __ SetAccumulator(FastNewClosureStub::Generate(assembler, shared, context));
4106+ Node* result =
4107+ __ CallRuntime(Runtime::kInterpreterNewClosure, context, shared, tenured);
4108+ __ SetAccumulator(result);
4109 __ Dispatch();
4110-
4111- __ Bind(&call_runtime);
4112- {
4113- STATIC_ASSERT(CreateClosureFlags::PretenuredBit::kShift == 0);
4114- Node* tenured_raw = __ Word32And(
4115- flags, __ Int32Constant(CreateClosureFlags::PretenuredBit::kMask));
4116- Node* tenured = __ SmiTag(tenured_raw);
4117- Node* result = __ CallRuntime(Runtime::kInterpreterNewClosure, context,
4118- shared, tenured);
4119- __ SetAccumulator(result);
4120- __ Dispatch();
4121- }
4122 }
4123
4124 // CreateMappedArguments
4125diff -urp v8.t5.4.259/src/interpreter/interpreter.h v8/src/interpreter/interpreter.h
4126--- v8.t5.4.259/src/interpreter/interpreter.h 2016-11-14 15:48:15.818030794 -0800
4127+++ v8/src/interpreter/interpreter.h 2016-11-14 15:08:43.292026631 -0800
4128@@ -159,6 +159,16 @@ class Interpreter {
4129 compiler::Node* BuildUnaryOp(Callable callable,
4130 InterpreterAssembler* assembler);
4131
4132+ // Generates code to perform logical-not on boolean |value| and returns the
4133+ // result.
4134+ compiler::Node* BuildLogicalNot(compiler::Node* value,
4135+ InterpreterAssembler* assembler);
4136+
4137+ // Generates code to convert |value| to a boolean and returns the
4138+ // result.
4139+ compiler::Node* BuildToBoolean(compiler::Node* value,
4140+ InterpreterAssembler* assembler);
4141+
4142 uintptr_t GetDispatchCounter(Bytecode from, Bytecode to) const;
4143
4144 // Get dispatch table index of bytecode.
4145diff -urp v8.t5.4.259/src/js/array.js v8/src/js/array.js
4146--- v8.t5.4.259/src/js/array.js 2016-11-14 15:48:15.820030871 -0800
4147+++ v8/src/js/array.js 2016-11-14 15:08:43.293026670 -0800
4148@@ -49,13 +49,14 @@ function KeySortCompare(a, b) {
4149 }
4150
4151 function GetSortedArrayKeys(array, indices) {
4152+ var is_array = IS_ARRAY(array);
4153 if (IS_NUMBER(indices)) {
4154 // It's an interval
4155 var limit = indices;
4156 var keys = new InternalArray();
4157 for (var i = 0; i < limit; ++i) {
4158 var e = array[i];
4159- if (!IS_UNDEFINED(e) || i in array) {
4160+ if (!IS_UNDEFINED(e) || HAS_INDEX(array, i, is_array)) {
4161 keys.push(i);
4162 }
4163 }
4164@@ -198,13 +199,14 @@ function ConvertToString(use_locale, x)
4165 // This function implements the optimized splice implementation that can use
4166 // special array operations to handle sparse arrays in a sensible fashion.
4167 function SparseSlice(array, start_i, del_count, len, deleted_elements) {
4168+ var is_array = IS_ARRAY(array);
4169 // Move deleted elements to a new array (the return value from splice).
4170 var indices = %GetArrayKeys(array, start_i + del_count);
4171 if (IS_NUMBER(indices)) {
4172 var limit = indices;
4173 for (var i = start_i; i < limit; ++i) {
4174 var current = array[i];
4175- if (!IS_UNDEFINED(current) || i in array) {
4176+ if (!IS_UNDEFINED(current) || HAS_INDEX(array, i, is_array)) {
4177 %CreateDataProperty(deleted_elements, i - start_i, current);
4178 }
4179 }
4180@@ -214,7 +216,7 @@ function SparseSlice(array, start_i, del
4181 var key = indices[k];
4182 if (key >= start_i) {
4183 var current = array[key];
4184- if (!IS_UNDEFINED(current) || key in array) {
4185+ if (!IS_UNDEFINED(current) || HAS_INDEX(array, key, is_array)) {
4186 %CreateDataProperty(deleted_elements, key - start_i, current);
4187 }
4188 }
4189@@ -226,6 +228,7 @@ function SparseSlice(array, start_i, del
4190 // This function implements the optimized splice implementation that can use
4191 // special array operations to handle sparse arrays in a sensible fashion.
4192 function SparseMove(array, start_i, del_count, len, num_additional_args) {
4193+ var is_array = IS_ARRAY(array);
4194 // Bail out if no moving is necessary.
4195 if (num_additional_args === del_count) return;
4196 // Move data to new array.
4197@@ -238,13 +241,13 @@ function SparseMove(array, start_i, del_
4198 var limit = indices;
4199 for (var i = 0; i < start_i && i < limit; ++i) {
4200 var current = array[i];
4201- if (!IS_UNDEFINED(current) || i in array) {
4202+ if (!IS_UNDEFINED(current) || HAS_INDEX(array, i, is_array)) {
4203 new_array[i] = current;
4204 }
4205 }
4206 for (var i = start_i + del_count; i < limit; ++i) {
4207 var current = array[i];
4208- if (!IS_UNDEFINED(current) || i in array) {
4209+ if (!IS_UNDEFINED(current) || HAS_INDEX(array, i, is_array)) {
4210 new_array[i - del_count + num_additional_args] = current;
4211 }
4212 }
4213@@ -254,12 +257,12 @@ function SparseMove(array, start_i, del_
4214 var key = indices[k];
4215 if (key < start_i) {
4216 var current = array[key];
4217- if (!IS_UNDEFINED(current) || key in array) {
4218+ if (!IS_UNDEFINED(current) || HAS_INDEX(array, key, is_array)) {
4219 new_array[key] = current;
4220 }
4221 } else if (key >= start_i + del_count) {
4222 var current = array[key];
4223- if (!IS_UNDEFINED(current) || key in array) {
4224+ if (!IS_UNDEFINED(current) || HAS_INDEX(array, key, is_array)) {
4225 var new_key = key - del_count + num_additional_args;
4226 new_array[new_key] = current;
4227 if (new_key > 0xfffffffe) {
4228@@ -287,9 +290,10 @@ function SparseMove(array, start_i, del_
4229 // because the receiver is not an array (so we have no choice) or because we
4230 // know we are not deleting or moving a lot of elements.
4231 function SimpleSlice(array, start_i, del_count, len, deleted_elements) {
4232+ var is_array = IS_ARRAY(array);
4233 for (var i = 0; i < del_count; i++) {
4234 var index = start_i + i;
4235- if (index in array) {
4236+ if (HAS_INDEX(array, index, is_array)) {
4237 var current = array[index];
4238 %CreateDataProperty(deleted_elements, i, current);
4239 }
4240@@ -298,6 +302,7 @@ function SimpleSlice(array, start_i, del
4241
4242
4243 function SimpleMove(array, start_i, del_count, len, num_additional_args) {
4244+ var is_array = IS_ARRAY(array);
4245 if (num_additional_args !== del_count) {
4246 // Move the existing elements after the elements to be deleted
4247 // to the right position in the resulting array.
4248@@ -305,7 +310,7 @@ function SimpleMove(array, start_i, del_
4249 for (var i = len - del_count; i > start_i; i--) {
4250 var from_index = i + del_count - 1;
4251 var to_index = i + num_additional_args - 1;
4252- if (from_index in array) {
4253+ if (HAS_INDEX(array, from_index, is_array)) {
4254 array[to_index] = array[from_index];
4255 } else {
4256 delete array[to_index];
4257@@ -315,7 +320,7 @@ function SimpleMove(array, start_i, del_
4258 for (var i = start_i; i < len - del_count; i++) {
4259 var from_index = i + del_count;
4260 var to_index = i + num_additional_args;
4261- if (from_index in array) {
4262+ if (HAS_INDEX(array, from_index, is_array)) {
4263 array[to_index] = array[from_index];
4264 } else {
4265 delete array[to_index];
4266@@ -438,6 +443,7 @@ function ArrayPush() {
4267
4268 // For implementing reverse() on large, sparse arrays.
4269 function SparseReverse(array, len) {
4270+ var is_array = IS_ARRAY(array);
4271 var keys = GetSortedArrayKeys(array, %GetArrayKeys(array, len));
4272 var high_counter = keys.length - 1;
4273 var low_counter = 0;
4274@@ -460,9 +466,9 @@ function SparseReverse(array, len) {
4275 }
4276
4277 var current_i = array[low];
4278- if (!IS_UNDEFINED(current_i) || low in array) {
4279+ if (!IS_UNDEFINED(current_i) || HAS_INDEX(array, low, is_array)) {
4280 var current_j = array[high];
4281- if (!IS_UNDEFINED(current_j) || high in array) {
4282+ if (!IS_UNDEFINED(current_j) || HAS_INDEX(array, high, is_array)) {
4283 array[low] = current_j;
4284 array[high] = current_i;
4285 } else {
4286@@ -471,7 +477,7 @@ function SparseReverse(array, len) {
4287 }
4288 } else {
4289 var current_j = array[high];
4290- if (!IS_UNDEFINED(current_j) || high in array) {
4291+ if (!IS_UNDEFINED(current_j) || HAS_INDEX(array, high, is_array)) {
4292 array[low] = current_j;
4293 delete array[high];
4294 }
4295@@ -492,11 +498,12 @@ function PackedArrayReverse(array, len)
4296
4297
4298 function GenericArrayReverse(array, len) {
4299+ var is_array = IS_ARRAY(array);
4300 var j = len - 1;
4301 for (var i = 0; i < j; i++, j--) {
4302- if (i in array) {
4303+ if (HAS_INDEX(array, i, is_array)) {
4304 var current_i = array[i];
4305- if (j in array) {
4306+ if (HAS_INDEX(array, j, is_array)) {
4307 var current_j = array[j];
4308 array[i] = current_j;
4309 array[j] = current_i;
4310@@ -505,7 +512,7 @@ function GenericArrayReverse(array, len)
4311 delete array[i];
4312 }
4313 } else {
4314- if (j in array) {
4315+ if (HAS_INDEX(array, j, is_array)) {
4316 var current_j = array[j];
4317 array[i] = current_j;
4318 delete array[j];
4319@@ -1010,8 +1017,9 @@ function ArraySort(comparefn) {
4320 // or delete elements from the array.
4321 function InnerArrayFilter(f, receiver, array, length, result) {
4322 var result_length = 0;
4323+ var is_array = IS_ARRAY(array);
4324 for (var i = 0; i < length; i++) {
4325- if (i in array) {
4326+ if (HAS_INDEX(array, i, is_array)) {
4327 var element = array[i];
4328 if (%_Call(f, receiver, element, i, array)) {
4329 %CreateDataProperty(result, result_length, element);
4330@@ -1038,18 +1046,19 @@ function ArrayFilter(f, receiver) {
4331
4332
4333 function InnerArrayForEach(f, receiver, array, length) {
4334+ var is_array = IS_ARRAY(array);
4335 if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f);
4336
4337 if (IS_UNDEFINED(receiver)) {
4338 for (var i = 0; i < length; i++) {
4339- if (i in array) {
4340+ if (HAS_INDEX(array, i, is_array)) {
4341 var element = array[i];
4342 f(element, i, array);
4343 }
4344 }
4345 } else {
4346 for (var i = 0; i < length; i++) {
4347- if (i in array) {
4348+ if (HAS_INDEX(array, i, is_array)) {
4349 var element = array[i];
4350 %_Call(f, receiver, element, i, array);
4351 }
4352@@ -1070,10 +1079,11 @@ function ArrayForEach(f, receiver) {
4353
4354
4355 function InnerArraySome(f, receiver, array, length) {
4356+ var is_array = IS_ARRAY(array);
4357 if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f);
4358
4359 for (var i = 0; i < length; i++) {
4360- if (i in array) {
4361+ if (HAS_INDEX(array, i, is_array)) {
4362 var element = array[i];
4363 if (%_Call(f, receiver, element, i, array)) return true;
4364 }
4365@@ -1096,10 +1106,11 @@ function ArraySome(f, receiver) {
4366
4367
4368 function InnerArrayEvery(f, receiver, array, length) {
4369+ var is_array = IS_ARRAY(array);
4370 if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f);
4371
4372 for (var i = 0; i < length; i++) {
4373- if (i in array) {
4374+ if (HAS_INDEX(array, i, is_array)) {
4375 var element = array[i];
4376 if (!%_Call(f, receiver, element, i, array)) return false;
4377 }
4378@@ -1127,8 +1138,9 @@ function ArrayMap(f, receiver) {
4379 var length = TO_LENGTH(array.length);
4380 if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f);
4381 var result = ArraySpeciesCreate(array, length);
4382+ var is_array = IS_ARRAY(array);
4383 for (var i = 0; i < length; i++) {
4384- if (i in array) {
4385+ if (HAS_INDEX(array, i, is_array)) {
4386 var element = array[i];
4387 %CreateDataProperty(result, i, %_Call(f, receiver, element, i, array));
4388 }
4389@@ -1142,6 +1154,7 @@ function ArrayMap(f, receiver) {
4390 // .lastIndexOf, we need to pass it, since the behavior for passing
4391 // undefined is 0 but for not including the argument is length-1.
4392 function InnerArrayIndexOf(array, element, index, length) {
4393+ var is_array = IS_ARRAY(array);
4394 if (length == 0) return -1;
4395 if (IS_UNDEFINED(index)) {
4396 index = 0;
4397@@ -1187,7 +1200,7 @@ function InnerArrayIndexOf(array, elemen
4398 }
4399 // Lookup through the array.
4400 for (var i = min; i < max; i++) {
4401- if (IS_UNDEFINED(array[i]) && i in array) {
4402+ if (IS_UNDEFINED(array[i]) && HAS_INDEX(array, i, is_array)) {
4403 return i;
4404 }
4405 }
4406@@ -1204,6 +1217,7 @@ function ArrayIndexOf(element, index) {
4407
4408
4409 function InnerArrayLastIndexOf(array, element, index, length, argumentsLength) {
4410+ var is_array = IS_ARRAY(array);
4411 if (length == 0) return -1;
4412 if (argumentsLength < 2) {
4413 index = length - 1;
4414@@ -1245,7 +1259,7 @@ function InnerArrayLastIndexOf(array, el
4415 return -1;
4416 }
4417 for (var i = max; i >= min; i--) {
4418- if (IS_UNDEFINED(array[i]) && i in array) {
4419+ if (IS_UNDEFINED(array[i]) && HAS_INDEX(array, i, is_array)) {
4420 return i;
4421 }
4422 }
4423@@ -1267,10 +1281,11 @@ function InnerArrayReduce(callback, curr
4424 throw MakeTypeError(kCalledNonCallable, callback);
4425 }
4426
4427+ var is_array = IS_ARRAY(array);
4428 var i = 0;
4429 find_initial: if (argumentsLength < 2) {
4430 for (; i < length; i++) {
4431- if (i in array) {
4432+ if (HAS_INDEX(array, i, is_array)) {
4433 current = array[i++];
4434 break find_initial;
4435 }
4436@@ -1279,7 +1294,7 @@ function InnerArrayReduce(callback, curr
4437 }
4438
4439 for (; i < length; i++) {
4440- if (i in array) {
4441+ if (HAS_INDEX(array, i, is_array)) {
4442 var element = array[i];
4443 current = callback(current, element, i, array);
4444 }
4445@@ -1306,10 +1321,11 @@ function InnerArrayReduceRight(callback,
4446 throw MakeTypeError(kCalledNonCallable, callback);
4447 }
4448
4449+ var is_array = IS_ARRAY(array);
4450 var i = length - 1;
4451 find_initial: if (argumentsLength < 2) {
4452 for (; i >= 0; i--) {
4453- if (i in array) {
4454+ if (HAS_INDEX(array, i, is_array)) {
4455 current = array[i--];
4456 break find_initial;
4457 }
4458@@ -1318,7 +1334,7 @@ function InnerArrayReduceRight(callback,
4459 }
4460
4461 for (; i >= 0; i--) {
4462- if (i in array) {
4463+ if (HAS_INDEX(array, i, is_array)) {
4464 var element = array[i];
4465 current = callback(current, element, i, array);
4466 }
4467@@ -1340,6 +1356,7 @@ function ArrayReduceRight(callback, curr
4468
4469
4470 function InnerArrayCopyWithin(target, start, end, array, length) {
4471+ var is_array = IS_ARRAY(array);
4472 target = TO_INTEGER(target);
4473 var to;
4474 if (target < 0) {
4475@@ -1373,7 +1390,7 @@ function InnerArrayCopyWithin(target, st
4476 }
4477
4478 while (count > 0) {
4479- if (from in array) {
4480+ if (HAS_INDEX(array, from, is_array)) {
4481 array[to] = array[from];
4482 } else {
4483 delete array[to];
4484diff -urp v8.t5.4.259/src/js/macros.py v8/src/js/macros.py
4485--- v8.t5.4.259/src/js/macros.py 2016-11-14 15:48:15.824031025 -0800
4486+++ v8/src/js/macros.py 2016-11-14 15:08:43.293026670 -0800
4487@@ -99,6 +99,7 @@ macro TO_STRING(arg) = (%_ToString(arg))
4488 macro TO_NUMBER(arg) = (%_ToNumber(arg));
4489 macro TO_OBJECT(arg) = (%_ToObject(arg));
4490 macro HAS_OWN_PROPERTY(obj, key) = (%_Call(ObjectHasOwnProperty, obj, key));
4491+macro HAS_INDEX(array, index, is_array) = ((is_array && %_HasFastPackedElements(%IS_VAR(array)) && (index < array.length)) || (index in array));
4492
4493 # Private names.
4494 macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym));
4495diff -urp v8.t5.4.259/src/objects-inl.h v8/src/objects-inl.h
4496--- v8.t5.4.259/src/objects-inl.h 2016-11-14 15:48:15.868032720 -0800
4497+++ v8/src/objects-inl.h 2016-11-14 15:08:43.295026748 -0800
4498@@ -1943,6 +1943,7 @@ void Oddball::set_to_number_raw(double v
4499
4500 ACCESSORS(Oddball, to_string, String, kToStringOffset)
4501 ACCESSORS(Oddball, to_number, Object, kToNumberOffset)
4502+ACCESSORS(Oddball, to_boolean, Oddball, kToBooleanOffset)
4503 ACCESSORS(Oddball, type_of, String, kTypeOfOffset)
4504
4505
4506@@ -2285,6 +2286,7 @@ void Struct::InitializeBody(int object_s
4507 }
4508 }
4509
4510+
4511 bool Object::ToArrayLength(uint32_t* index) { return Object::ToUint32(index); }
4512
4513
4514@@ -7855,11 +7857,6 @@ void JSArray::SetContent(Handle<JSArray>
4515 }
4516
4517
4518-bool JSArray::HasArrayPrototype(Isolate* isolate) {
4519- return map()->prototype() == *isolate->initial_array_prototype();
4520-}
4521-
4522-
4523 int TypeFeedbackInfo::ic_total_count() {
4524 int current = Smi::cast(READ_FIELD(this, kStorage1Offset))->value();
4525 return ICTotalCountField::decode(current);
4526diff -urp v8.t5.4.259/src/objects.cc v8/src/objects.cc
4527--- v8.t5.4.259/src/objects.cc 2016-11-14 15:48:15.881033220 -0800
4528+++ v8/src/objects.cc 2016-11-14 15:08:43.301026984 -0800
4529@@ -1826,7 +1826,11 @@ MaybeHandle<Object> Object::ArraySpecies
4530 Isolate* isolate, Handle<Object> original_array) {
4531 Handle<Object> default_species = isolate->array_function();
4532 if (original_array->IsJSArray() &&
4533+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
4534+ Handle<JSReceiver>::cast(original_array)->map()->new_target_is_base() &&
4535+#else
4536 Handle<JSArray>::cast(original_array)->HasArrayPrototype(isolate) &&
4537+#endif
4538 isolate->IsArraySpeciesLookupChainIntact()) {
4539 return default_species;
4540 }
4541@@ -8063,8 +8067,18 @@ MaybeHandle<Object> JSReceiver::ToPrimit
4542 isolate, exotic_to_prim,
4543 GetMethod(receiver, isolate->factory()->to_primitive_symbol()), Object);
4544 if (!exotic_to_prim->IsUndefined(isolate)) {
4545- Handle<Object> hint_string =
4546- isolate->factory()->ToPrimitiveHintString(hint);
4547+ Handle<Object> hint_string;
4548+ switch (hint) {
4549+ case ToPrimitiveHint::kDefault:
4550+ hint_string = isolate->factory()->default_string();
4551+ break;
4552+ case ToPrimitiveHint::kNumber:
4553+ hint_string = isolate->factory()->number_string();
4554+ break;
4555+ case ToPrimitiveHint::kString:
4556+ hint_string = isolate->factory()->string_string();
4557+ break;
4558+ }
4559 Handle<Object> result;
4560 ASSIGN_RETURN_ON_EXCEPTION(
4561 isolate, result,
4562@@ -12673,12 +12687,13 @@ Handle<String> JSFunction::ToString(Hand
4563
4564 void Oddball::Initialize(Isolate* isolate, Handle<Oddball> oddball,
4565 const char* to_string, Handle<Object> to_number,
4566- const char* type_of, byte kind) {
4567+ bool to_boolean, const char* type_of, byte kind) {
4568 Handle<String> internalized_to_string =
4569 isolate->factory()->InternalizeUtf8String(to_string);
4570 Handle<String> internalized_type_of =
4571 isolate->factory()->InternalizeUtf8String(type_of);
4572 oddball->set_to_number_raw(to_number->Number());
4573+ oddball->set_to_boolean(isolate->heap()->ToBoolean(to_boolean));
4574 oddball->set_to_number(*to_number);
4575 oddball->set_to_string(*internalized_to_string);
4576 oddball->set_type_of(*internalized_type_of);
4577@@ -14856,6 +14871,18 @@ Maybe<bool> JSObject::SetPrototype(Handl
4578 ShouldThrow should_throw) {
4579 Isolate* isolate = object->GetIsolate();
4580
4581+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
4582+ // Setting the prototype of an Array instance invalidates the species
4583+ // protector
4584+ // because it could change the constructor property of the instance, which
4585+ // could change the @@species constructor.
4586+ if (object->IsJSArray() && isolate->IsArraySpeciesLookupChainIntact()) {
4587+ isolate->CountUsage(
4588+ v8::Isolate::UseCounterFeature::kArrayInstanceProtoModified);
4589+ isolate->InvalidateArraySpeciesProtector();
4590+ }
4591+#endif
4592+
4593 #ifdef DEBUG
4594 int size = object->Size();
4595 #endif
4596diff -urp v8.t5.4.259/src/objects.h v8/src/objects.h
4597--- v8.t5.4.259/src/objects.h 2016-11-14 15:48:15.888033490 -0800
4598+++ v8/src/objects.h 2016-11-14 15:08:43.304027101 -0800
4599@@ -169,6 +169,16 @@ enum KeyedAccessStoreMode {
4600 };
4601
4602
4603+// Valid hints for the abstract operation ToPrimitive,
4604+// implemented according to ES6, section 7.1.1.
4605+enum class ToPrimitiveHint { kDefault, kNumber, kString };
4606+
4607+
4608+// Valid hints for the abstract operation OrdinaryToPrimitive,
4609+// implemented according to ES6, section 7.1.1.
4610+enum class OrdinaryToPrimitiveHint { kNumber, kString };
4611+
4612+
4613 enum TypeofMode : int { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF };
4614
4615
4616@@ -1854,8 +1864,6 @@ class JSReceiver: public HeapObject {
4617 MUST_USE_RESULT static MaybeHandle<Object> ToPrimitive(
4618 Handle<JSReceiver> receiver,
4619 ToPrimitiveHint hint = ToPrimitiveHint::kDefault);
4620-
4621- // ES6 section 7.1.1.1 OrdinaryToPrimitive
4622 MUST_USE_RESULT static MaybeHandle<Object> OrdinaryToPrimitive(
4623 Handle<JSReceiver> receiver, OrdinaryToPrimitiveHint hint);
4624
4625@@ -7493,21 +7501,9 @@ class SharedFunctionInfo: public HeapObj
4626 static const int kHasDuplicateParametersBit =
4627 kHasDuplicateParameters + kCompilerHintsSmiTagSize;
4628
4629- static const int kIsArrowBit = kIsArrow + kCompilerHintsSmiTagSize;
4630- static const int kIsGeneratorBit = kIsGenerator + kCompilerHintsSmiTagSize;
4631- static const int kIsConciseMethodBit =
4632- kIsConciseMethod + kCompilerHintsSmiTagSize;
4633- static const int kIsAsyncFunctionBit =
4634- kIsAsyncFunction + kCompilerHintsSmiTagSize;
4635-
4636- static const int kAccessorFunctionBits =
4637- FunctionKind::kAccessorFunction
4638- << (kFunctionKind + kCompilerHintsSmiTagSize);
4639 static const int kClassConstructorBits =
4640 FunctionKind::kClassConstructor
4641 << (kFunctionKind + kCompilerHintsSmiTagSize);
4642- static const int kFunctionKindMaskBits = FunctionKindBits::kMask
4643- << kCompilerHintsSmiTagSize;
4644
4645 // Constants for optimizing codegen for strict mode function and
4646 // native tests.
4647@@ -9660,6 +9656,9 @@ class Oddball: public HeapObject {
4648 // [to_number]: Cached to_number computed at startup.
4649 DECL_ACCESSORS(to_number, Object)
4650
4651+ // [to_number]: Cached to_boolean computed at startup.
4652+ DECL_ACCESSORS(to_boolean, Oddball)
4653+
4654 // [typeof]: Cached type_of computed at startup.
4655 DECL_ACCESSORS(type_of, String)
4656
4657@@ -9677,13 +9676,14 @@ class Oddball: public HeapObject {
4658 // Initialize the fields.
4659 static void Initialize(Isolate* isolate, Handle<Oddball> oddball,
4660 const char* to_string, Handle<Object> to_number,
4661- const char* type_of, byte kind);
4662+ bool to_boolean, const char* type_of, byte kind);
4663
4664 // Layout description.
4665 static const int kToNumberRawOffset = HeapObject::kHeaderSize;
4666 static const int kToStringOffset = kToNumberRawOffset + kDoubleSize;
4667 static const int kToNumberOffset = kToStringOffset + kPointerSize;
4668- static const int kTypeOfOffset = kToNumberOffset + kPointerSize;
4669+ static const int kToBooleanOffset = kToNumberOffset + kPointerSize;
4670+ static const int kTypeOfOffset = kToBooleanOffset + kPointerSize;
4671 static const int kKindOffset = kTypeOfOffset + kPointerSize;
4672 static const int kSize = kKindOffset + kPointerSize;
4673
4674@@ -10392,11 +10392,13 @@ class JSArray: public JSObject {
4675 PropertyDescriptor* desc,
4676 ShouldThrow should_throw);
4677
4678+#if !(defined(__x86_64__) && __SIZEOF_POINTER__ == 4)
4679 // Checks whether the Array has the current realm's Array.prototype as its
4680 // prototype. This function is best-effort and only gives a conservative
4681 // approximation, erring on the side of false, in particular with respect
4682 // to Proxies and objects with a hidden prototype.
4683 inline bool HasArrayPrototype(Isolate* isolate);
4684+#endif
4685
4686 DECLARE_CAST(JSArray)
4687
4688diff -urp v8.t5.4.259/src/runtime/runtime-array.cc v8/src/runtime/runtime-array.cc
4689--- v8.t5.4.259/src/runtime/runtime-array.cc 2016-11-14 15:48:15.940035493 -0800
4690+++ v8/src/runtime/runtime-array.cc 2016-11-14 15:08:43.305027141 -0800
4691@@ -321,6 +321,7 @@ Object* ArrayConstructorCommon(Isolate*
4692
4693 } // namespace
4694
4695+
4696 RUNTIME_FUNCTION(Runtime_NewArray) {
4697 HandleScope scope(isolate);
4698 DCHECK_LE(3, args.length());
4699@@ -337,6 +338,72 @@ RUNTIME_FUNCTION(Runtime_NewArray) {
4700 return ArrayConstructorCommon(isolate, constructor, new_target, site, &argv);
4701 }
4702
4703+
4704+RUNTIME_FUNCTION(Runtime_ArrayConstructor) {
4705+ HandleScope scope(isolate);
4706+ // If we get 2 arguments then they are the stub parameters (constructor, type
4707+ // info). If we get 4, then the first one is a pointer to the arguments
4708+ // passed by the caller, and the last one is the length of the arguments
4709+ // passed to the caller (redundant, but useful to check on the deoptimizer
4710+ // with an assert).
4711+ Arguments empty_args(0, NULL);
4712+ bool no_caller_args = args.length() == 2;
4713+ DCHECK(no_caller_args || args.length() == 4);
4714+ int parameters_start = no_caller_args ? 0 : 1;
4715+ Arguments* caller_args =
4716+ no_caller_args ? &empty_args : reinterpret_cast<Arguments*>(args[0]);
4717+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, constructor, parameters_start);
4718+ CONVERT_ARG_HANDLE_CHECKED(Object, type_info, parameters_start + 1);
4719+#ifdef DEBUG
4720+ if (!no_caller_args) {
4721+ CONVERT_SMI_ARG_CHECKED(arg_count, parameters_start + 2);
4722+ DCHECK(arg_count == caller_args->length());
4723+ }
4724+#endif
4725+
4726+ Handle<AllocationSite> site;
4727+ if (!type_info.is_null() && !type_info->IsUndefined(isolate)) {
4728+ site = Handle<AllocationSite>::cast(type_info);
4729+ DCHECK(!site->SitePointsToLiteral());
4730+ }
4731+
4732+ return ArrayConstructorCommon(isolate, constructor, constructor, site,
4733+ caller_args);
4734+}
4735+
4736+RUNTIME_FUNCTION(Runtime_InternalArrayConstructor) {
4737+ HandleScope scope(isolate);
4738+ Arguments empty_args(0, NULL);
4739+ bool no_caller_args = args.length() == 1;
4740+ DCHECK(no_caller_args || args.length() == 3);
4741+ int parameters_start = no_caller_args ? 0 : 1;
4742+ Arguments* caller_args =
4743+ no_caller_args ? &empty_args : reinterpret_cast<Arguments*>(args[0]);
4744+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, constructor, parameters_start);
4745+#ifdef DEBUG
4746+ if (!no_caller_args) {
4747+ CONVERT_SMI_ARG_CHECKED(arg_count, parameters_start + 1);
4748+ DCHECK(arg_count == caller_args->length());
4749+ }
4750+#endif
4751+ return ArrayConstructorCommon(isolate, constructor, constructor,
4752+ Handle<AllocationSite>::null(), caller_args);
4753+}
4754+
4755+RUNTIME_FUNCTION(Runtime_ArraySingleArgumentConstructor) {
4756+ HandleScope scope(isolate);
4757+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, constructor, 0);
4758+ Object** argument_base = reinterpret_cast<Object**>(args[1]);
4759+ CONVERT_SMI_ARG_CHECKED(argument_count, 2);
4760+ CONVERT_ARG_HANDLE_CHECKED(Object, raw_site, 3);
4761+ Handle<AllocationSite> casted_site =
4762+ raw_site->IsUndefined(isolate) ? Handle<AllocationSite>::null()
4763+ : Handle<AllocationSite>::cast(raw_site);
4764+ Arguments constructor_args(argument_count, argument_base);
4765+ return ArrayConstructorCommon(isolate, constructor, constructor, casted_site,
4766+ &constructor_args);
4767+}
4768+
4769 RUNTIME_FUNCTION(Runtime_NormalizeElements) {
4770 HandleScope scope(isolate);
4771 DCHECK(args.length() == 1);
4772diff -urp v8.t5.4.259/src/runtime/runtime-internal.cc v8/src/runtime/runtime-internal.cc
4773--- v8.t5.4.259/src/runtime/runtime-internal.cc 2016-11-14 15:48:15.944035647 -0800
4774+++ v8/src/runtime/runtime-internal.cc 2016-11-14 15:08:43.305027141 -0800
4775@@ -209,11 +209,6 @@ RUNTIME_FUNCTION(Runtime_NewSyntaxError)
4776 return *isolate->factory()->NewSyntaxError(message_template, arg0);
4777 }
4778
4779-RUNTIME_FUNCTION(Runtime_ThrowCannotConvertToPrimitive) {
4780- HandleScope scope(isolate);
4781- THROW_NEW_ERROR_RETURN_FAILURE(
4782- isolate, NewTypeError(MessageTemplate::kCannotConvertToPrimitive));
4783-}
4784
4785 RUNTIME_FUNCTION(Runtime_ThrowIllegalInvocation) {
4786 HandleScope scope(isolate);
4787diff -urp v8.t5.4.259/src/runtime/runtime-object.cc v8/src/runtime/runtime-object.cc
4788--- v8.t5.4.259/src/runtime/runtime-object.cc 2016-11-14 15:48:15.946035724 -0800
4789+++ v8/src/runtime/runtime-object.cc 2016-11-14 15:08:43.305027141 -0800
4790@@ -348,15 +348,10 @@ RUNTIME_FUNCTION(Runtime_GetProperty) {
4791 Runtime::GetObjectProperty(isolate, object, key));
4792 }
4793
4794-RUNTIME_FUNCTION(Runtime_GetGlobal) {
4795- HandleScope scope(isolate);
4796- DCHECK_EQ(3, args.length());
4797- CONVERT_SMI_ARG_CHECKED(slot, 0);
4798- CONVERT_ARG_HANDLE_CHECKED(TypeFeedbackVector, vector, 1);
4799- CONVERT_SMI_ARG_CHECKED(typeof_mode_value, 2);
4800- TypeofMode typeof_mode = static_cast<TypeofMode>(typeof_mode_value);
4801- bool should_throw_reference_error = typeof_mode == NOT_INSIDE_TYPEOF;
4802+namespace {
4803
4804+Object* GetGlobal(Isolate* isolate, int slot, Handle<TypeFeedbackVector> vector,
4805+ bool should_throw_reference_error) {
4806 FeedbackVectorSlot vector_slot = vector->ToSlot(slot);
4807 DCHECK_EQ(FeedbackVectorSlotKind::LOAD_GLOBAL_IC,
4808 vector->GetKind(vector_slot));
4809@@ -389,6 +384,24 @@ RUNTIME_FUNCTION(Runtime_GetGlobal) {
4810 return *result;
4811 }
4812
4813+} // namespace
4814+
4815+RUNTIME_FUNCTION(Runtime_GetGlobalInsideTypeof) {
4816+ HandleScope scope(isolate);
4817+ DCHECK_EQ(2, args.length());
4818+ CONVERT_SMI_ARG_CHECKED(slot, 0);
4819+ CONVERT_ARG_HANDLE_CHECKED(TypeFeedbackVector, vector, 1);
4820+ return GetGlobal(isolate, slot, vector, false);
4821+}
4822+
4823+RUNTIME_FUNCTION(Runtime_GetGlobalNotInsideTypeof) {
4824+ HandleScope scope(isolate);
4825+ DCHECK_EQ(2, args.length());
4826+ CONVERT_SMI_ARG_CHECKED(slot, 0);
4827+ CONVERT_ARG_HANDLE_CHECKED(TypeFeedbackVector, vector, 1);
4828+ return GetGlobal(isolate, slot, vector, true);
4829+}
4830+
4831 // KeyedGetProperty is called from KeyedLoadIC::GenerateGeneric.
4832 RUNTIME_FUNCTION(Runtime_KeyedGetProperty) {
4833 HandleScope scope(isolate);
4834@@ -401,6 +414,7 @@ RUNTIME_FUNCTION(Runtime_KeyedGetPropert
4835 isolate, KeyedGetObjectProperty(isolate, receiver_obj, key_obj));
4836 }
4837
4838+
4839 RUNTIME_FUNCTION(Runtime_AddNamedProperty) {
4840 HandleScope scope(isolate);
4841 DCHECK_EQ(4, args.length());
4842@@ -479,7 +493,8 @@ RUNTIME_FUNCTION(Runtime_SetProperty) {
4843 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
4844 CONVERT_ARG_HANDLE_CHECKED(Object, key, 1);
4845 CONVERT_ARG_HANDLE_CHECKED(Object, value, 2);
4846- CONVERT_LANGUAGE_MODE_ARG_CHECKED(language_mode, 3);
4847+ CONVERT_LANGUAGE_MODE_ARG_CHECKED(language_mode_arg, 3);
4848+ LanguageMode language_mode = language_mode_arg;
4849
4850 RETURN_RESULT_OR_FAILURE(
4851 isolate,
4852@@ -837,6 +852,7 @@ RUNTIME_FUNCTION(Runtime_ToPrimitive_Num
4853 isolate, Object::ToPrimitive(input, ToPrimitiveHint::kNumber));
4854 }
4855
4856+
4857 RUNTIME_FUNCTION(Runtime_ToNumber) {
4858 HandleScope scope(isolate);
4859 DCHECK_EQ(1, args.length());
4860diff -urp v8.t5.4.259/src/runtime/runtime-test.cc v8/src/runtime/runtime-test.cc
4861--- v8.t5.4.259/src/runtime/runtime-test.cc 2016-11-14 15:48:15.949035839 -0800
4862+++ v8/src/runtime/runtime-test.cc 2016-11-14 15:08:43.306027180 -0800
4863@@ -576,6 +576,13 @@ ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Fas
4864
4865 #undef ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION
4866
4867+#if !(defined(__x86_64__) && __SIZEOF_POINTER__ == 4)
4868+RUNTIME_FUNCTION(Runtime_SpeciesProtector) {
4869+ SealHandleScope shs(isolate);
4870+ DCHECK_EQ(0, args.length());
4871+ return isolate->heap()->ToBoolean(isolate->IsArraySpeciesLookupChainIntact());
4872+}
4873+#endif
4874
4875 #define FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION(Type, type, TYPE, ctype, s) \
4876 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \
4877@@ -586,14 +593,5 @@ ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Fas
4878 TYPED_ARRAYS(FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION)
4879
4880 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION
4881-
4882-
4883-RUNTIME_FUNCTION(Runtime_SpeciesProtector) {
4884- SealHandleScope shs(isolate);
4885- DCHECK_EQ(0, args.length());
4886- return isolate->heap()->ToBoolean(isolate->IsArraySpeciesLookupChainIntact());
4887-}
4888-
4889-
4890 } // namespace internal
4891 } // namespace v8
4892diff -urp v8.t5.4.259/src/runtime/runtime.h v8/src/runtime/runtime.h
4893--- v8.t5.4.259/src/runtime/runtime.h 2016-11-14 15:48:15.950035878 -0800
4894+++ v8/src/runtime/runtime.h 2016-11-14 15:09:17.527369598 -0800
4895@@ -35,28 +35,33 @@ namespace internal {
4896 // A variable number of arguments is specified by a -1, additional restrictions
4897 // are specified by inline comments
4898
4899-#define FOR_EACH_INTRINSIC_ARRAY(F) \
4900- F(FinishArrayPrototypeSetup, 1, 1) \
4901- F(SpecialArrayFunctions, 0, 1) \
4902- F(TransitionElementsKind, 2, 1) \
4903- F(RemoveArrayHoles, 2, 1) \
4904- F(MoveArrayContents, 2, 1) \
4905- F(EstimateNumberOfElements, 1, 1) \
4906- F(GetArrayKeys, 2, 1) \
4907- F(NewArray, -1 /* >= 3 */, 1) \
4908- F(ArrayPush, -1, 1) \
4909- F(FunctionBind, -1, 1) \
4910- F(NormalizeElements, 1, 1) \
4911- F(GrowArrayElements, 2, 1) \
4912- F(HasComplexElements, 1, 1) \
4913- F(IsArray, 1, 1) \
4914- F(ArrayIsArray, 1, 1) \
4915- F(HasCachedArrayIndex, 1, 1) \
4916- F(GetCachedArrayIndex, 1, 1) \
4917- F(FixedArrayGet, 2, 1) \
4918- F(FixedArraySet, 3, 1) \
4919+#define FOR_EACH_INTRINSIC_ARRAY(F) \
4920+ F(FinishArrayPrototypeSetup, 1, 1) \
4921+ F(SpecialArrayFunctions, 0, 1) \
4922+ F(TransitionElementsKind, 2, 1) \
4923+ F(RemoveArrayHoles, 2, 1) \
4924+ F(MoveArrayContents, 2, 1) \
4925+ F(EstimateNumberOfElements, 1, 1) \
4926+ F(GetArrayKeys, 2, 1) \
4927+ F(ArrayConstructor, -1, 1) \
4928+ F(NewArray, -1 /* >= 3 */, 1) \
4929+ F(InternalArrayConstructor, -1, 1) \
4930+ F(ArraySingleArgumentConstructor, -1, 1) \
4931+ F(ArrayPush, -1, 1) \
4932+ F(FunctionBind, -1, 1) \
4933+ F(NormalizeElements, 1, 1) \
4934+ F(GrowArrayElements, 2, 1) \
4935+ F(HasComplexElements, 1, 1) \
4936+ F(IsArray, 1, 1) \
4937+ F(ArrayIsArray, 1, 1) \
4938+ F(HasCachedArrayIndex, 1, 1) \
4939+ F(GetCachedArrayIndex, 1, 1) \
4940+ F(FixedArrayGet, 2, 1) \
4941+ F(FixedArraySet, 3, 1) \
4942 F(ArraySpeciesConstructor, 1, 1)
4943
4944+// F(ArraySingleArgumentConstructor, -1, 1)
4945+
4946 #define FOR_EACH_INTRINSIC_ATOMICS(F) \
4947 F(ThrowNotIntegerSharedTypedArrayError, 1, 1) \
4948 F(ThrowNotInt32SharedTypedArrayError, 1, 1) \
4949@@ -292,7 +297,6 @@ namespace internal {
4950 F(NewTypeError, 2, 1) \
4951 F(NewSyntaxError, 2, 1) \
4952 F(NewReferenceError, 2, 1) \
4953- F(ThrowCannotConvertToPrimitive, 0, 1) \
4954 F(ThrowIllegalInvocation, 0, 1) \
4955 F(ThrowIncompatibleMethodReceiver, 2, 1) \
4956 F(ThrowInvalidStringLength, 0, 1) \
4957@@ -370,7 +374,8 @@ namespace internal {
4958 F(SetPrototype, 2, 1) \
4959 F(OptimizeObjectForAddingMultipleProperties, 2, 1) \
4960 F(GetProperty, 2, 1) \
4961- F(GetGlobal, 3, 1) \
4962+ F(GetGlobalInsideTypeof, 2, 1) \
4963+ F(GetGlobalNotInsideTypeof, 2, 1) \
4964 F(KeyedGetProperty, 2, 1) \
4965 F(StoreGlobalViaContext_Sloppy, 2, 1) \
4966 F(StoreGlobalViaContext_Strict, 2, 1) \
4967@@ -878,8 +883,7 @@ namespace internal {
4968 F(HasFixedInt32Elements, 1, 1) \
4969 F(HasFixedFloat32Elements, 1, 1) \
4970 F(HasFixedFloat64Elements, 1, 1) \
4971- F(HasFixedUint8ClampedElements, 1, 1) \
4972- F(SpeciesProtector, 0, 1)
4973+ F(HasFixedUint8ClampedElements, 1, 1)
4974
4975 #define FOR_EACH_INTRINSIC_TYPEDARRAY(F) \
4976 F(ArrayBufferGetByteLength, 1, 1) \
4977@@ -939,6 +943,7 @@ namespace internal {
4978 F(LoadGlobalIC_Miss, 2, 1) \
4979 F(LoadIC_Miss, 4, 1) \
4980 F(LoadIC_MissFromStubFailure, 4, 1) \
4981+ F(StoreIC_Slow, 5, 1) \
4982 F(LoadPropertyWithInterceptor, 3, 1) \
4983 F(LoadPropertyWithInterceptorOnly, 3, 1) \
4984 F(StoreCallbackProperty, 6, 1) \
4985diff -urp v8.t5.4.259/src/v8.gyp v8/src/v8.gyp
4986--- v8.t5.4.259/src/v8.gyp 2016-11-14 15:48:15.995037611 -0800
4987+++ v8/src/v8.gyp 2016-11-14 15:08:43.307027219 -0800
4988@@ -1572,7 +1572,7 @@
4989 'regexp/x64/regexp-macro-assembler-x64.h',
4990 ],
4991 }],
4992- ['v8_target_arch=="x64"', {
4993+ ['v8_target_arch=="x64" or v8_target_arch=="x32"', {
4994 'sources': [
4995 'compiler/x64/code-generator-x64.cc',
4996 'compiler/x64/instruction-codes-x64.h',
4997diff -urp v8.t5.4.259/src/x64/code-stubs-x64.cc v8/src/x64/code-stubs-x64.cc
4998--- v8.t5.4.259/src/x64/code-stubs-x64.cc 2016-11-14 15:48:16.028038882 -0800
4999+++ v8/src/x64/code-stubs-x64.cc 2016-11-14 15:08:43.309027297 -0800
5000@@ -17,21 +17,145 @@
5001 #include "src/runtime/runtime.h"
5002 #include "src/x64/code-stubs-x64.h"
5003
5004+#define __ ACCESS_MASM(masm)
5005+
5006 namespace v8 {
5007 namespace internal {
5008
5009-#define __ ACCESS_MASM(masm)
5010+#if 1
5011+void ToNumberStub::Generate(MacroAssembler* masm) {
5012+ // The ToNumber stub takes one argument in rax.
5013+ Label not_smi;
5014+ __ JumpIfNotSmi(rax, ¬_smi, Label::kNear);
5015+ __ Ret();
5016+ __ bind(¬_smi);
5017
5018-void ArrayNArgumentsConstructorStub::Generate(MacroAssembler* masm) {
5019- __ popq(rcx);
5020- __ movq(MemOperand(rsp, rax, times_8, 0), rdi);
5021- __ pushq(rdi);
5022- __ pushq(rbx);
5023- __ pushq(rcx);
5024- __ addq(rax, Immediate(3));
5025- __ TailCallRuntime(Runtime::kNewArray);
5026+ Label not_heap_number;
5027+ __ CompareRoot(FieldOperand(rax, HeapObject::kMapOffset),
5028+ Heap::kHeapNumberMapRootIndex);
5029+ __ j(not_equal, ¬_heap_number, Label::kNear);
5030+ __ Ret();
5031+ __ bind(¬_heap_number);
5032+
5033+ NonNumberToNumberStub stub(masm->isolate());
5034+ __ TailCallStub(&stub);
5035 }
5036
5037+void NonNumberToNumberStub::Generate(MacroAssembler* masm) {
5038+ // The NonNumberToNumber stub takes one argument in rax.
5039+ __ AssertNotNumber(rax);
5040+
5041+ Label not_string;
5042+ __ CmpObjectType(rax, FIRST_NONSTRING_TYPE, rdi);
5043+ // rax: object
5044+ // rdi: object map
5045+ __ j(above_equal, ¬_string, Label::kNear);
5046+ __ Jump(isolate()->builtins()->StringToNumber(), RelocInfo::CODE_TARGET);
5047+ __ bind(¬_string);
5048+
5049+ Label not_oddball;
5050+ __ CmpInstanceType(rdi, ODDBALL_TYPE);
5051+ __ j(not_equal, ¬_oddball, Label::kNear);
5052+ __ movp(rax, FieldOperand(rax, Oddball::kToNumberOffset));
5053+ __ Ret();
5054+ __ bind(¬_oddball);
5055+
5056+ __ PopReturnAddressTo(rcx); // Pop return address.
5057+ __ Push(rax); // Push argument.
5058+ __ PushReturnAddressFrom(rcx); // Push return address.
5059+ __ TailCallRuntime(Runtime::kToNumber);
5060+}
5061+
5062+#endif
5063+
5064+#if 0
5065+static void InitializeArrayConstructorDescriptor(
5066+ Isolate* isolate, CodeStubDescriptor* descriptor,
5067+ int constant_stack_parameter_count) {
5068+ Address deopt_handler = Runtime::FunctionForId(
5069+ Runtime::kArrayConstructor)->entry;
5070+
5071+ if (constant_stack_parameter_count == 0) {
5072+ descriptor->Initialize(deopt_handler, constant_stack_parameter_count,
5073+ JS_FUNCTION_STUB_MODE);
5074+ } else {
5075+ descriptor->Initialize(rax, deopt_handler, constant_stack_parameter_count,
5076+ JS_FUNCTION_STUB_MODE);
5077+ }
5078+}
5079+#endif
5080+
5081+#if 0
5082+static void InitializeInternalArrayConstructorDescriptor(
5083+ Isolate* isolate, CodeStubDescriptor* descriptor,
5084+ int constant_stack_parameter_count) {
5085+ Address deopt_handler = Runtime::FunctionForId(
5086+ Runtime::kInternalArrayConstructor)->entry;
5087+
5088+ if (constant_stack_parameter_count == 0) {
5089+ descriptor->Initialize(deopt_handler, constant_stack_parameter_count,
5090+ JS_FUNCTION_STUB_MODE);
5091+ } else {
5092+ descriptor->Initialize(rax, deopt_handler, constant_stack_parameter_count,
5093+ JS_FUNCTION_STUB_MODE);
5094+ }
5095+}
5096+#endif
5097+
5098+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
5099+static void InitializeArrayConstructorDescriptor(
5100+ Isolate* isolate, CodeStubDescriptor* descriptor,
5101+ int constant_stack_parameter_count) {
5102+ Address deopt_handler = Runtime::FunctionForId(Runtime::kArrayPush)->entry;
5103+
5104+ if (constant_stack_parameter_count == 0) {
5105+ descriptor->Initialize(deopt_handler, constant_stack_parameter_count,
5106+ JS_FUNCTION_STUB_MODE);
5107+ } else {
5108+ descriptor->Initialize(rax, deopt_handler, constant_stack_parameter_count,
5109+ JS_FUNCTION_STUB_MODE);
5110+ }
5111+}
5112+
5113+static void InitializeInternalArrayConstructorDescriptor(
5114+ Isolate* isolate, CodeStubDescriptor* descriptor,
5115+ int constant_stack_parameter_count) {
5116+ Address deopt_handler = Runtime::FunctionForId(Runtime::kArrayPush)->entry;
5117+
5118+ if (constant_stack_parameter_count == 0) {
5119+ descriptor->Initialize(deopt_handler, constant_stack_parameter_count,
5120+ JS_FUNCTION_STUB_MODE);
5121+ } else {
5122+ descriptor->Initialize(rax, deopt_handler, constant_stack_parameter_count,
5123+ JS_FUNCTION_STUB_MODE);
5124+ }
5125+}
5126+
5127+void ArrayNoArgumentConstructorStub::InitializeDescriptor(
5128+ CodeStubDescriptor* descriptor) {
5129+ InitializeArrayConstructorDescriptor(isolate(), descriptor, 0);
5130+}
5131+
5132+void InternalArrayNoArgumentConstructorStub::InitializeDescriptor(
5133+ CodeStubDescriptor* descriptor) {
5134+ InitializeInternalArrayConstructorDescriptor(isolate(), descriptor, 0);
5135+}
5136+#endif
5137+
5138+#if defined(__x86_64__) && __SIZEOF_POINTER__ == 4
5139+void InternalArraySingleArgumentConstructorStub::InitializeDescriptor(
5140+ CodeStubDescriptor* descriptor) {
5141+ InitializeInternalArrayConstructorDescriptor(isolate(), descriptor, 1);
5142+}
5143+#endif
5144+
5145+
5146+void ArrayNArgumentsConstructorStub::InitializeDescriptor(
5147+ CodeStubDescriptor* descriptor) {
5148+ InitializeArrayConstructorDescriptor(isolate(), descriptor, -1);
5149+}
5150+
5151+
5152 void FastArrayPushStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
5153 Address deopt_handler = Runtime::FunctionForId(Runtime::kArrayPush)->entry;
5154 descriptor->Initialize(rax, deopt_handler, -1, JS_FUNCTION_STUB_MODE);
5155@@ -43,6 +167,15 @@ void FastFunctionBindStub::InitializeDes
5156 descriptor->Initialize(rax, deopt_handler, -1, JS_FUNCTION_STUB_MODE);
5157 }
5158
5159+void InternalArrayNArgumentsConstructorStub::InitializeDescriptor(
5160+ CodeStubDescriptor* descriptor) {
5161+ InitializeInternalArrayConstructorDescriptor(isolate(), descriptor, -1);
5162+}
5163+
5164+
5165+#define __ ACCESS_MASM(masm)
5166+
5167+
5168 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm,
5169 ExternalReference miss) {
5170 // Update the static counter each time a new code stub is generated.
5171@@ -356,6 +489,12 @@ void MathPowStub::Generate(MacroAssemble
5172 }
5173
5174
5175+void ArraySingleArgumentConstructorStub::InitializeDescriptor(
5176+ CodeStubDescriptor* descriptor) {
5177+ InitializeArrayConstructorDescriptor(isolate(), descriptor, 1);
5178+}
5179+
5180+
5181 void FunctionPrototypeStub::Generate(MacroAssembler* masm) {
5182 Label miss;
5183 Register receiver = LoadDescriptor::ReceiverRegister();
5184@@ -1511,7 +1650,7 @@ void CodeStub::GenerateStubsAheadOfTime(
5185 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(isolate);
5186 StubFailureTrampolineStub::GenerateAheadOfTime(isolate);
5187 // It is important that the store buffer overflow stubs are generated first.
5188- CommonArrayConstructorStub::GenerateStubsAheadOfTime(isolate);
5189+ ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
5190 CreateAllocationSiteStub::GenerateAheadOfTime(isolate);
5191 CreateWeakCellStub::GenerateAheadOfTime(isolate);
5192 BinaryOpICStub::GenerateAheadOfTime(isolate);
5193@@ -3831,14 +3970,19 @@ static void ArrayConstructorStubAheadOfT
5194 }
5195 }
5196
5197-void CommonArrayConstructorStub::GenerateStubsAheadOfTime(Isolate* isolate) {
5198+
5199+void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) {
5200 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>(
5201 isolate);
5202 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>(
5203 isolate);
5204- ArrayNArgumentsConstructorStub stub(isolate);
5205- stub.GetCode();
5206+ ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>(
5207+ isolate);
5208+}
5209
5210+
5211+void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(
5212+ Isolate* isolate) {
5213 ElementsKind kinds[2] = { FAST_ELEMENTS, FAST_HOLEY_ELEMENTS };
5214 for (int i = 0; i < 2; i++) {
5215 // For internal arrays we only need a few things
5216@@ -3846,6 +3990,8 @@ void CommonArrayConstructorStub::Generat
5217 stubh1.GetCode();
5218 InternalArraySingleArgumentConstructorStub stubh2(isolate, kinds[i]);
5219 stubh2.GetCode();
5220+ InternalArrayNArgumentsConstructorStub stubh3(isolate, kinds[i]);
5221+ stubh3.GetCode();
5222 }
5223 }
5224
5225@@ -3865,15 +4011,13 @@ void ArrayConstructorStub::GenerateDispa
5226 CreateArrayDispatchOneArgument(masm, mode);
5227
5228 __ bind(¬_one_case);
5229- ArrayNArgumentsConstructorStub stub(masm->isolate());
5230- __ TailCallStub(&stub);
5231+ CreateArrayDispatch<ArrayNArgumentsConstructorStub>(masm, mode);
5232 } else if (argument_count() == NONE) {
5233 CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode);
5234 } else if (argument_count() == ONE) {
5235 CreateArrayDispatchOneArgument(masm, mode);
5236 } else if (argument_count() == MORE_THAN_ONE) {
5237- ArrayNArgumentsConstructorStub stub(masm->isolate());
5238- __ TailCallStub(&stub);
5239+ CreateArrayDispatch<ArrayNArgumentsConstructorStub>(masm, mode);
5240 } else {
5241 UNREACHABLE();
5242 }
5243@@ -3992,7 +4136,7 @@ void InternalArrayConstructorStub::Gener
5244 __ TailCallStub(&stub1);
5245
5246 __ bind(¬_one_case);
5247- ArrayNArgumentsConstructorStub stubN(isolate());
5248+ InternalArrayNArgumentsConstructorStub stubN(isolate(), kind);
5249 __ TailCallStub(&stubN);
5250 }
5251
5252@@ -5174,18 +5318,38 @@ void CallApiGetterStub::Generate(MacroAs
5253 const int kArgStackSpace = 1;
5254
5255 // Load address of v8::PropertyAccessorInfo::args_ array.
5256+#if __SIZEOF_POINTER__ == 4
5257+ __ leap(name_arg, Operand(rsp, kPCOnStackSize));
5258+#else
5259 __ leap(scratch, Operand(rsp, 2 * kPointerSize));
5260+#endif
5261
5262 PrepareCallApiFunction(masm, kArgStackSpace);
5263+#if __SIZEOF_POINTER__ == 4
5264+ __ leap(scratch, Operand(name_arg, 1 * kPointerSize));
5265+#else
5266 // Create v8::PropertyCallbackInfo object on the stack and initialize
5267 // it's args_ field.
5268 Operand info_object = StackSpaceOperand(0);
5269 __ movp(info_object, scratch);
5270+#endif
5271+
5272+#if __SIZEOF_POINTER__ == 4
5273+ // v8::PropertyAccessorInfo::args_.
5274+ __ movp(StackSpaceOperand(0), scratch);
5275+#endif
5276
5277+#if __SIZEOF_POINTER__ == 4
5278+#else
5279 __ leap(name_arg, Operand(scratch, -kPointerSize));
5280+#endif
5281 // The context register (rsi) has been saved in PrepareCallApiFunction and
5282 // could be used to pass arguments.
5283+#if __SIZEOF_POINTER__ == 4
5284+ __ leap(accessor_info_arg, StackSpaceOperand(0));
5285+#else
5286 __ leap(accessor_info_arg, info_object);
5287+#endif
5288
5289 ExternalReference thunk_ref =
5290 ExternalReference::invoke_accessor_getter_callback(isolate());
5291diff -urp v8.t5.4.259/src/x64/code-stubs-x64.h v8/src/x64/code-stubs-x64.h
5292--- v8.t5.4.259/src/x64/code-stubs-x64.h 2016-11-14 15:48:16.029038921 -0800
5293+++ v8/src/x64/code-stubs-x64.h 2016-11-14 15:08:43.309027297 -0800
5294@@ -108,7 +108,6 @@ class NameDictionaryLookupStub: public P
5295 DEFINE_PLATFORM_CODE_STUB(NameDictionaryLookup, PlatformCodeStub);
5296 };
5297
5298-
5299 class RecordWriteStub: public PlatformCodeStub {
5300 public:
5301 RecordWriteStub(Isolate* isolate, Register object, Register value,
5302diff -urp v8.t5.4.259/src/x64/interface-descriptors-x64.cc v8/src/x64/interface-descriptors-x64.cc
5303--- v8.t5.4.259/src/x64/interface-descriptors-x64.cc 2016-11-14 15:48:16.031038998 -0800
5304+++ v8/src/x64/interface-descriptors-x64.cc 2016-11-14 15:08:43.310027336 -0800
5305@@ -65,6 +65,15 @@ const Register GrowArrayElementsDescript
5306 const Register GrowArrayElementsDescriptor::KeyRegister() { return rbx; }
5307
5308
5309+#if (defined(__x86_64__) && __SIZEOF_POINTER__ == 4) && 0
5310+void ToNumberDescriptor::InitializePlatformSpecific(
5311+ CallInterfaceDescriptorData* data) {
5312+ // ToNumberStub invokes a function, and therefore needs a context.
5313+ Register registers[] = {rsi, rax};
5314+ data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
5315+}
5316+#endif
5317+
5318 void FastNewClosureDescriptor::InitializePlatformSpecific(
5319 CallInterfaceDescriptorData* data) {
5320 Register registers[] = {rbx};
5321@@ -109,6 +118,7 @@ void TypeofDescriptor::InitializePlatfor
5322 }
5323
5324
5325+
5326 // static
5327 const Register TypeConversionDescriptor::ArgumentRegister() { return rax; }
5328
5329@@ -238,27 +248,44 @@ void AllocateHeapNumberDescriptor::Initi
5330 SIMD128_TYPES(SIMD128_ALLOC_DESC)
5331 #undef SIMD128_ALLOC_DESC
5332
5333-void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
5334+#if __SIZEOF_POINTER__ == 4
5335+void ArrayConstructorDescriptor::InitializePlatformSpecific(
5336+ CallInterfaceDescriptorData* data) {
5337+ // stack param count needs (constructor pointer, and single argument)
5338+ Register registers[] = {rdi, rbx, rax};
5339+ data->InitializePlatformSpecific(arraysize(registers), registers);
5340+}
5341+
5342+void ArrayConstructorConstantArgCountDescriptor::InitializePlatformSpecific(
5343 CallInterfaceDescriptorData* data) {
5344 // register state
5345 // rax -- number of arguments
5346 // rdi -- function
5347 // rbx -- allocation site with elements kind
5348- Register registers[] = {rdi, rbx, rax};
5349+ Register registers[] = {rdi, rbx};
5350 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
5351 }
5352
5353-void ArraySingleArgumentConstructorDescriptor::InitializePlatformSpecific(
5354- CallInterfaceDescriptorData* data) {
5355+void InternalArrayConstructorConstantArgCountDescriptor::
5356+ InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
5357 // register state
5358 // rax -- number of arguments
5359- // rdi -- function
5360- // rbx -- allocation site with elements kind
5361- Register registers[] = {rdi, rbx, rax};
5362+ // rdi -- constructor function
5363+ Register registers[] = {rdi};
5364 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
5365 }
5366
5367-void ArrayNArgumentsConstructorDescriptor::InitializePlatformSpecific(
5368+void InternalArrayConstructorDescriptor::InitializePlatformSpecific(
5369+ CallInterfaceDescriptorData* data) {
5370+ // stack param count needs (constructor pointer, and single argument)
5371+ Register registers[] = {rdi, rax};
5372+ data->InitializePlatformSpecific(arraysize(registers), registers);
5373+}
5374+
5375+
5376+#endif
5377+
5378+void ArrayNoArgumentConstructorDescriptor::InitializePlatformSpecific(
5379 CallInterfaceDescriptorData* data) {
5380 // register state
5381 // rax -- number of arguments
5382@@ -268,6 +295,24 @@ void ArrayNArgumentsConstructorDescripto
5383 data->InitializePlatformSpecific(arraysize(registers), registers, NULL);
5384 }
5385
5386+#if 0
5387+void ArrayConstructorDescriptor::InitializePlatformSpecific(
5388+ CallInterfaceDescriptorData* data) {
5389+ // stack param count needs (constructor pointer, and single argument)
5390+ Register registers[] = {rdi, rbx, rax};
5391+ data->InitializePlatformSpecific(arraysize(registers), registers);
5392+}
5393+#endif
5394+
5395+#if 0
5396+void InternalArrayConstructorDescriptor::InitializePlatformSpecific(
5397+ CallInterfaceDescriptorData* data) {
5398+ // stack param count needs (constructor pointer, and single argument)
5399+ Register registers[] = {rdi, rax};
5400+ data->InitializePlatformSpecific(arraysize(registers), registers);
5401+}
5402+#endif
5403+
5404 void VarArgFunctionDescriptor::InitializePlatformSpecific(
5405 CallInterfaceDescriptorData* data) {
5406 // stack param count needs (arg count)
5407@@ -281,7 +326,16 @@ void CompareDescriptor::InitializePlatfo
5408 data->InitializePlatformSpecific(arraysize(registers), registers);
5409 }
5410
5411-
5412+#if !(__SIZEOF_POINTER__ == 4)
5413+void InternalArrayConstructorConstantArgCountDescriptor::
5414+ InitializePlatformSpecific(CallInterfaceDescriptorData* data) {
5415+ // register state
5416+ // rax -- number of arguments
5417+ // rdi -- constructor function
5418+ Register registers[] = {rdi};
5419+ data->InitializePlatformSpecific(arraysize(registers), registers);
5420+}
5421+#endif
5422 void BinaryOpDescriptor::InitializePlatformSpecific(
5423 CallInterfaceDescriptorData* data) {
5424 Register registers[] = {rdx, rax};
5425diff -urp v8.t5.4.259/src/x64/macro-assembler-x64.cc v8/src/x64/macro-assembler-x64.cc
5426--- v8.t5.4.259/src/x64/macro-assembler-x64.cc 2016-11-14 15:48:16.039039306 -0800
5427+++ v8/src/x64/macro-assembler-x64.cc 2016-11-14 15:08:43.311027376 -0800
5428@@ -4293,23 +4293,38 @@ void MacroAssembler::InvokeFunction(Regi
5429 const CallWrapper& call_wrapper) {
5430 DCHECK(function.is(rdi));
5431 movp(rsi, FieldOperand(function, JSFunction::kContextOffset));
5432+#if __SIZEOF_POINTER__ == 4
5433+ movp(r8, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
5434+ InvokeFunctionCode(r8, new_target, expected, actual, flag, call_wrapper);
5435+#else
5436 InvokeFunctionCode(rdi, new_target, expected, actual, flag, call_wrapper);
5437+#endif
5438 }
5439
5440
5441+#if __SIZEOF_POINTER__ == 4
5442+void MacroAssembler::InvokeFunctionCode(Register code, Register new_target,
5443+#else
5444 void MacroAssembler::InvokeFunctionCode(Register function, Register new_target,
5445+#endif
5446 const ParameterCount& expected,
5447 const ParameterCount& actual,
5448 InvokeFlag flag,
5449 const CallWrapper& call_wrapper) {
5450 // You can't call a function without a valid frame.
5451 DCHECK(flag == JUMP_FUNCTION || has_frame());
5452+#if __SIZEOF_POINTER__ == 4
5453+#else
5454 DCHECK(function.is(rdi));
5455+#endif
5456 DCHECK_IMPLIES(new_target.is_valid(), new_target.is(rdx));
5457
5458+#if __SIZEOF_POINTER__ == 4
5459+#else
5460 if (call_wrapper.NeedsDebugStepCheck()) {
5461 FloodFunctionIfStepping(function, new_target, expected, actual);
5462 }
5463+#endif
5464
5465 // Clear the new.target register if not given.
5466 if (!new_target.is_valid()) {
5467@@ -4329,7 +4344,10 @@ void MacroAssembler::InvokeFunctionCode(
5468 // We call indirectly through the code field in the function to
5469 // allow recompilation to take effect without changing any of the
5470 // call sites.
5471+#if __SIZEOF_POINTER__ == 4
5472+#else
5473 Operand code = FieldOperand(function, JSFunction::kCodeEntryOffset);
5474+#endif
5475 if (flag == CALL_FUNCTION) {
5476 call_wrapper.BeforeCall(CallSize(code));
5477 call(code);
5478@@ -4520,8 +4538,8 @@ void MacroAssembler::LeaveFrame(StackFra
5479
5480 void MacroAssembler::EnterBuiltinFrame(Register context, Register target,
5481 Register argc) {
5482- Push(rbp);
5483- Move(rbp, rsp);
5484+ pushq(rbp);
5485+ movp(rbp, rsp);
5486 Push(context);
5487 Push(target);
5488 Push(argc);
5489diff -urp v8.t5.4.259/test/cctest/compiler/test-linkage.cc v8/test/cctest/compiler/test-linkage.cc
5490--- v8.t5.4.259/test/cctest/compiler/test-linkage.cc 2016-11-14 15:48:16.064040269 -0800
5491+++ v8/test/cctest/compiler/test-linkage.cc 2016-11-14 15:08:43.312027415 -0800
5492@@ -98,12 +98,25 @@ TEST(TestLinkageRuntimeCall) {
5493 TEST(TestLinkageStubCall) {
5494 Isolate* isolate = CcTest::InitIsolateOnce();
5495 Zone zone(isolate->allocator());
5496+#if 1
5497+ ToNumberStub stub(isolate);
5498+#else
5499 Callable callable = CodeFactory::ToNumber(isolate);
5500+#endif
5501 CompilationInfo info(ArrayVector("test"), isolate, &zone,
5502 Code::ComputeFlags(Code::STUB));
5503+#if 1
5504+ CallInterfaceDescriptor interface_descriptor =
5505+ stub.GetCallInterfaceDescriptor();
5506+#endif
5507 CallDescriptor* descriptor = Linkage::GetStubCallDescriptor(
5508+#if 1
5509+ isolate, &zone, interface_descriptor, stub.GetStackParameterCount(),
5510+ CallDescriptor::kNoFlags, Operator::kNoProperties);
5511+#else
5512 isolate, &zone, callable.descriptor(), 0, CallDescriptor::kNoFlags,
5513 Operator::kNoProperties);
5514+#endif
5515 CHECK(descriptor);
5516 CHECK_EQ(0, static_cast<int>(descriptor->StackParameterCount()));
5517 CHECK_EQ(1, static_cast<int>(descriptor->ReturnCount()));
5518diff -urp v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/BasicLoops.golden v8/test/cctest/interpreter/bytecode_expectations/BasicLoops.golden
5519--- v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/BasicLoops.golden 2016-11-14 15:48:16.312049821 -0800
5520+++ v8/test/cctest/interpreter/bytecode_expectations/BasicLoops.golden 2016-11-14 15:08:43.312027415 -0800
5521@@ -696,7 +696,7 @@ bytecodes: [
5522 B(PushContext), R(3),
5523 B(LdaTheHole),
5524 B(StaContextSlot), R(context), U8(4),
5525- B(CreateClosure), U8(1), U8(2),
5526+ B(CreateClosure), U8(1), U8(0),
5527 B(Star), R(0),
5528 /* 73 S> */ B(LdaSmi), U8(1),
5529 /* 73 E> */ B(StaContextSlot), R(context), U8(4),
5530diff -urp v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/BreakableBlocks.golden v8/test/cctest/interpreter/bytecode_expectations/BreakableBlocks.golden
5531--- v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/BreakableBlocks.golden 2016-11-14 15:48:16.312049821 -0800
5532+++ v8/test/cctest/interpreter/bytecode_expectations/BreakableBlocks.golden 2016-11-14 15:08:43.312027415 -0800
5533@@ -113,7 +113,7 @@ bytecodes: [
5534 B(PushContext), R(2),
5535 B(LdaTheHole),
5536 B(StaContextSlot), R(context), U8(4),
5537- B(CreateClosure), U8(1), U8(2),
5538+ B(CreateClosure), U8(1), U8(0),
5539 B(Star), R(0),
5540 /* 53 S> */ B(LdaSmi), U8(10),
5541 /* 53 E> */ B(StaContextSlot), R(context), U8(4),
5542@@ -167,7 +167,7 @@ bytecodes: [
5543 B(PushContext), R(3),
5544 B(LdaTheHole),
5545 B(StaContextSlot), R(context), U8(4),
5546- B(CreateClosure), U8(1), U8(2),
5547+ B(CreateClosure), U8(1), U8(0),
5548 B(Star), R(0),
5549 /* 76 S> */ B(LdaSmi), U8(2),
5550 /* 76 E> */ B(StaContextSlot), R(context), U8(4),
5551diff -urp v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/CallLookupSlot.golden v8/test/cctest/interpreter/bytecode_expectations/CallLookupSlot.golden
5552--- v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/CallLookupSlot.golden 2016-11-14 15:48:16.313049859 -0800
5553+++ v8/test/cctest/interpreter/bytecode_expectations/CallLookupSlot.golden 2016-11-14 15:08:43.312027415 -0800
5554@@ -24,7 +24,7 @@ bytecodes: [
5555 B(Ldar), R(new_target),
5556 B(StaContextSlot), R(context), U8(6),
5557 /* 30 E> */ B(StackCheck),
5558- /* 34 S> */ B(CreateClosure), U8(0), U8(2),
5559+ /* 34 S> */ B(CreateClosure), U8(0), U8(0),
5560 /* 36 E> */ B(StaLookupSlotSloppy), U8(1),
5561 /* 52 S> */ B(LdaConstant), U8(2),
5562 B(Star), R(3),
5563diff -urp v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden v8/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden
5564--- v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden 2016-11-14 15:48:16.313049859 -0800
5565+++ v8/test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden 2016-11-14 15:08:43.312027415 -0800
5566@@ -25,7 +25,7 @@ bytecodes: [
5567 B(Star), R(0),
5568 /* 34 S> */ B(LdaTheHole),
5569 B(Star), R(3),
5570- B(CreateClosure), U8(0), U8(2),
5571+ B(CreateClosure), U8(0), U8(0),
5572 B(Star), R(4),
5573 B(LdaSmi), U8(34),
5574 B(Star), R(5),
5575@@ -78,7 +78,7 @@ bytecodes: [
5576 B(Star), R(0),
5577 /* 34 S> */ B(LdaTheHole),
5578 B(Star), R(3),
5579- B(CreateClosure), U8(0), U8(2),
5580+ B(CreateClosure), U8(0), U8(0),
5581 B(Star), R(4),
5582 B(LdaSmi), U8(34),
5583 B(Star), R(5),
5584@@ -209,7 +209,7 @@ bytecodes: [
5585 B(Star), R(0),
5586 /* 49 S> */ B(LdaTheHole),
5587 B(Star), R(4),
5588- B(CreateClosure), U8(0), U8(2),
5589+ B(CreateClosure), U8(0), U8(0),
5590 B(Star), R(5),
5591 B(LdaSmi), U8(49),
5592 B(Star), R(6),
5593diff -urp v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/CompoundExpressions.golden v8/test/cctest/interpreter/bytecode_expectations/CompoundExpressions.golden
5594--- v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/CompoundExpressions.golden 2016-11-14 15:48:16.314049898 -0800
5595+++ v8/test/cctest/interpreter/bytecode_expectations/CompoundExpressions.golden 2016-11-14 15:08:43.312027415 -0800
5596@@ -118,7 +118,7 @@ bytecodes: [
5597 /* 30 E> */ B(StackCheck),
5598 /* 42 S> */ B(LdaSmi), U8(1),
5599 /* 42 E> */ B(StaContextSlot), R(context), U8(4),
5600- /* 45 S> */ B(CreateClosure), U8(0), U8(2),
5601+ /* 45 S> */ B(CreateClosure), U8(0), U8(0),
5602 /* 75 S> */ B(LdrContextSlot), R(context), U8(4), R(1),
5603 B(BitwiseOrSmi), U8(24), R(1),
5604 /* 77 E> */ B(StaContextSlot), R(context), U8(4),
5605diff -urp v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/ConstVariableContextSlot.golden v8/test/cctest/interpreter/bytecode_expectations/ConstVariableContextSlot.golden
5606--- v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/ConstVariableContextSlot.golden 2016-11-14 15:48:16.314049898 -0800
5607+++ v8/test/cctest/interpreter/bytecode_expectations/ConstVariableContextSlot.golden 2016-11-14 15:08:43.313027454 -0800
5608@@ -19,7 +19,7 @@ bytecodes: [
5609 B(PushContext), R(1),
5610 B(LdaTheHole),
5611 B(StaContextSlot), R(context), U8(4),
5612- B(CreateClosure), U8(0), U8(2),
5613+ B(CreateClosure), U8(0), U8(0),
5614 B(Star), R(0),
5615 /* 30 E> */ B(StackCheck),
5616 /* 44 S> */ B(LdaSmi), U8(10),
5617@@ -45,7 +45,7 @@ bytecodes: [
5618 B(PushContext), R(1),
5619 B(LdaTheHole),
5620 B(StaContextSlot), R(context), U8(4),
5621- B(CreateClosure), U8(0), U8(2),
5622+ B(CreateClosure), U8(0), U8(0),
5623 B(Star), R(0),
5624 /* 30 E> */ B(StackCheck),
5625 /* 44 S> */ B(LdaSmi), U8(10),
5626@@ -76,7 +76,7 @@ bytecodes: [
5627 B(PushContext), R(1),
5628 B(LdaTheHole),
5629 B(StaContextSlot), R(context), U8(4),
5630- B(CreateClosure), U8(0), U8(2),
5631+ B(CreateClosure), U8(0), U8(0),
5632 B(Star), R(0),
5633 /* 30 E> */ B(StackCheck),
5634 /* 47 S> */ B(LdaSmi), U8(20),
5635@@ -112,7 +112,7 @@ bytecodes: [
5636 B(PushContext), R(1),
5637 B(LdaTheHole),
5638 B(StaContextSlot), R(context), U8(4),
5639- B(CreateClosure), U8(0), U8(2),
5640+ B(CreateClosure), U8(0), U8(0),
5641 B(Star), R(0),
5642 /* 30 E> */ B(StackCheck),
5643 /* 44 S> */ B(LdaSmi), U8(10),
5644diff -urp v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/ContextParameters.golden v8/test/cctest/interpreter/bytecode_expectations/ContextParameters.golden
5645--- v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/ContextParameters.golden 2016-11-14 15:48:16.314049898 -0800
5646+++ v8/test/cctest/interpreter/bytecode_expectations/ContextParameters.golden 2016-11-14 15:08:43.313027454 -0800
5647@@ -22,7 +22,7 @@ bytecodes: [
5648 B(Ldar), R(arg0),
5649 B(StaContextSlot), R(context), U8(4),
5650 /* 10 E> */ B(StackCheck),
5651- /* 19 S> */ B(CreateClosure), U8(0), U8(2),
5652+ /* 19 S> */ B(CreateClosure), U8(0), U8(0),
5653 /* 52 S> */ B(Return),
5654 ]
5655 constant pool: [
5656@@ -45,7 +45,7 @@ bytecodes: [
5657 B(Ldar), R(arg0),
5658 B(StaContextSlot), R(context), U8(4),
5659 /* 10 E> */ B(StackCheck),
5660- /* 27 S> */ B(CreateClosure), U8(0), U8(2),
5661+ /* 27 S> */ B(CreateClosure), U8(0), U8(0),
5662 B(Star), R(0),
5663 /* 53 S> */ B(LdaContextSlot), R(context), U8(4),
5664 /* 66 S> */ B(Return),
5665@@ -72,7 +72,7 @@ bytecodes: [
5666 B(Ldar), R(arg2),
5667 B(StaContextSlot), R(context), U8(4),
5668 /* 10 E> */ B(StackCheck),
5669- /* 29 S> */ B(CreateClosure), U8(0), U8(2),
5670+ /* 29 S> */ B(CreateClosure), U8(0), U8(0),
5671 /* 61 S> */ B(Return),
5672 ]
5673 constant pool: [
5674@@ -95,7 +95,7 @@ bytecodes: [
5675 /* 10 E> */ B(StackCheck),
5676 /* 26 S> */ B(Ldar), R(this),
5677 /* 26 E> */ B(StaContextSlot), R(context), U8(4),
5678- /* 32 S> */ B(CreateClosure), U8(0), U8(2),
5679+ /* 32 S> */ B(CreateClosure), U8(0), U8(0),
5680 /* 65 S> */ B(Return),
5681 ]
5682 constant pool: [
5683diff -urp v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/ContextVariables.golden v8/test/cctest/interpreter/bytecode_expectations/ContextVariables.golden
5684--- v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/ContextVariables.golden 2016-11-14 15:48:16.314049898 -0800
5685+++ v8/test/cctest/interpreter/bytecode_expectations/ContextVariables.golden 2016-11-14 15:08:43.313027454 -0800
5686@@ -18,7 +18,7 @@ bytecodes: [
5687 B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), U8(1),
5688 B(PushContext), R(0),
5689 /* 30 E> */ B(StackCheck),
5690- /* 41 S> */ B(CreateClosure), U8(0), U8(2),
5691+ /* 41 S> */ B(CreateClosure), U8(0), U8(0),
5692 /* 71 S> */ B(Return),
5693 ]
5694 constant pool: [
5695@@ -40,7 +40,7 @@ bytecodes: [
5696 /* 30 E> */ B(StackCheck),
5697 /* 42 S> */ B(LdaSmi), U8(1),
5698 /* 42 E> */ B(StaContextSlot), R(context), U8(4),
5699- /* 45 S> */ B(CreateClosure), U8(0), U8(2),
5700+ /* 45 S> */ B(CreateClosure), U8(0), U8(0),
5701 /* 75 S> */ B(Return),
5702 ]
5703 constant pool: [
5704@@ -64,7 +64,7 @@ bytecodes: [
5705 /* 42 E> */ B(StaContextSlot), R(context), U8(4),
5706 /* 53 S> */ B(LdaSmi), U8(2),
5707 /* 53 E> */ B(StaContextSlot), R(context), U8(5),
5708- /* 56 S> */ B(CreateClosure), U8(0), U8(2),
5709+ /* 56 S> */ B(CreateClosure), U8(0), U8(0),
5710 /* 92 S> */ B(Return),
5711 ]
5712 constant pool: [
5713@@ -85,7 +85,7 @@ bytecodes: [
5714 B(PushContext), R(0),
5715 /* 30 E> */ B(StackCheck),
5716 /* 41 S> */ B(LdrUndefined), R(2),
5717- B(CreateClosure), U8(0), U8(2),
5718+ B(CreateClosure), U8(0), U8(0),
5719 B(Star), R(1),
5720 /* 64 E> */ B(Call), R(1), R(2), U8(1), U8(1),
5721 /* 68 S> */ B(LdaContextSlot), R(context), U8(4),
5722@@ -123,7 +123,7 @@ bytecodes: [
5723 B(StaContextSlot), R(context), U8(4),
5724 /* 69 S> */ B(LdaSmi), U8(2),
5725 /* 69 E> */ B(StaContextSlot), R(context), U8(4),
5726- /* 72 S> */ B(CreateClosure), U8(1), U8(2),
5727+ /* 72 S> */ B(CreateClosure), U8(1), U8(0),
5728 B(PopContext), R(0),
5729 /* 104 S> */ B(Return),
5730 ]
5731diff -urp v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/CountOperators.golden v8/test/cctest/interpreter/bytecode_expectations/CountOperators.golden
5732--- v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/CountOperators.golden 2016-11-14 15:48:16.314049898 -0800
5733+++ v8/test/cctest/interpreter/bytecode_expectations/CountOperators.golden 2016-11-14 15:08:43.314027494 -0800
5734@@ -210,7 +210,7 @@ bytecodes: [
5735 /* 30 E> */ B(StackCheck),
5736 /* 42 S> */ B(LdaSmi), U8(1),
5737 /* 42 E> */ B(StaContextSlot), R(context), U8(4),
5738- /* 53 S> */ B(CreateClosure), U8(0), U8(2),
5739+ /* 53 S> */ B(CreateClosure), U8(0), U8(0),
5740 B(Star), R(0),
5741 /* 78 S> */ B(LdaContextSlot), R(context), U8(4),
5742 B(Inc),
5743@@ -236,7 +236,7 @@ bytecodes: [
5744 /* 30 E> */ B(StackCheck),
5745 /* 42 S> */ B(LdaSmi), U8(1),
5746 /* 42 E> */ B(StaContextSlot), R(context), U8(4),
5747- /* 53 S> */ B(CreateClosure), U8(0), U8(2),
5748+ /* 53 S> */ B(CreateClosure), U8(0), U8(0),
5749 B(Star), R(0),
5750 /* 78 S> */ B(LdaContextSlot), R(context), U8(4),
5751 B(ToNumber), R(2),
5752diff -urp v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/Delete.golden v8/test/cctest/interpreter/bytecode_expectations/Delete.golden
5753--- v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/Delete.golden 2016-11-14 15:48:16.315049936 -0800
5754+++ v8/test/cctest/interpreter/bytecode_expectations/Delete.golden 2016-11-14 15:08:43.314027494 -0800
5755@@ -111,7 +111,7 @@ bytecodes: [
5756 /* 56 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
5757 B(Star), R(1),
5758 /* 56 E> */ B(StaContextSlot), R(context), U8(4),
5759- /* 64 S> */ B(CreateClosure), U8(1), U8(2),
5760+ /* 64 S> */ B(CreateClosure), U8(1), U8(0),
5761 /* 93 S> */ B(LdrContextSlot), R(context), U8(4), R(1),
5762 B(LdaSmi), U8(1),
5763 B(DeletePropertyStrict), R(1),
5764diff -urp v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/FunctionLiterals.golden v8/test/cctest/interpreter/bytecode_expectations/FunctionLiterals.golden
5765--- v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/FunctionLiterals.golden 2016-11-14 15:48:16.316049975 -0800
5766+++ v8/test/cctest/interpreter/bytecode_expectations/FunctionLiterals.golden 2016-11-14 15:08:43.314027494 -0800
5767@@ -16,7 +16,7 @@ parameter count: 1
5768 bytecode array length: 5
5769 bytecodes: [
5770 /* 30 E> */ B(StackCheck),
5771- /* 34 S> */ B(CreateClosure), U8(0), U8(2),
5772+ /* 34 S> */ B(CreateClosure), U8(0), U8(0),
5773 /* 55 S> */ B(Return),
5774 ]
5775 constant pool: [
5776@@ -35,7 +35,7 @@ bytecode array length: 14
5777 bytecodes: [
5778 /* 30 E> */ B(StackCheck),
5779 /* 34 S> */ B(LdrUndefined), R(1),
5780- B(CreateClosure), U8(0), U8(2),
5781+ B(CreateClosure), U8(0), U8(0),
5782 B(Star), R(0),
5783 /* 56 E> */ B(Call), R(0), R(1), U8(1), U8(1),
5784 /* 59 S> */ B(Return),
5785@@ -56,7 +56,7 @@ bytecode array length: 18
5786 bytecodes: [
5787 /* 30 E> */ B(StackCheck),
5788 /* 34 S> */ B(LdrUndefined), R(1),
5789- B(CreateClosure), U8(0), U8(2),
5790+ B(CreateClosure), U8(0), U8(0),
5791 B(Star), R(0),
5792 B(LdaSmi), U8(1),
5793 B(Star), R(2),
5794diff -urp v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/LetVariableContextSlot.golden v8/test/cctest/interpreter/bytecode_expectations/LetVariableContextSlot.golden
5795--- v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/LetVariableContextSlot.golden 2016-11-14 15:48:16.318050052 -0800
5796+++ v8/test/cctest/interpreter/bytecode_expectations/LetVariableContextSlot.golden 2016-11-14 15:08:43.314027494 -0800
5797@@ -19,7 +19,7 @@ bytecodes: [
5798 B(PushContext), R(1),
5799 B(LdaTheHole),
5800 B(StaContextSlot), R(context), U8(4),
5801- B(CreateClosure), U8(0), U8(2),
5802+ B(CreateClosure), U8(0), U8(0),
5803 B(Star), R(0),
5804 /* 30 E> */ B(StackCheck),
5805 /* 42 S> */ B(LdaSmi), U8(10),
5806@@ -45,7 +45,7 @@ bytecodes: [
5807 B(PushContext), R(1),
5808 B(LdaTheHole),
5809 B(StaContextSlot), R(context), U8(4),
5810- B(CreateClosure), U8(0), U8(2),
5811+ B(CreateClosure), U8(0), U8(0),
5812 B(Star), R(0),
5813 /* 30 E> */ B(StackCheck),
5814 /* 42 S> */ B(LdaSmi), U8(10),
5815@@ -76,7 +76,7 @@ bytecodes: [
5816 B(PushContext), R(1),
5817 B(LdaTheHole),
5818 B(StaContextSlot), R(context), U8(4),
5819- B(CreateClosure), U8(0), U8(2),
5820+ B(CreateClosure), U8(0), U8(0),
5821 B(Star), R(0),
5822 /* 30 E> */ B(StackCheck),
5823 /* 45 S> */ B(LdaSmi), U8(20),
5824@@ -111,7 +111,7 @@ bytecodes: [
5825 B(PushContext), R(1),
5826 B(LdaTheHole),
5827 B(StaContextSlot), R(context), U8(4),
5828- B(CreateClosure), U8(0), U8(2),
5829+ B(CreateClosure), U8(0), U8(0),
5830 B(Star), R(0),
5831 /* 30 E> */ B(StackCheck),
5832 /* 42 S> */ B(LdaSmi), U8(10),
5833diff -urp v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/ObjectLiterals.golden v8/test/cctest/interpreter/bytecode_expectations/ObjectLiterals.golden
5834--- v8.t5.4.259/test/cctest/interpreter/bytecode_expectations/ObjectLiterals.golden 2016-11-14 15:48:16.320050129 -0800
5835+++ v8/test/cctest/interpreter/bytecode_expectations/ObjectLiterals.golden 2016-11-14 15:08:43.314027494 -0800
5836@@ -106,7 +106,7 @@ bytecodes: [
5837 /* 30 E> */ B(StackCheck),
5838 /* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
5839 B(Star), R(0),
5840- B(CreateClosure), U8(1), U8(2),
5841+ B(CreateClosure), U8(1), U8(0),
5842 B(StaNamedPropertySloppy), R(0), U8(2), U8(1),
5843 B(Ldar), R(0),
5844 /* 67 S> */ B(Return),
5845@@ -130,7 +130,7 @@ bytecodes: [
5846 /* 30 E> */ B(StackCheck),
5847 /* 34 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1),
5848 B(Star), R(0),
5849- B(CreateClosure), U8(1), U8(2),
5850+ B(CreateClosure), U8(1), U8(0),
5851 B(StaNamedPropertySloppy), R(0), U8(2), U8(1),
5852 B(Ldar), R(0),
5853 /* 68 S> */ B(Return),
5854@@ -156,7 +156,7 @@ bytecodes: [
5855 B(Star), R(0),
5856 B(LdaConstant), U8(1),
5857 B(Star), R(2),
5858- B(CreateClosure), U8(2), U8(2),
5859+ B(CreateClosure), U8(2), U8(0),
5860 B(Star), R(3),
5861 B(LdaNull),
5862 B(Star), R(4),
5863@@ -188,9 +188,9 @@ bytecodes: [
5864 B(Star), R(0),
5865 B(LdaConstant), U8(1),
5866 B(Star), R(2),
5867- B(CreateClosure), U8(2), U8(2),
5868+ B(CreateClosure), U8(2), U8(0),
5869 B(Star), R(3),
5870- B(CreateClosure), U8(3), U8(2),
5871+ B(CreateClosure), U8(3), U8(0),
5872 B(Star), R(4),
5873 B(LdaZero),
5874 B(Star), R(5),
5875@@ -223,7 +223,7 @@ bytecodes: [
5876 B(Star), R(2),
5877 B(LdaNull),
5878 B(Star), R(3),
5879- B(CreateClosure), U8(2), U8(2),
5880+ B(CreateClosure), U8(2), U8(0),
5881 B(Star), R(4),
5882 B(LdaZero),
5883 B(Star), R(5),
5884@@ -424,7 +424,7 @@ bytecodes: [
5885 B(CallRuntime), U16(Runtime::kDefineDataPropertyInLiteral), R(2), U8(5),
5886 B(LdaConstant), U8(3),
5887 B(Star), R(3),
5888- B(CreateClosure), U8(4), U8(2),
5889+ B(CreateClosure), U8(4), U8(0),
5890 B(Star), R(4),
5891 B(LdaZero),
5892 B(Star), R(5),
5893@@ -432,7 +432,7 @@ bytecodes: [
5894 B(CallRuntime), U16(Runtime::kDefineGetterPropertyUnchecked), R(2), U8(4),
5895 B(LdaConstant), U8(3),
5896 B(Star), R(3),
5897- B(CreateClosure), U8(5), U8(2),
5898+ B(CreateClosure), U8(5), U8(0),
5899 B(Star), R(4),
5900 B(LdaZero),
5901 B(Star), R(5),
5902diff -urp v8.t5.4.259/test/cctest/test-trace-event.cc v8/test/cctest/test-trace-event.cc
5903--- v8.t5.4.259/test/cctest/test-trace-event.cc 2016-11-14 15:48:16.389052787 -0800
5904+++ v8/test/cctest/test-trace-event.cc 2016-11-14 15:08:43.315027533 -0800
5905@@ -264,7 +264,9 @@ TEST(TestEventInContext) {
5906
5907 static uint64_t isolate_id = 0x20151021;
5908 {
5909+#if !(defined(__x86_64__) && __SIZEOF_POINTER__ == 4)
5910 TRACE_EVENT_SCOPED_CONTEXT("v8-cat", "Isolate", isolate_id);
5911+#endif
5912 TRACE_EVENT0("v8-cat", "e");
5913 }
5914
5915diff -urp v8.t5.4.259/test/mjsunit/es6/array-species-constructor-accessor.js v8/test/mjsunit/es6/array-species-constructor-accessor.js
5916--- v8.t5.4.259/test/mjsunit/es6/array-species-constructor-accessor.js 2016-11-14 15:48:16.586060374 -0800
5917+++ v8/test/mjsunit/es6/array-species-constructor-accessor.js 2016-11-14 15:08:43.315027533 -0800
5918@@ -18,7 +18,6 @@ assertEquals(1, x.concat([1])[0]);
5919 class MyArray extends Array { }
5920
5921 Object.defineProperty(x, 'constructor', {get() { return MyArray; }});
5922-assertFalse(%SpeciesProtector());
5923
5924 assertEquals(MyArray, x.map(()=>{}).constructor);
5925 assertEquals(MyArray, x.filter(()=>{}).constructor);
5926diff -urp v8.t5.4.259/test/mjsunit/es6/array-species-constructor-delete.js v8/test/mjsunit/es6/array-species-constructor-delete.js
5927--- v8.t5.4.259/test/mjsunit/es6/array-species-constructor-delete.js 2016-11-14 15:48:16.586060374 -0800
5928+++ v8/test/mjsunit/es6/array-species-constructor-delete.js 2016-11-14 15:08:43.315027533 -0800
5929@@ -19,7 +19,6 @@ class MyArray extends Array { }
5930
5931 Object.prototype.constructor = MyArray;
5932 delete Array.prototype.constructor;
5933-assertFalse(%SpeciesProtector());
5934
5935 assertEquals(MyArray, x.map(()=>{}).constructor);
5936 assertEquals(MyArray, x.filter(()=>{}).constructor);
5937diff -urp v8.t5.4.259/test/mjsunit/es6/array-species-constructor.js v8/test/mjsunit/es6/array-species-constructor.js
5938--- v8.t5.4.259/test/mjsunit/es6/array-species-constructor.js 2016-11-14 15:48:16.586060374 -0800
5939+++ v8/test/mjsunit/es6/array-species-constructor.js 2016-11-14 15:08:43.315027533 -0800
5940@@ -18,7 +18,6 @@ assertEquals(1, x.concat([1])[0]);
5941 class MyArray extends Array { }
5942
5943 x.constructor = MyArray;
5944-assertFalse(%SpeciesProtector());
5945
5946 assertEquals(MyArray, x.map(()=>{}).constructor);
5947 assertEquals(MyArray, x.filter(()=>{}).constructor);
5948diff -urp v8.t5.4.259/test/mjsunit/es6/array-species-delete.js v8/test/mjsunit/es6/array-species-delete.js
5949--- v8.t5.4.259/test/mjsunit/es6/array-species-delete.js 2016-11-14 15:48:16.586060374 -0800
5950+++ v8/test/mjsunit/es6/array-species-delete.js 2016-11-14 15:08:43.315027533 -0800
5951@@ -19,7 +19,6 @@ class MyArray extends Array { }
5952
5953 Object.prototype[Symbol.species] = MyArray;
5954 delete Array[Symbol.species];
5955-assertFalse(%SpeciesProtector());
5956
5957 assertEquals(MyArray, x.map(()=>{}).constructor);
5958 assertEquals(MyArray, x.filter(()=>{}).constructor);
5959diff -urp v8.t5.4.259/test/mjsunit/es6/array-species-modified.js v8/test/mjsunit/es6/array-species-modified.js
5960--- v8.t5.4.259/test/mjsunit/es6/array-species-modified.js 2016-11-14 15:48:16.586060374 -0800
5961+++ v8/test/mjsunit/es6/array-species-modified.js 2016-11-14 15:08:43.315027533 -0800
5962@@ -18,7 +18,6 @@ assertEquals(1, x.concat([1])[0]);
5963 class MyArray extends Array { }
5964
5965 Object.defineProperty(Array, Symbol.species, {value: MyArray});
5966-assertFalse(%SpeciesProtector());
5967
5968 assertEquals(MyArray, x.map(()=>{}).constructor);
5969 assertEquals(MyArray, x.filter(()=>{}).constructor);
5970diff -urp v8.t5.4.259/test/mjsunit/es6/array-species-parent-constructor.js v8/test/mjsunit/es6/array-species-parent-constructor.js
5971--- v8.t5.4.259/test/mjsunit/es6/array-species-parent-constructor.js 2016-11-14 15:48:16.586060374 -0800
5972+++ v8/test/mjsunit/es6/array-species-parent-constructor.js 2016-11-14 15:08:43.315027533 -0800
5973@@ -18,7 +18,6 @@ assertEquals(1, x.concat([1])[0]);
5974 class MyArray extends Array { }
5975
5976 Array.prototype.constructor = MyArray;
5977-assertFalse(%SpeciesProtector());
5978
5979 assertEquals(MyArray, x.map(()=>{}).constructor);
5980 assertEquals(MyArray, x.filter(()=>{}).constructor);
5981diff -urp v8.t5.4.259/test/mjsunit/es6/array-species-proto.js v8/test/mjsunit/es6/array-species-proto.js
5982--- v8.t5.4.259/test/mjsunit/es6/array-species-proto.js 2016-11-14 15:48:16.586060374 -0800
5983+++ v8/test/mjsunit/es6/array-species-proto.js 2016-11-14 15:08:43.316027572 -0800
5984@@ -18,7 +18,6 @@ assertEquals(1, x.concat([1])[0]);
5985 class MyArray extends Array { }
5986
5987 x.__proto__ = MyArray.prototype;
5988-assertTrue(%SpeciesProtector());
5989
5990 assertEquals(MyArray, x.map(()=>{}).constructor);
5991 assertEquals(MyArray, x.filter(()=>{}).constructor);