Browse Source

deps: update V8 to 3.28.71.19

The 3.28.73 update was technically unstable code. This reverts the code
to the latest 3.28 stable release.

Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: https://github.com/joyent/node/pull/18206
v0.12.3-release
Trevor Norris 10 years ago
committed by Julien Gilli
parent
commit
32166a90cf
  1. 5
      deps/v8/ChangeLog
  2. 2
      deps/v8/build/features.gypi
  3. 11
      deps/v8/include/v8.h
  4. 6
      deps/v8/src/api.cc
  5. 2
      deps/v8/src/array-iterator.js
  6. 1
      deps/v8/src/array.js
  7. 15
      deps/v8/src/base/platform/platform-posix.cc
  8. 1
      deps/v8/src/base/platform/platform.h
  9. 8
      deps/v8/src/bootstrapper.cc
  10. 2
      deps/v8/src/codegen.cc
  11. 260
      deps/v8/src/compiler/change-lowering.cc
  12. 79
      deps/v8/src/compiler/change-lowering.h
  13. 20
      deps/v8/src/compiler/node-properties-inl.h
  14. 16
      deps/v8/src/compiler/node-properties.h
  15. 33
      deps/v8/src/compiler/pipeline.cc
  16. 37
      deps/v8/src/compiler/representation-change.h
  17. 40
      deps/v8/src/date.h
  18. 2
      deps/v8/src/debug-debugger.js
  19. 8
      deps/v8/src/factory.cc
  20. 1
      deps/v8/src/factory.h
  21. 4
      deps/v8/src/flag-definitions.h
  22. 4
      deps/v8/src/generator.js
  23. 15
      deps/v8/src/globals.h
  24. 21
      deps/v8/src/heap/heap-inl.h
  25. 14
      deps/v8/src/heap/heap.cc
  26. 9
      deps/v8/src/heap/heap.h
  27. 9
      deps/v8/src/heap/spaces.cc
  28. 7
      deps/v8/src/heap/store-buffer.cc
  29. 13
      deps/v8/src/hydrogen-instructions.cc
  30. 16
      deps/v8/src/hydrogen.cc
  31. 8
      deps/v8/src/isolate.cc
  32. 1
      deps/v8/src/isolate.h
  33. 59
      deps/v8/src/json-parser.h
  34. 13
      deps/v8/src/lookup.h
  35. 22
      deps/v8/src/math.js
  36. 8
      deps/v8/src/objects-inl.h
  37. 3
      deps/v8/src/objects-printer.cc
  38. 101
      deps/v8/src/objects.cc
  39. 8
      deps/v8/src/objects.h
  40. 17
      deps/v8/src/ostreams.cc
  41. 15
      deps/v8/src/ostreams.h
  42. 12
      deps/v8/src/property-details-inl.h
  43. 2
      deps/v8/src/property-details.h
  44. 96
      deps/v8/src/runtime.cc
  45. 1
      deps/v8/src/runtime.h
  46. 2
      deps/v8/src/unique.h
  47. 4
      deps/v8/src/v8natives.js
  48. 4
      deps/v8/src/version.cc
  49. 7
      deps/v8/test/benchmarks/benchmarks.status
  50. 1
      deps/v8/test/cctest/compiler/graph-builder-tester.cc
  51. 17
      deps/v8/test/cctest/compiler/test-representation-change.cc
  52. 20
      deps/v8/test/cctest/compiler/test-simplified-lowering.cc
  53. 26
      deps/v8/test/cctest/test-api.cc
  54. 22
      deps/v8/test/cctest/test-spaces.cc
  55. 3
      deps/v8/test/compiler-unittests/DEPS
  56. 2
      deps/v8/test/compiler-unittests/arm/instruction-selector-arm-unittest.cc
  57. 257
      deps/v8/test/compiler-unittests/change-lowering-unittest.cc
  58. 3
      deps/v8/test/compiler-unittests/compiler-unittests.gyp
  59. 23
      deps/v8/test/compiler-unittests/compiler-unittests.h
  60. 4
      deps/v8/test/compiler-unittests/instruction-selector-unittest.cc
  61. 454
      deps/v8/test/compiler-unittests/node-matchers.cc
  62. 71
      deps/v8/test/compiler-unittests/node-matchers.h
  63. 69
      deps/v8/test/mjsunit/cross-realm-filtering.js
  64. 17
      deps/v8/test/mjsunit/es6/array-iterator.js
  65. 45
      deps/v8/test/mjsunit/es6/math-log1p.js
  66. 4
      deps/v8/test/mjsunit/es6/typed-array-iterator.js
  67. 5
      deps/v8/test/mjsunit/mjsunit.status
  68. 55
      deps/v8/test/mjsunit/own-symbols.js
  69. 314
      deps/v8/test/mjsunit/regress/regress-3116.js
  70. 22
      deps/v8/test/mjsunit/regress/regress-411210.js
  71. 18
      deps/v8/test/mjsunit/regress/regress-crbug-403409.js
  72. 12
      deps/v8/test/mjsunit/regress/regress-crbug-407946.js
  73. 10
      deps/v8/test/mjsunit/regress/regress-crbug-423687.js
  74. 18
      deps/v8/test/mjsunit/regress/regress-force-constant-representation.js
  75. 6
      deps/v8/test/mjsunit/regress/regress-json-parse-index.js
  76. 14
      deps/v8/test/mjsunit/regress/regress-reset-dictionary-elements.js
  77. 5
      deps/v8/test/mjsunit/runtime-gen/createprivateownsymbol.js
  78. 2613
      deps/v8/test/mjsunit/tools/profviz-test.log
  79. 11
      deps/v8/test/mjsunit/tools/tickprocessor-test-func-info.log
  80. 25
      deps/v8/test/mjsunit/tools/tickprocessor-test.log
  81. 2
      deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames-expected.txt
  82. 2
      deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames.js
  83. 3
      deps/v8/test/webkit/webkit.status
  84. 34
      deps/v8/testing/gtest-type-names.h
  85. 1
      deps/v8/testing/gtest.gyp
  86. 13
      deps/v8/third_party/fdlibm/fdlibm.cc
  87. 4
      deps/v8/third_party/fdlibm/fdlibm.h
  88. 192
      deps/v8/third_party/fdlibm/fdlibm.js
  89. 20
      deps/v8/tools/gen-postmortem-metadata.py
  90. 7
      deps/v8/tools/generate-runtime-tests.py
  91. 4
      deps/v8/tools/gyp/v8.gyp
  92. 43
      deps/v8/tools/run-tests.py
  93. 11
      deps/v8/tools/v8.xcodeproj/README.txt
  94. 2
      deps/v8/tools/whitespace.txt

5
deps/v8/ChangeLog

@ -1,8 +1,3 @@
2014-08-13: Version 3.28.73
Performance and stability improvements on all platforms.
2014-08-12: Version 3.28.71
ToNumber(Symbol) should throw TypeError (issue 3499).

2
deps/v8/build/features.gypi

@ -115,7 +115,7 @@
'Release': {
'variables': {
'v8_enable_extra_checks%': 0,
'v8_enable_handle_zapping%': 1,
'v8_enable_handle_zapping%': 0,
},
'conditions': [
['v8_enable_extra_checks==1', {

11
deps/v8/include/v8.h

@ -4186,17 +4186,6 @@ class V8_EXPORT Isolate {
*/
static Isolate* GetCurrent();
/**
* Custom callback used by embedders to help V8 determine if it should abort
* when it throws and no internal handler can catch the exception.
* If FLAG_abort_on_uncaught_exception is true, then V8 will abort if either:
* - no custom callback is set.
* - the custom callback set returns true.
* Otherwise it won't abort.
*/
typedef bool (*abort_on_uncaught_exception_t)();
void SetAbortOnUncaughtException(abort_on_uncaught_exception_t callback);
/**
* Methods below this point require holding a lock (using Locker) in
* a multi-threaded environment.

6
deps/v8/src/api.cc

@ -5543,6 +5543,11 @@ bool v8::String::CanMakeExternal() {
i::Handle<i::String> obj = Utils::OpenHandle(this);
i::Isolate* isolate = obj->GetIsolate();
// TODO(yangguo): Externalizing sliced/cons strings allocates.
// This rule can be removed when all code that can
// trigger an access check is handlified and therefore GC safe.
if (isolate->heap()->old_pointer_space()->Contains(*obj)) return false;
if (isolate->string_tracker()->IsFreshUnusedString(obj)) return false;
int size = obj->Size(); // Byte size of the original string.
if (size < i::ExternalString::kShortSize) return false;
@ -6731,6 +6736,7 @@ void v8::Isolate::LowMemoryNotification() {
}
}
int v8::Isolate::ContextDisposedNotification() {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
return isolate->heap()->NotifyContextDisposed();

2
deps/v8/src/array-iterator.js

@ -120,8 +120,8 @@ function ExtendArrayPrototype() {
%CheckIsBootstrapping();
InstallFunctions($Array.prototype, DONT_ENUM, $Array(
// No 'values' since it breaks webcompat: http://crbug.com/409858
'entries', ArrayEntries,
'values', ArrayValues,
'keys', ArrayKeys
));

1
deps/v8/src/array.js

@ -1480,7 +1480,6 @@ function SetUpArray() {
find: true,
findIndex: true,
keys: true,
values: true,
};
%AddNamedProperty($Array.prototype, symbolUnscopables, unscopables,
DONT_ENUM | READ_ONLY);

15
deps/v8/src/base/platform/platform-posix.cc

@ -321,15 +321,11 @@ int OS::GetCurrentProcessId() {
int OS::GetCurrentThreadId() {
#if V8_OS_MACOSX
return static_cast<int>(pthread_mach_thread_np(pthread_self()));
#elif V8_OS_LINUX
#if defined(ANDROID)
return static_cast<int>(syscall(__NR_gettid));
#elif V8_OS_ANDROID
return static_cast<int>(gettid());
#else
return static_cast<int>(pthread_self());
#endif
return static_cast<int>(syscall(SYS_gettid));
#endif // defined(ANDROID)
}
@ -608,8 +604,9 @@ void Thread::Join() {
void Thread::YieldCPU() {
const timespec delay = { 0, 1 };
nanosleep(&delay, NULL);
int result = sched_yield();
DCHECK_EQ(0, result);
USE(result);
}

1
deps/v8/src/base/platform/platform.h

@ -35,7 +35,6 @@ namespace std {
int signbit(double x);
}
# endif
#include <alloca.h>
#endif
#if V8_OS_QNX

8
deps/v8/src/bootstrapper.cc

@ -2655,17 +2655,19 @@ Genesis::Genesis(Isolate* isolate,
NONE).Assert();
// Initialize trigonometric lookup tables and constants.
const int constants_size = ARRAY_SIZE(fdlibm::MathConstants::constants);
const int constants_size =
ARRAY_SIZE(fdlibm::TrigonometricConstants::constants);
const int table_num_bytes = constants_size * kDoubleSize;
v8::Local<v8::ArrayBuffer> trig_buffer = v8::ArrayBuffer::New(
reinterpret_cast<v8::Isolate*>(isolate),
const_cast<double*>(fdlibm::MathConstants::constants), table_num_bytes);
const_cast<double*>(fdlibm::TrigonometricConstants::constants),
table_num_bytes);
v8::Local<v8::Float64Array> trig_table =
v8::Float64Array::New(trig_buffer, 0, constants_size);
Runtime::DefineObjectProperty(
builtins,
factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("kMath")),
factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("kTrig")),
Utils::OpenHandle(*trig_table), NONE).Assert();
}

2
deps/v8/src/codegen.cc

@ -190,7 +190,7 @@ void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) {
function->end_position() - function->start_position() + 1;
for (int i = 0; i < source_len; i++) {
if (stream.HasMore()) {
os << AsReversiblyEscapedUC16(stream.GetNext());
os << AsUC16(stream.GetNext());
}
}
os << "\n\n";

260
deps/v8/src/compiler/change-lowering.cc

@ -1,260 +0,0 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/change-lowering.h"
#include "src/compiler/common-node-cache.h"
#include "src/compiler/graph.h"
namespace v8 {
namespace internal {
namespace compiler {
ChangeLoweringBase::ChangeLoweringBase(Graph* graph, Linkage* linkage,
CommonNodeCache* cache)
: graph_(graph),
isolate_(graph->zone()->isolate()),
linkage_(linkage),
cache_(cache),
common_(graph->zone()),
machine_(graph->zone()) {}
ChangeLoweringBase::~ChangeLoweringBase() {}
Node* ChangeLoweringBase::ExternalConstant(ExternalReference reference) {
Node** loc = cache()->FindExternalConstant(reference);
if (*loc == NULL) {
*loc = graph()->NewNode(common()->ExternalConstant(reference));
}
return *loc;
}
Node* ChangeLoweringBase::HeapConstant(PrintableUnique<HeapObject> value) {
// TODO(bmeurer): Use common node cache.
return graph()->NewNode(common()->HeapConstant(value));
}
Node* ChangeLoweringBase::ImmovableHeapConstant(Handle<HeapObject> value) {
return HeapConstant(
PrintableUnique<HeapObject>::CreateImmovable(graph()->zone(), value));
}
Node* ChangeLoweringBase::Int32Constant(int32_t value) {
Node** loc = cache()->FindInt32Constant(value);
if (*loc == NULL) {
*loc = graph()->NewNode(common()->Int32Constant(value));
}
return *loc;
}
Node* ChangeLoweringBase::NumberConstant(double value) {
Node** loc = cache()->FindNumberConstant(value);
if (*loc == NULL) {
*loc = graph()->NewNode(common()->NumberConstant(value));
}
return *loc;
}
Node* ChangeLoweringBase::CEntryStubConstant() {
if (!c_entry_stub_constant_.is_set()) {
c_entry_stub_constant_.set(
ImmovableHeapConstant(CEntryStub(isolate(), 1).GetCode()));
}
return c_entry_stub_constant_.get();
}
Node* ChangeLoweringBase::TrueConstant() {
if (!true_constant_.is_set()) {
true_constant_.set(
ImmovableHeapConstant(isolate()->factory()->true_value()));
}
return true_constant_.get();
}
Node* ChangeLoweringBase::FalseConstant() {
if (!false_constant_.is_set()) {
false_constant_.set(
ImmovableHeapConstant(isolate()->factory()->false_value()));
}
return false_constant_.get();
}
Reduction ChangeLoweringBase::ChangeBitToBool(Node* val, Node* control) {
Node* branch = graph()->NewNode(common()->Branch(), val, control);
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Node* true_value = TrueConstant();
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
Node* false_value = FalseConstant();
Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
Node* phi =
graph()->NewNode(common()->Phi(2), true_value, false_value, merge);
return Replace(phi);
}
template <size_t kPointerSize>
ChangeLowering<kPointerSize>::ChangeLowering(Graph* graph, Linkage* linkage)
: ChangeLoweringBase(graph, linkage,
new (graph->zone()) CommonNodeCache(graph->zone())) {}
template <size_t kPointerSize>
Reduction ChangeLowering<kPointerSize>::Reduce(Node* node) {
Node* control = graph()->start();
Node* effect = control;
switch (node->opcode()) {
case IrOpcode::kChangeBitToBool:
return ChangeBitToBool(node->InputAt(0), control);
case IrOpcode::kChangeBoolToBit:
return ChangeBoolToBit(node->InputAt(0));
case IrOpcode::kChangeInt32ToTagged:
return ChangeInt32ToTagged(node->InputAt(0), effect, control);
case IrOpcode::kChangeTaggedToFloat64:
return ChangeTaggedToFloat64(node->InputAt(0), effect, control);
default:
return NoChange();
}
UNREACHABLE();
return NoChange();
}
template <>
Reduction ChangeLowering<4>::ChangeBoolToBit(Node* val) {
return Replace(
graph()->NewNode(machine()->Word32Equal(), val, TrueConstant()));
}
template <>
Reduction ChangeLowering<8>::ChangeBoolToBit(Node* val) {
return Replace(
graph()->NewNode(machine()->Word64Equal(), val, TrueConstant()));
}
template <>
Reduction ChangeLowering<4>::ChangeInt32ToTagged(Node* val, Node* effect,
Node* control) {
Node* context = NumberConstant(0);
Node* add = graph()->NewNode(machine()->Int32AddWithOverflow(), val, val);
Node* ovf = graph()->NewNode(common()->Projection(1), add);
Node* branch = graph()->NewNode(common()->Branch(), ovf, control);
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Node* number = graph()->NewNode(machine()->ChangeInt32ToFloat64(), val);
// TODO(bmeurer): Inline allocation if possible.
const Runtime::Function* fn =
Runtime::FunctionForId(Runtime::kAllocateHeapNumber);
DCHECK_EQ(0, fn->nargs);
CallDescriptor* desc = linkage()->GetRuntimeCallDescriptor(
fn->function_id, 0, Operator::kNoProperties);
Node* heap_number =
graph()->NewNode(common()->Call(desc), CEntryStubConstant(),
ExternalConstant(ExternalReference(fn, isolate())),
Int32Constant(0), context, effect, if_true);
Node* store = graph()->NewNode(
machine()->Store(kMachineFloat64, kNoWriteBarrier), heap_number,
Int32Constant(HeapNumber::kValueOffset - kHeapObjectTag), number, effect,
heap_number);
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
Node* smi = graph()->NewNode(common()->Projection(0), add);
Node* merge = graph()->NewNode(common()->Merge(2), store, if_false);
Node* phi = graph()->NewNode(common()->Phi(2), heap_number, smi, merge);
return Replace(phi);
}
template <>
Reduction ChangeLowering<8>::ChangeInt32ToTagged(Node* val, Node* effect,
Node* control) {
return Replace(graph()->NewNode(
machine()->Word64Shl(), val,
Int32Constant(SmiTagging<8>::kSmiShiftSize + kSmiTagSize)));
}
template <>
Reduction ChangeLowering<4>::ChangeTaggedToFloat64(Node* val, Node* effect,
Node* control) {
Node* branch = graph()->NewNode(
common()->Branch(),
graph()->NewNode(machine()->Word32And(), val, Int32Constant(kSmiTagMask)),
control);
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Node* load = graph()->NewNode(
machine()->Load(kMachineFloat64), val,
Int32Constant(HeapNumber::kValueOffset - kHeapObjectTag), if_true);
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
Node* number = graph()->NewNode(
machine()->ChangeInt32ToFloat64(),
graph()->NewNode(
machine()->Word32Sar(), val,
Int32Constant(SmiTagging<4>::kSmiShiftSize + kSmiTagSize)));
Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
Node* phi = graph()->NewNode(common()->Phi(2), load, number, merge);
return Replace(phi);
}
template <>
Reduction ChangeLowering<8>::ChangeTaggedToFloat64(Node* val, Node* effect,
Node* control) {
Node* branch = graph()->NewNode(
common()->Branch(),
graph()->NewNode(machine()->Word64And(), val, Int32Constant(kSmiTagMask)),
control);
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Node* load = graph()->NewNode(
machine()->Load(kMachineFloat64), val,
Int32Constant(HeapNumber::kValueOffset - kHeapObjectTag), if_true);
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
Node* number = graph()->NewNode(
machine()->ChangeInt32ToFloat64(),
graph()->NewNode(
machine()->ConvertInt64ToInt32(),
graph()->NewNode(
machine()->Word64Sar(), val,
Int32Constant(SmiTagging<8>::kSmiShiftSize + kSmiTagSize))));
Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
Node* phi = graph()->NewNode(common()->Phi(2), load, number, merge);
return Replace(phi);
}
template class ChangeLowering<4>;
template class ChangeLowering<8>;
} // namespace compiler
} // namespace internal
} // namespace v8

79
deps/v8/src/compiler/change-lowering.h

@ -1,79 +0,0 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_CHANGE_LOWERING_H_
#define V8_COMPILER_CHANGE_LOWERING_H_
#include "include/v8.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/graph-reducer.h"
#include "src/compiler/machine-operator.h"
namespace v8 {
namespace internal {
namespace compiler {
// Forward declarations.
class CommonNodeCache;
class Linkage;
class ChangeLoweringBase : public Reducer {
public:
ChangeLoweringBase(Graph* graph, Linkage* linkage, CommonNodeCache* cache);
virtual ~ChangeLoweringBase();
protected:
Node* ExternalConstant(ExternalReference reference);
Node* HeapConstant(PrintableUnique<HeapObject> value);
Node* ImmovableHeapConstant(Handle<HeapObject> value);
Node* Int32Constant(int32_t value);
Node* NumberConstant(double value);
Node* CEntryStubConstant();
Node* TrueConstant();
Node* FalseConstant();
Reduction ChangeBitToBool(Node* val, Node* control);
Graph* graph() const { return graph_; }
Isolate* isolate() const { return isolate_; }
Linkage* linkage() const { return linkage_; }
CommonNodeCache* cache() const { return cache_; }
CommonOperatorBuilder* common() { return &common_; }
MachineOperatorBuilder* machine() { return &machine_; }
private:
Graph* graph_;
Isolate* isolate_;
Linkage* linkage_;
CommonNodeCache* cache_;
CommonOperatorBuilder common_;
MachineOperatorBuilder machine_;
SetOncePointer<Node> c_entry_stub_constant_;
SetOncePointer<Node> true_constant_;
SetOncePointer<Node> false_constant_;
};
template <size_t kPointerSize = kApiPointerSize>
class ChangeLowering V8_FINAL : public ChangeLoweringBase {
public:
ChangeLowering(Graph* graph, Linkage* linkage);
ChangeLowering(Graph* graph, Linkage* linkage, CommonNodeCache* cache)
: ChangeLoweringBase(graph, linkage, cache) {}
virtual ~ChangeLowering() {}
virtual Reduction Reduce(Node* node) V8_OVERRIDE;
private:
Reduction ChangeBoolToBit(Node* val);
Reduction ChangeInt32ToTagged(Node* val, Node* effect, Node* control);
Reduction ChangeTaggedToFloat64(Node* val, Node* effect, Node* control);
};
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_CHANGE_LOWERING_H_

20
deps/v8/src/compiler/node-properties-inl.h

@ -23,12 +23,13 @@ namespace compiler {
// Inputs are always arranged in order as follows:
// 0 [ values, context, effects, control ] node->InputCount()
inline int NodeProperties::FirstValueIndex(Node* node) { return 0; }
inline int NodeProperties::FirstContextIndex(Node* node) {
inline int NodeProperties::GetContextIndex(Node* node) {
return PastValueIndex(node);
}
inline int NodeProperties::FirstValueIndex(Node* node) { return 0; }
inline int NodeProperties::FirstEffectIndex(Node* node) {
return PastContextIndex(node);
}
@ -44,7 +45,7 @@ inline int NodeProperties::PastValueIndex(Node* node) {
}
inline int NodeProperties::PastContextIndex(Node* node) {
return FirstContextIndex(node) +
return GetContextIndex(node) +
OperatorProperties::GetContextInputCount(node->op());
}
@ -70,7 +71,7 @@ inline Node* NodeProperties::GetValueInput(Node* node, int index) {
inline Node* NodeProperties::GetContextInput(Node* node) {
DCHECK(OperatorProperties::HasContextInput(node->op()));
return node->InputAt(FirstContextIndex(node));
return node->InputAt(GetContextIndex(node));
}
inline Node* NodeProperties::GetEffectInput(Node* node, int index) {
@ -105,7 +106,7 @@ inline bool NodeProperties::IsValueEdge(Node::Edge edge) {
inline bool NodeProperties::IsContextEdge(Node::Edge edge) {
Node* node = edge.from();
return IsInputRange(edge, FirstContextIndex(node),
return IsInputRange(edge, GetContextIndex(node),
OperatorProperties::GetContextInputCount(node->op()));
}
@ -133,14 +134,13 @@ inline bool NodeProperties::IsControl(Node* node) {
// -----------------------------------------------------------------------------
// Miscellaneous mutators.
inline void NodeProperties::ReplaceControlInput(Node* node, Node* control) {
node->ReplaceInput(FirstControlIndex(node), control);
}
inline void NodeProperties::ReplaceEffectInput(Node* node, Node* effect,
int index) {
DCHECK(index < OperatorProperties::GetEffectInputCount(node->op()));
return node->ReplaceInput(FirstEffectIndex(node) + index, effect);
return node->ReplaceInput(
OperatorProperties::GetValueInputCount(node->op()) +
OperatorProperties::GetContextInputCount(node->op()) + index,
effect);
}
inline void NodeProperties::RemoveNonValueInputs(Node* node) {

16
deps/v8/src/compiler/node-properties.h

@ -5,13 +5,15 @@
#ifndef V8_COMPILER_NODE_PROPERTIES_H_
#define V8_COMPILER_NODE_PROPERTIES_H_
#include "src/compiler/node.h"
#include "src/v8.h"
#include "src/types.h"
namespace v8 {
namespace internal {
namespace compiler {
class Node;
class Operator;
// A facade that simplifies access to the different kinds of inputs to a node.
@ -29,7 +31,6 @@ class NodeProperties {
static inline bool IsControl(Node* node);
static inline void ReplaceControlInput(Node* node, Node* control);
static inline void ReplaceEffectInput(Node* node, Node* effect,
int index = 0);
static inline void RemoveNonValueInputs(Node* node);
@ -37,9 +38,9 @@ class NodeProperties {
static inline Bounds GetBounds(Node* node);
static inline void SetBounds(Node* node, Bounds bounds);
private:
static inline int GetContextIndex(Node* node);
static inline int FirstValueIndex(Node* node);
static inline int FirstContextIndex(Node* node);
static inline int FirstEffectIndex(Node* node);
static inline int FirstControlIndex(Node* node);
static inline int PastValueIndex(Node* node);
@ -49,9 +50,8 @@ class NodeProperties {
static inline bool IsInputRange(Node::Edge edge, int first, int count);
};
} // namespace compiler
} // namespace internal
} // namespace v8
}
}
} // namespace v8::internal::compiler
#endif // V8_COMPILER_NODE_PROPERTIES_H_

33
deps/v8/src/compiler/pipeline.cc

@ -14,7 +14,6 @@
#include "src/compiler/js-context-specialization.h"
#include "src/compiler/js-generic-lowering.h"
#include "src/compiler/js-typed-lowering.h"
#include "src/compiler/phi-reducer.h"
#include "src/compiler/register-allocator.h"
#include "src/compiler/schedule.h"
#include "src/compiler/scheduler.h"
@ -23,7 +22,6 @@
#include "src/compiler/verifier.h"
#include "src/hydrogen.h"
#include "src/ostreams.h"
#include "src/utils.h"
namespace v8 {
namespace internal {
@ -75,25 +73,9 @@ class PhaseStats {
void Pipeline::VerifyAndPrintGraph(Graph* graph, const char* phase) {
if (FLAG_trace_turbo) {
char buffer[256];
Vector<char> filename(buffer, sizeof(buffer));
SmartArrayPointer<char> functionname =
info_->shared_info()->DebugName()->ToCString();
if (strlen(functionname.get()) > 0) {
SNPrintF(filename, "turbo-%s-%s.dot", functionname.get(), phase);
} else {
SNPrintF(filename, "turbo-%p-%s.dot", static_cast<void*>(info_), phase);
}
std::replace(filename.start(), filename.start() + filename.length(), ' ',
'_');
FILE* file = base::OS::FOpen(filename.start(), "w+");
OFStream of(file);
of << AsDOT(*graph);
fclose(file);
OFStream os(stdout);
os << "-- " << phase << " graph printed to file " << filename.start()
<< "\n";
os << "-- " << phase << " graph -----------------------------------\n"
<< AsDOT(*graph);
}
if (VerifyGraphs()) Verifier::Run(graph);
}
@ -162,17 +144,6 @@ Handle<Code> Pipeline::GenerateCode() {
graph_builder.CreateGraph();
context_node = graph_builder.GetFunctionContext();
}
{
PhaseStats phi_reducer_stats(info(), PhaseStats::CREATE_GRAPH,
"phi reduction");
PhiReducer phi_reducer;
GraphReducer graph_reducer(&graph);
graph_reducer.AddReducer(&phi_reducer);
graph_reducer.ReduceGraph();
// TODO(mstarzinger): Running reducer once ought to be enough for everyone.
graph_reducer.ReduceGraph();
graph_reducer.ReduceGraph();
}
VerifyAndPrintGraph(&graph, "Initial untyped");

37
deps/v8/src/compiler/representation-change.h

@ -88,7 +88,7 @@ class RepresentationChanger {
} else if (use_type & rFloat64) {
return GetFloat64RepresentationFor(node, output_type);
} else if (use_type & rWord32) {
return GetWord32RepresentationFor(node, output_type, use_type & tUint32);
return GetWord32RepresentationFor(node, output_type);
} else if (use_type & rBit) {
return GetBitRepresentationFor(node, output_type);
} else if (use_type & rWord64) {
@ -165,8 +165,10 @@ class RepresentationChanger {
if (output_type & rWord32) {
if (output_type & tUint32) {
op = machine()->ChangeUint32ToFloat64();
} else {
} else if (output_type & tInt32) {
op = machine()->ChangeInt32ToFloat64();
} else {
return TypeError(node, output_type, rFloat64);
}
} else if (output_type & rTagged) {
op = simplified()->ChangeTaggedToFloat64();
@ -176,23 +178,22 @@ class RepresentationChanger {
return jsgraph()->graph()->NewNode(op, node);
}
Node* GetWord32RepresentationFor(Node* node, RepTypeUnion output_type,
bool use_unsigned) {
Node* GetWord32RepresentationFor(Node* node, RepTypeUnion output_type) {
// Eagerly fold representation changes for constants.
switch (node->opcode()) {
case IrOpcode::kInt32Constant:
return node; // No change necessary.
case IrOpcode::kNumberConstant:
case IrOpcode::kFloat64Constant: {
double value = ValueOf<double>(node->op());
if (value < 0) {
DCHECK(IsInt32Double(value));
int32_t iv = static_cast<int32_t>(value);
return jsgraph()->Int32Constant(iv);
if (output_type & tUint32) {
int32_t value = static_cast<int32_t>(
static_cast<uint32_t>(ValueOf<double>(node->op())));
return jsgraph()->Int32Constant(value);
} else if (output_type & tInt32) {
int32_t value = FastD2I(ValueOf<double>(node->op()));
return jsgraph()->Int32Constant(value);
} else {
DCHECK(IsUint32Double(value));
int32_t iv = static_cast<int32_t>(static_cast<uint32_t>(value));
return jsgraph()->Int32Constant(iv);
return TypeError(node, output_type, rWord32);
}
}
default:
@ -201,16 +202,20 @@ class RepresentationChanger {
// Select the correct X -> Word32 operator.
Operator* op = NULL;
if (output_type & rFloat64) {
if (output_type & tUint32 || use_unsigned) {
if (output_type & tUint32) {
op = machine()->ChangeFloat64ToUint32();
} else {
} else if (output_type & tInt32) {
op = machine()->ChangeFloat64ToInt32();
} else {
return TypeError(node, output_type, rWord32);
}
} else if (output_type & rTagged) {
if (output_type & tUint32 || use_unsigned) {
if (output_type & tUint32) {
op = simplified()->ChangeTaggedToUint32();
} else {
} else if (output_type & tInt32) {
op = simplified()->ChangeTaggedToInt32();
} else {
return TypeError(node, output_type, rWord32);
}
} else if (output_type & rBit) {
return node; // Sloppy comparison -> word32.

40
deps/v8/src/date.h

@ -103,14 +103,52 @@ class DateCache {
}
// ECMA 262 - 15.9.1.9
// LocalTime(t) = t + LocalTZA + DaylightSavingTA(t)
int64_t ToLocal(int64_t time_ms) {
return time_ms + LocalOffsetInMs() + DaylightSavingsOffsetInMs(time_ms);
}
// ECMA 262 - 15.9.1.9
// UTC(t) = t - LocalTZA - DaylightSavingTA(t - LocalTZA)
int64_t ToUTC(int64_t time_ms) {
// We need to compute UTC time that corresponds to the given local time.
// Literally following spec here leads to incorrect time computation at
// the points were we transition to and from DST.
//
// The following shows that using DST for (t - LocalTZA - hour) produces
// correct conversion.
//
// Consider transition to DST at local time L1.
// Let L0 = L1 - hour, L2 = L1 + hour,
// U1 = UTC time that corresponds to L1,
// U0 = U1 - hour.
// Transitioning to DST moves local clock one hour forward L1 => L2, so
// U0 = UTC time that corresponds to L0 = L0 - LocalTZA,
// U1 = UTC time that corresponds to L1 = L1 - LocalTZA,
// U1 = UTC time that corresponds to L2 = L2 - LocalTZA - hour.
// Note that DST(U0 - hour) = 0, DST(U0) = 0, DST(U1) = 1.
// U0 = L0 - LocalTZA - DST(L0 - LocalTZA - hour),
// U1 = L1 - LocalTZA - DST(L1 - LocalTZA - hour),
// U1 = L2 - LocalTZA - DST(L2 - LocalTZA - hour).
//
// Consider transition from DST at local time L1.
// Let L0 = L1 - hour,
// U1 = UTC time that corresponds to L1,
// U0 = U1 - hour, U2 = U1 + hour.
// Transitioning from DST moves local clock one hour back L1 => L0, so
// U0 = UTC time that corresponds to L0 (before transition)
// = L0 - LocalTZA - hour.
// U1 = UTC time that corresponds to L0 (after transition)
// = L0 - LocalTZA = L1 - LocalTZA - hour
// U2 = UTC time that corresponds to L1 = L1 - LocalTZA.
// Note that DST(U0) = 1, DST(U1) = 0, DST(U2) = 0.
// U0 = L0 - LocalTZA - DST(L0 - LocalTZA - hour) = L0 - LocalTZA - DST(U0).
// U2 = L1 - LocalTZA - DST(L1 - LocalTZA - hour) = L1 - LocalTZA - DST(U1).
// It is impossible to get U1 from local time.
const int kMsPerHour = 3600 * 1000;
time_ms -= LocalOffsetInMs();
return time_ms - DaylightSavingsOffsetInMs(time_ms);
return time_ms - DaylightSavingsOffsetInMs(time_ms - kMsPerHour);
}

2
deps/v8/src/debug-debugger.js

@ -430,7 +430,7 @@ ScriptBreakPoint.prototype.set = function (script) {
if (IS_NULL(position)) return;
// Create a break point object and set the break point.
var break_point = MakeBreakPoint(position, this);
break_point = MakeBreakPoint(position, this);
break_point.setIgnoreCount(this.ignoreCount());
var actual_position = %SetScriptBreakPoint(script, position,
this.position_alignment_,

8
deps/v8/src/factory.cc

@ -664,14 +664,6 @@ Handle<Symbol> Factory::NewPrivateSymbol() {
}
Handle<Symbol> Factory::NewPrivateOwnSymbol() {
Handle<Symbol> symbol = NewSymbol();
symbol->set_is_private(true);
symbol->set_is_own(true);
return symbol;
}
Handle<Context> Factory::NewNativeContext() {
Handle<FixedArray> array = NewFixedArray(Context::NATIVE_CONTEXT_SLOTS);
array->set_map_no_write_barrier(*native_context_map());

1
deps/v8/src/factory.h

@ -221,7 +221,6 @@ class Factory V8_FINAL {
// Create a symbol.
Handle<Symbol> NewSymbol();
Handle<Symbol> NewPrivateSymbol();
Handle<Symbol> NewPrivateOwnSymbol();
// Create a global (but otherwise uninitialized) context.
Handle<Context> NewNativeContext();

4
deps/v8/src/flag-definitions.h

@ -460,9 +460,7 @@ DEFINE_BOOL(enable_liveedit, true, "enable liveedit experimental feature")
DEFINE_BOOL(hard_abort, true, "abort by crashing")
// execution.cc
// Slightly less than 1MB, since Windows' default stack size for
// the main execution thread is 1MB for both 32 and 64-bit.
DEFINE_INT(stack_size, 984,
DEFINE_INT(stack_size, V8_DEFAULT_STACK_SIZE_KB,
"default size of stack region v8 is allowed to use (in kBytes)")
// frames.cc

4
deps/v8/src/generator.js

@ -47,9 +47,7 @@ function GeneratorFunctionConstructor(arg1) { // length == 1
var global_proxy = %GlobalProxy(global);
// Compile the string in the constructor and not a helper so that errors
// appear to come from here.
var f = %CompileString(source, true);
if (!IS_FUNCTION(f)) return f;
f = %_CallFunction(global_proxy, f);
var f = %_CallFunction(global_proxy, %CompileString(source, true));
%FunctionMarkNameShouldPrintAsAnonymous(f);
return f;
}

15
deps/v8/src/globals.h

@ -31,7 +31,8 @@
#else
#define V8_TURBOFAN_BACKEND 0
#endif
#if V8_TURBOFAN_BACKEND && !(V8_OS_WIN && V8_TARGET_ARCH_X64)
#if V8_TURBOFAN_BACKEND && !V8_TARGET_ARCH_ARM64 && \
!(V8_OS_WIN && V8_TARGET_ARCH_X64)
#define V8_TURBOFAN_TARGET 1
#else
#define V8_TURBOFAN_TARGET 0
@ -68,6 +69,18 @@ namespace internal {
// Determine whether the architecture uses an out-of-line constant pool.
#define V8_OOL_CONSTANT_POOL 0
#ifdef V8_TARGET_ARCH_ARM
// Set stack limit lower for ARM than for other architectures because
// stack allocating MacroAssembler takes 120K bytes.
// See issue crbug.com/405338
#define V8_DEFAULT_STACK_SIZE_KB 864
#else
// Slightly less than 1MB, since Windows' default stack size for
// the main execution thread is 1MB for both 32 and 64-bit.
#define V8_DEFAULT_STACK_SIZE_KB 984
#endif
// Support for alternative bool type. This is only enabled if the code is
// compiled with USE_MYBOOL defined. This catches some nasty type bugs.
// For instance, 'bool b = "false";' results in b == true! This is a hidden

21
deps/v8/src/heap/heap-inl.h

@ -31,18 +31,12 @@ void PromotionQueue::insert(HeapObject* target, int size) {
NewSpacePage::FromAddress(reinterpret_cast<Address>(rear_));
DCHECK(!rear_page->prev_page()->is_anchor());
rear_ = reinterpret_cast<intptr_t*>(rear_page->prev_page()->area_end());
ActivateGuardIfOnTheSamePage();
}
if (guard_) {
DCHECK(GetHeadPage() ==
Page::FromAllocationTop(reinterpret_cast<Address>(limit_)));
if ((rear_ - 2) < limit_) {
RelocateQueueHead();
emergency_stack_->Add(Entry(target, size));
return;
}
if ((rear_ - 2) < limit_) {
RelocateQueueHead();
emergency_stack_->Add(Entry(target, size));
return;
}
*(--rear_) = reinterpret_cast<intptr_t>(target);
@ -55,13 +49,6 @@ void PromotionQueue::insert(HeapObject* target, int size) {
}
void PromotionQueue::ActivateGuardIfOnTheSamePage() {
guard_ = guard_ ||
heap_->new_space()->active_space()->current_page()->address() ==
GetHeadPage()->address();
}
template <>
bool inline Heap::IsOneByte(Vector<const char> str, int chars) {
// TODO(dcarney): incorporate Latin-1 check when Latin-1 is supported?

14
deps/v8/src/heap/heap.cc

@ -1373,7 +1373,6 @@ void PromotionQueue::Initialize() {
front_ = rear_ =
reinterpret_cast<intptr_t*>(heap_->new_space()->ToSpaceEnd());
emergency_stack_ = NULL;
guard_ = false;
}
@ -1971,15 +1970,16 @@ class ScavengingVisitor : public StaticVisitorBase {
HeapObject* target = NULL; // Initialization to please compiler.
if (allocation.To(&target)) {
// Order is important here: Set the promotion limit before storing a
// filler for double alignment or migrating the object. Otherwise we
// may end up overwriting promotion queue entries when we migrate the
// object.
heap->promotion_queue()->SetNewLimit(heap->new_space()->top());
if (alignment != kObjectAlignment) {
target = EnsureDoubleAligned(heap, target, allocation_size);
}
// Order is important here: Set the promotion limit before migrating
// the object. Otherwise we may end up overwriting promotion queue
// entries when we migrate the object.
heap->promotion_queue()->SetNewLimit(heap->new_space()->top());
// Order is important: slot might be inside of the target if target
// was allocated over a dead object and slot comes from the store
// buffer.
@ -2834,7 +2834,7 @@ void Heap::CreateInitialObjects() {
// Allocate the dictionary of intrinsic function names.
Handle<NameDictionary> intrinsic_names =
NameDictionary::New(isolate(), Runtime::kNumFunctions, TENURED);
NameDictionary::New(isolate(), Runtime::kNumFunctions);
Runtime::InitializeIntrinsicFunctionNames(isolate(), intrinsic_names);
set_intrinsic_function_names(*intrinsic_names);

9
deps/v8/src/heap/heap.h

@ -393,18 +393,11 @@ class PromotionQueue {
emergency_stack_ = NULL;
}
inline void ActivateGuardIfOnTheSamePage();
Page* GetHeadPage() {
return Page::FromAllocationTop(reinterpret_cast<Address>(rear_));
}
void SetNewLimit(Address limit) {
if (!guard_) {
return;
}
DCHECK(GetHeadPage() == Page::FromAllocationTop(limit));
limit_ = reinterpret_cast<intptr_t*>(limit);
if (limit_ <= rear_) {
@ -461,8 +454,6 @@ class PromotionQueue {
intptr_t* rear_;
intptr_t* limit_;
bool guard_;
static const int kEntrySizeInWords = 2;
struct Entry {

9
deps/v8/src/heap/spaces.cc

@ -193,8 +193,10 @@ Address CodeRange::AllocateRawMemory(const size_t requested_size,
const size_t commit_size,
size_t* allocated) {
DCHECK(commit_size <= requested_size);
DCHECK(current_allocation_block_index_ < allocation_list_.length());
if (requested_size > allocation_list_[current_allocation_block_index_].size) {
DCHECK(allocation_list_.length() == 0 ||
current_allocation_block_index_ < allocation_list_.length());
if (allocation_list_.length() == 0 ||
requested_size > allocation_list_[current_allocation_block_index_].size) {
// Find an allocation block large enough.
if (!GetNextAllocationBlock(requested_size)) return NULL;
}
@ -218,7 +220,7 @@ Address CodeRange::AllocateRawMemory(const size_t requested_size,
allocation_list_[current_allocation_block_index_].size -= *allocated;
if (*allocated == current.size) {
// This block is used up, get the next one.
if (!GetNextAllocationBlock(0)) return NULL;
GetNextAllocationBlock(0);
}
return current.start;
}
@ -1365,7 +1367,6 @@ bool NewSpace::AddFreshPage() {
Address limit = NewSpacePage::FromLimit(top)->area_end();
if (heap()->gc_state() == Heap::SCAVENGE) {
heap()->promotion_queue()->SetNewLimit(limit);
heap()->promotion_queue()->ActivateGuardIfOnTheSamePage();
}
int remaining_in_page = static_cast<int>(limit - top);

7
deps/v8/src/heap/store-buffer.cc

@ -486,10 +486,11 @@ void StoreBuffer::IteratePointersToNewSpace(ObjectSlotCallback slot_callback,
heap_object = iterator.Next()) {
// We skip free space objects.
if (!heap_object->IsFiller()) {
DCHECK(heap_object->IsMap());
FindPointersToNewSpaceInRegion(
heap_object->address() + HeapObject::kHeaderSize,
heap_object->address() + heap_object->Size(), slot_callback,
clear_maps);
heap_object->address() + Map::kPointerFieldsBeginOffset,
heap_object->address() + Map::kPointerFieldsEndOffset,
slot_callback, clear_maps);
}
}
} else {

13
deps/v8/src/hydrogen-instructions.cc

@ -1511,17 +1511,8 @@ HInstruction* HForceRepresentation::New(Zone* zone, HValue* context,
HValue* value, Representation representation) {
if (FLAG_fold_constants && value->IsConstant()) {
HConstant* c = HConstant::cast(value);
if (c->HasNumberValue()) {
double double_res = c->DoubleValue();
if (representation.IsDouble()) {
return HConstant::New(zone, context, double_res);
} else if (representation.CanContainDouble(double_res)) {
return HConstant::New(zone, context,
static_cast<int32_t>(double_res),
representation);
}
}
c = c->CopyToRepresentation(representation, zone);
if (c != NULL) return c;
}
return new(zone) HForceRepresentation(value, representation);
}

16
deps/v8/src/hydrogen.cc

@ -3498,7 +3498,7 @@ int HGraph::TraceInlinedFunction(
shared->end_position() - shared->start_position() + 1;
for (int i = 0; i < source_len; i++) {
if (stream.HasMore()) {
os << AsReversiblyEscapedUC16(stream.GetNext());
os << AsUC16(stream.GetNext());
}
}
}
@ -8800,6 +8800,12 @@ HValue* HOptimizedGraphBuilder::BuildArrayIndexOf(HValue* receiver,
Push(graph()->GetConstantMinus1());
if (IsFastDoubleElementsKind(kind) || IsFastSmiElementsKind(kind)) {
// Make sure that we can actually compare numbers correctly below, see
// https://code.google.com/p/chromium/issues/detail?id=407946 for details.
search_element = AddUncasted<HForceRepresentation>(
search_element, IsFastSmiElementsKind(kind) ? Representation::Smi()
: Representation::Double());
LoopBuilder loop(this, context(), direction);
{
HValue* index = loop.BeginBody(initial, terminating, token);
@ -8807,12 +8813,8 @@ HValue* HOptimizedGraphBuilder::BuildArrayIndexOf(HValue* receiver,
elements, index, static_cast<HValue*>(NULL),
kind, ALLOW_RETURN_HOLE);
IfBuilder if_issame(this);
if (IsFastDoubleElementsKind(kind)) {
if_issame.If<HCompareNumericAndBranch>(
element, search_element, Token::EQ_STRICT);
} else {
if_issame.If<HCompareObjectEqAndBranch>(element, search_element);
}
if_issame.If<HCompareNumericAndBranch>(element, search_element,
Token::EQ_STRICT);
if_issame.Then();
{
Drop(1);

8
deps/v8/src/isolate.cc

@ -1090,9 +1090,10 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) {
thread_local_top()->pending_message_end_pos_ = location->end_pos();
}
// If the abort-on-uncaught-exception flag is specified, and if the
// exception is not caught by JavaScript (even when an external handler is
// present).
// If the abort-on-uncaught-exception flag is specified, abort on any
// exception not caught by JavaScript, even when an external handler is
// present. This flag is intended for use by JavaScript developers, so
// print a user-friendly stack trace (not an internal one).
if (fatal_exception_depth == 0 &&
FLAG_abort_on_uncaught_exception &&
(report_exception || can_be_caught_externally)) {
@ -1297,6 +1298,7 @@ void Isolate::SetCaptureStackTraceForUncaughtExceptions(
stack_trace_for_uncaught_exceptions_options_ = options;
}
Handle<Context> Isolate::native_context() {
return handle(context()->native_context());
}

1
deps/v8/src/isolate.h

@ -1326,7 +1326,6 @@ class Isolate {
v8::Isolate::UseCounterCallback use_counter_callback_;
friend class ExecutionAccess;
friend class HandleScopeImplementer;
friend class IsolateInitializer;

59
deps/v8/src/json-parser.h

@ -182,6 +182,9 @@ class JsonParser BASE_EMBEDDED {
private:
Zone* zone() { return &zone_; }
void CommitStateToJsonObject(Handle<JSObject> json_object, Handle<Map> map,
ZoneList<Handle<Object> >* properties);
Handle<String> source_;
int source_length_;
Handle<SeqOneByteString> seq_source_;
@ -408,13 +411,7 @@ Handle<Object> JsonParser<seq_ascii>::ParseJsonObject() {
}
// Commit the intermediate state to the object and stop transitioning.
JSObject::AllocateStorageForMap(json_object, map);
int length = properties.length();
for (int i = 0; i < length; i++) {
Handle<Object> value = properties[i];
FieldIndex index = FieldIndex::ForPropertyIndex(*map, i);
json_object->FastPropertyAtPut(index, *value);
}
CommitStateToJsonObject(json_object, map, &properties);
} else {
key = ParseJsonInternalizedString();
if (key.is_null() || c0_ != ':') return ReportUnexpectedCharacter();
@ -424,8 +421,7 @@ Handle<Object> JsonParser<seq_ascii>::ParseJsonObject() {
if (value.is_null()) return ReportUnexpectedCharacter();
}
JSObject::SetOwnPropertyIgnoreAttributes(
json_object, key, value, NONE).Assert();
Runtime::DefineObjectProperty(json_object, key, value, NONE).Check();
} while (MatchSkipWhiteSpace(','));
if (c0_ != '}') {
return ReportUnexpectedCharacter();
@ -433,19 +429,50 @@ Handle<Object> JsonParser<seq_ascii>::ParseJsonObject() {
// If we transitioned until the very end, transition the map now.
if (transitioning) {
JSObject::AllocateStorageForMap(json_object, map);
int length = properties.length();
for (int i = 0; i < length; i++) {
Handle<Object> value = properties[i];
FieldIndex index = FieldIndex::ForPropertyIndex(*map, i);
json_object->FastPropertyAtPut(index, *value);
}
CommitStateToJsonObject(json_object, map, &properties);
}
}
AdvanceSkipWhitespace();
return scope.CloseAndEscape(json_object);
}
template <bool seq_one_byte>
void JsonParser<seq_one_byte>::CommitStateToJsonObject(
Handle<JSObject> json_object, Handle<Map> map,
ZoneList<Handle<Object> >* properties) {
JSObject::AllocateStorageForMap(json_object, map);
DCHECK(!json_object->map()->is_dictionary_map());
DisallowHeapAllocation no_gc;
Factory* factory = isolate()->factory();
// If the |json_object|'s map is exactly the same as |map| then the
// |properties| values correspond to the |map| and nothing more has to be
// done. But if the |json_object|'s map is different then we have to
// iterate descriptors to ensure that properties still correspond to the
// map.
bool slow_case = json_object->map() != *map;
DescriptorArray* descriptors = NULL;
int length = properties->length();
if (slow_case) {
descriptors = json_object->map()->instance_descriptors();
DCHECK(json_object->map()->NumberOfOwnDescriptors() == length);
}
for (int i = 0; i < length; i++) {
Handle<Object> value = (*properties)[i];
if (slow_case && value->IsMutableHeapNumber() &&
!descriptors->GetDetails(i).representation().IsDouble()) {
// Turn mutable heap numbers into immutable if the field representation
// is not double.
HeapNumber::cast(*value)->set_map(*factory->heap_number_map());
}
FieldIndex index = FieldIndex::ForPropertyIndex(*map, i);
json_object->FastPropertyAtPut(index, *value);
}
}
// Parse a JSON array. Position must be right at '['.
template <bool seq_ascii>
Handle<Object> JsonParser<seq_ascii>::ParseJsonArray() {

13
deps/v8/src/lookup.h

@ -47,7 +47,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
LookupIterator(Handle<Object> receiver,
Handle<Name> name,
Configuration configuration = CHECK_ALL)
: configuration_(ComputeConfiguration(configuration, name)),
: configuration_(configuration),
state_(NOT_FOUND),
property_kind_(DATA),
property_encoding_(DESCRIPTOR),
@ -66,7 +66,7 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
Handle<Name> name,
Handle<JSReceiver> holder,
Configuration configuration = CHECK_ALL)
: configuration_(ComputeConfiguration(configuration, name)),
: configuration_(configuration),
state_(NOT_FOUND),
property_kind_(DATA),
property_encoding_(DESCRIPTOR),
@ -187,15 +187,6 @@ class LookupIterator V8_FINAL BASE_EMBEDDED {
return number_;
}
static Configuration ComputeConfiguration(
Configuration configuration, Handle<Name> name) {
if (name->IsOwn()) {
return static_cast<Configuration>(configuration & CHECK_OWN);
} else {
return configuration;
}
}
Configuration configuration_;
State state_;
bool has_property_;

22
deps/v8/src/math.js

@ -347,6 +347,26 @@ function MathExpm1(x) {
}
}
// ES6 draft 09-27-13, section 20.2.2.20.
// Use Taylor series to approximate. With y = x + 1;
// log(y) at 1 == log(1) + log'(1)(y-1)/1! + log''(1)(y-1)^2/2! + ...
// == 0 + x - x^2/2 + x^3/3 ...
// The closer x is to 0, the fewer terms are required.
function MathLog1p(x) {
if (!IS_NUMBER(x)) x = NonNumberToNumber(x);
var xabs = MathAbs(x);
if (xabs < 1E-7) {
return x * (1 - x * (1/2));
} else if (xabs < 3E-5) {
return x * (1 - x * (1/2 - x * (1/3)));
} else if (xabs < 7E-3) {
return x * (1 - x * (1/2 - x * (1/3 - x * (1/4 -
x * (1/5 - x * (1/6 - x * (1/7)))))));
} else { // Use regular log if not close enough to 0.
return MathLog(1 + x);
}
}
// -------------------------------------------------------------------
function SetUpMath() {
@ -408,7 +428,7 @@ function SetUpMath() {
"fround", MathFroundJS,
"clz32", MathClz32,
"cbrt", MathCbrt,
"log1p", MathLog1p, // implemented by third_party/fdlibm
"log1p", MathLog1p,
"expm1", MathExpm1
));

8
deps/v8/src/objects-inl.h

@ -2920,9 +2920,6 @@ FixedArrayBase* Map::GetInitialElements() {
GetHeap()->EmptyFixedTypedArrayForMap(this);
DCHECK(!GetHeap()->InNewSpace(empty_array));
return empty_array;
} else if (has_dictionary_elements()) {
DCHECK(!GetHeap()->InNewSpace(GetHeap()->empty_slow_element_dictionary()));
return GetHeap()->empty_slow_element_dictionary();
} else {
UNREACHABLE();
}
@ -3372,7 +3369,6 @@ bool Name::Equals(Handle<Name> one, Handle<Name> two) {
ACCESSORS(Symbol, name, Object, kNameOffset)
ACCESSORS(Symbol, flags, Smi, kFlagsOffset)
BOOL_ACCESSORS(Symbol, flags, is_private, kPrivateBit)
BOOL_ACCESSORS(Symbol, flags, is_own, kOwnBit)
bool String::Equals(String* other) {
@ -6497,10 +6493,6 @@ uint32_t Name::Hash() {
return String::cast(this)->ComputeAndSetHash();
}
bool Name::IsOwn() {
return this->IsSymbol() && Symbol::cast(this)->is_own();
}
StringHasher::StringHasher(int length, uint32_t seed)
: length_(length),

3
deps/v8/src/objects-printer.cc

@ -430,8 +430,7 @@ void Symbol::SymbolPrint(OStream& os) { // NOLINT
HeapObject::PrintHeader(os, "Symbol");
os << " - hash: " << Hash();
os << "\n - name: " << Brief(name());
os << "\n - private: " << is_private();
os << "\n - own: " << is_own();
os << " - private: " << is_private();
os << "\n";
}

101
deps/v8/src/objects.cc

@ -693,7 +693,7 @@ void JSObject::SetNormalizedProperty(Handle<JSObject> object,
Handle<Name> name,
Handle<Object> value,
PropertyDetails details) {
DCHECK(!object->HasFastProperties());
CHECK(!object->HasFastProperties());
Handle<NameDictionary> property_dictionary(object->property_dictionary());
if (!name->IsUniqueName()) {
@ -3560,11 +3560,6 @@ void JSObject::LookupRealNamedProperty(Handle<Name> name,
void JSObject::LookupRealNamedPropertyInPrototypes(Handle<Name> name,
LookupResult* result) {
if (name->IsOwn()) {
result->NotFound();
return;
}
DisallowHeapAllocation no_gc;
Isolate* isolate = GetIsolate();
for (PrototypeIterator iter(isolate, this); !iter.IsAtEnd(); iter.Advance()) {
@ -4735,9 +4730,15 @@ void JSObject::MigrateSlowToFast(Handle<JSObject> object,
void JSObject::ResetElements(Handle<JSObject> object) {
Heap* heap = object->GetIsolate()->heap();
CHECK(object->map() != heap->sloppy_arguments_elements_map());
object->set_elements(object->map()->GetInitialElements());
Isolate* isolate = object->GetIsolate();
CHECK(object->map() != isolate->heap()->sloppy_arguments_elements_map());
if (object->map()->has_dictionary_elements()) {
Handle<SeededNumberDictionary> new_elements =
SeededNumberDictionary::New(isolate, 0);
object->set_elements(*new_elements);
} else {
object->set_elements(object->map()->GetInitialElements());
}
}
@ -6112,7 +6113,7 @@ void JSReceiver::LookupOwn(
}
js_object->LookupOwnRealNamedProperty(name, result);
if (result->IsFound() || name->IsOwn() || !search_hidden_prototypes) return;
if (result->IsFound() || !search_hidden_prototypes) return;
PrototypeIterator iter(GetIsolate(), js_object);
if (!iter.GetCurrent()->IsJSReceiver()) return;
@ -6131,10 +6132,6 @@ void JSReceiver::Lookup(Handle<Name> name, LookupResult* result) {
!iter.IsAtEnd(); iter.Advance()) {
JSReceiver::cast(iter.GetCurrent())->LookupOwn(name, result, false);
if (result->IsFound()) return;
if (name->IsOwn()) {
result->NotFound();
return;
}
}
result->NotFound();
}
@ -6874,25 +6871,26 @@ MaybeHandle<Object> JSObject::GetAccessor(Handle<JSObject> object,
// interceptor calls.
AssertNoContextChange ncc(isolate);
// Check access rights if needed.
if (object->IsAccessCheckNeeded() &&
!isolate->MayNamedAccess(object, name, v8::ACCESS_HAS)) {
isolate->ReportFailedAccessCheck(object, v8::ACCESS_HAS);
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
return isolate->factory()->undefined_value();
}
// Make the lookup and include prototypes.
uint32_t index = 0;
if (name->AsArrayIndex(&index)) {
for (PrototypeIterator iter(isolate, object,
PrototypeIterator::START_AT_RECEIVER);
!iter.IsAtEnd(); iter.Advance()) {
if (PrototypeIterator::GetCurrent(iter)->IsJSObject() &&
JSObject::cast(*PrototypeIterator::GetCurrent(iter))
->HasDictionaryElements()) {
JSObject* js_object =
JSObject::cast(*PrototypeIterator::GetCurrent(iter));
Handle<Object> current = PrototypeIterator::GetCurrent(iter);
// Check access rights if needed.
if (current->IsAccessCheckNeeded() &&
!isolate->MayNamedAccess(Handle<JSObject>::cast(current), name,
v8::ACCESS_HAS)) {
isolate->ReportFailedAccessCheck(Handle<JSObject>::cast(current),
v8::ACCESS_HAS);
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
return isolate->factory()->undefined_value();
}
if (current->IsJSObject() &&
Handle<JSObject>::cast(current)->HasDictionaryElements()) {
JSObject* js_object = JSObject::cast(*current);
SeededNumberDictionary* dictionary = js_object->element_dictionary();
int entry = dictionary->FindEntry(index);
if (entry != SeededNumberDictionary::kNotFound) {
@ -6906,21 +6904,37 @@ MaybeHandle<Object> JSObject::GetAccessor(Handle<JSObject> object,
}
}
} else {
for (PrototypeIterator iter(isolate, object,
PrototypeIterator::START_AT_RECEIVER);
!iter.IsAtEnd(); iter.Advance()) {
LookupResult result(isolate);
JSReceiver::cast(*PrototypeIterator::GetCurrent(iter))
->LookupOwn(name, &result);
if (result.IsFound()) {
if (result.IsReadOnly()) return isolate->factory()->undefined_value();
if (result.IsPropertyCallbacks()) {
Object* obj = result.GetCallbackObject();
if (obj->IsAccessorPair()) {
return handle(AccessorPair::cast(obj)->GetComponent(component),
isolate);
LookupIterator it(object, name, LookupIterator::SKIP_INTERCEPTOR);
for (; it.IsFound(); it.Next()) {
switch (it.state()) {
case LookupIterator::NOT_FOUND:
case LookupIterator::INTERCEPTOR:
UNREACHABLE();
case LookupIterator::ACCESS_CHECK:
if (it.HasAccess(v8::ACCESS_HAS)) continue;
isolate->ReportFailedAccessCheck(it.GetHolder<JSObject>(),
v8::ACCESS_HAS);
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
return isolate->factory()->undefined_value();
case LookupIterator::JSPROXY:
return isolate->factory()->undefined_value();
case LookupIterator::PROPERTY:
if (!it.HasProperty()) continue;
switch (it.property_kind()) {
case LookupIterator::DATA:
continue;
case LookupIterator::ACCESSOR: {
Handle<Object> maybe_pair = it.GetAccessors();
if (maybe_pair->IsAccessorPair()) {
return handle(
AccessorPair::cast(*maybe_pair)->GetComponent(component),
isolate);
}
}
}
}
}
}
}
@ -11417,10 +11431,7 @@ void Code::Disassemble(const char* name, OStream& os) { // NOLINT
os << "Instructions (size = " << instruction_size() << ")\n";
// TODO(svenpanne) The Disassembler should use streams, too!
{
CodeTracer::Scope trace_scope(GetIsolate()->GetCodeTracer());
Disassembler::Decode(trace_scope.file(), this);
}
Disassembler::Decode(stdout, this);
os << "\n";
if (kind() == FUNCTION) {

8
deps/v8/src/objects.h

@ -8954,9 +8954,6 @@ class Name: public HeapObject {
// Conversion.
inline bool AsArrayIndex(uint32_t* index);
// Whether name can only name own properties.
inline bool IsOwn();
DECLARE_CAST(Name)
DECLARE_PRINTER(Name)
@ -9032,10 +9029,6 @@ class Symbol: public Name {
// [is_private]: whether this is a private symbol.
DECL_BOOLEAN_ACCESSORS(is_private)
// [is_own]: whether this is an own symbol, that is, only used to designate
// own properties of objects.
DECL_BOOLEAN_ACCESSORS(is_own)
DECLARE_CAST(Symbol)
// Dispatched behavior.
@ -9051,7 +9044,6 @@ class Symbol: public Name {
private:
static const int kPrivateBit = 0;
static const int kOwnBit = 1;
DISALLOW_IMPLICIT_CONSTRUCTORS(Symbol);
};

17
deps/v8/src/ostreams.cc

@ -3,7 +3,6 @@
// found in the LICENSE file.
#include <algorithm>
#include <cctype>
#include <cmath>
#include "src/base/platform/platform.h" // For isinf/isnan with MSVC
@ -164,21 +163,11 @@ OFStream& OFStream::flush() {
}
OStream& operator<<(OStream& os, const AsReversiblyEscapedUC16& c) {
char buf[10];
const char* format =
(std::isprint(c.value) || std::isspace(c.value)) && c.value != '\\'
? "%c"
: (c.value <= 0xff) ? "\\x%02x" : "\\u%04x";
snprintf(buf, sizeof(buf), format, c.value);
return os << buf;
}
OStream& operator<<(OStream& os, const AsUC16& c) {
char buf[10];
const char* format =
std::isprint(c.value) ? "%c" : (c.value <= 0xff) ? "\\x%02x" : "\\u%04x";
const char* format = (0x20 <= c.value && c.value <= 0x7F)
? "%c"
: (c.value <= 0xff) ? "\\x%02x" : "\\u%04x";
snprintf(buf, sizeof(buf), format, c.value);
return os << buf;
}

15
deps/v8/src/ostreams.h

@ -117,26 +117,13 @@ class OFStream: public OStream {
};
// Wrappers to disambiguate uint16_t and uc16.
// A wrapper to disambiguate uint16_t and uc16.
struct AsUC16 {
explicit AsUC16(uint16_t v) : value(v) {}
uint16_t value;
};
struct AsReversiblyEscapedUC16 {
explicit AsReversiblyEscapedUC16(uint16_t v) : value(v) {}
uint16_t value;
};
// Writes the given character to the output escaping everything outside of
// printable/space ASCII range. Additionally escapes '\' making escaping
// reversible.
OStream& operator<<(OStream& os, const AsReversiblyEscapedUC16& c);
// Writes the given character to the output escaping everything outside
// of printable ASCII range.
OStream& operator<<(OStream& os, const AsUC16& c);
} } // namespace v8::internal

12
deps/v8/src/property-details-inl.h

@ -13,18 +13,6 @@
namespace v8 {
namespace internal {
inline bool Representation::CanContainDouble(double value) {
if (IsDouble() || is_more_general_than(Representation::Double())) {
return true;
}
if (IsInt32Double(value)) {
if (IsInteger32()) return true;
if (IsSmi()) return Smi::IsValid(static_cast<int32_t>(value));
}
return false;
}
Representation Representation::FromType(Type* type) {
DisallowHeapAllocation no_allocation;
if (type->Is(Type::None())) return Representation::None();

2
deps/v8/src/property-details.h

@ -124,8 +124,6 @@ class Representation {
return other.is_more_general_than(*this) || other.Equals(*this);
}
bool CanContainDouble(double value);
Representation generalize(Representation other) {
if (other.fits_into(*this)) return *this;
if (other.is_more_general_than(*this)) return other;

96
deps/v8/src/runtime.cc

@ -608,17 +608,6 @@ RUNTIME_FUNCTION(Runtime_CreatePrivateSymbol) {
}
RUNTIME_FUNCTION(Runtime_CreatePrivateOwnSymbol) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(Object, name, 0);
RUNTIME_ASSERT(name->IsString() || name->IsUndefined());
Handle<Symbol> symbol = isolate->factory()->NewPrivateOwnSymbol();
if (name->IsString()) symbol->set_name(*name);
return *symbol;
}
RUNTIME_FUNCTION(Runtime_CreateGlobalPrivateSymbol) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
@ -9767,59 +9756,6 @@ bool CodeGenerationFromStringsAllowed(Isolate* isolate,
}
// Walk up the stack expecting:
// - Runtime_CompileString
// - JSFunction callee (eval, Function constructor, etc)
// - call() (maybe)
// - apply() (maybe)
// - bind() (maybe)
// - JSFunction caller (maybe)
//
// return true if the caller has the same security token as the callee
// or if an exit frame was hit, in which case allow it through, as it could
// have come through the api.
static bool TokensMatchForCompileString(Isolate* isolate) {
MaybeHandle<JSFunction> callee;
bool exit_handled = true;
bool tokens_match = true;
bool done = false;
for (StackFrameIterator it(isolate); !it.done() && !done; it.Advance()) {
StackFrame* raw_frame = it.frame();
if (!raw_frame->is_java_script()) {
if (raw_frame->is_exit()) exit_handled = false;
continue;
}
JavaScriptFrame* outer_frame = JavaScriptFrame::cast(raw_frame);
List<FrameSummary> frames(FLAG_max_inlining_levels + 1);
outer_frame->Summarize(&frames);
for (int i = frames.length() - 1; i >= 0 && !done; --i) {
FrameSummary& frame = frames[i];
Handle<JSFunction> fun = frame.function();
// Capture the callee function.
if (callee.is_null()) {
callee = fun;
exit_handled = true;
continue;
}
// Exit condition.
Handle<Context> context(callee.ToHandleChecked()->context());
if (!fun->context()->HasSameSecurityTokenAs(*context)) {
tokens_match = false;
done = true;
continue;
}
// Skip bound functions in correct origin.
if (fun->shared()->bound()) {
exit_handled = true;
continue;
}
done = true;
}
}
return !exit_handled || tokens_match;
}
RUNTIME_FUNCTION(Runtime_CompileString) {
HandleScope scope(isolate);
DCHECK(args.length() == 2);
@ -9829,11 +9765,6 @@ RUNTIME_FUNCTION(Runtime_CompileString) {
// Extract native context.
Handle<Context> context(isolate->native_context());
// Filter cross security context calls.
if (!TokensMatchForCompileString(isolate)) {
return isolate->heap()->undefined_value();
}
// Check if native context allows code generation from
// strings. Throw an exception if it doesn't.
if (context->allow_code_gen_from_strings()->IsFalse() &&
@ -10541,10 +10472,10 @@ RUNTIME_FUNCTION(Runtime_ArrayConcat) {
Handle<FixedArrayBase> storage =
isolate->factory()->NewFixedDoubleArray(estimate_result_length);
int j = 0;
bool failure = false;
if (estimate_result_length > 0) {
Handle<FixedDoubleArray> double_storage =
Handle<FixedDoubleArray>::cast(storage);
bool failure = false;
for (int i = 0; i < argument_count; i++) {
Handle<Object> obj(elements->get(i), isolate);
if (obj->IsSmi()) {
@ -10565,6 +10496,11 @@ RUNTIME_FUNCTION(Runtime_ArrayConcat) {
FixedDoubleArray::cast(array->elements());
for (uint32_t i = 0; i < length; i++) {
if (elements->is_the_hole(i)) {
// TODO(jkummerow/verwaest): We could be a bit more clever
// here: Check if there are no elements/getters on the
// prototype chain, and if so, allow creation of a holey
// result array.
// Same thing below (holey smi case).
failure = true;
break;
}
@ -10591,6 +10527,7 @@ RUNTIME_FUNCTION(Runtime_ArrayConcat) {
break;
}
case FAST_HOLEY_ELEMENTS:
case FAST_ELEMENTS:
DCHECK_EQ(0, length);
break;
default:
@ -10600,14 +10537,17 @@ RUNTIME_FUNCTION(Runtime_ArrayConcat) {
if (failure) break;
}
}
Handle<JSArray> array = isolate->factory()->NewJSArray(0);
Smi* length = Smi::FromInt(j);
Handle<Map> map;
map = JSObject::GetElementsTransitionMap(array, kind);
array->set_map(*map);
array->set_length(length);
array->set_elements(*storage);
return *array;
if (!failure) {
Handle<JSArray> array = isolate->factory()->NewJSArray(0);
Smi* length = Smi::FromInt(j);
Handle<Map> map;
map = JSObject::GetElementsTransitionMap(array, kind);
array->set_map(*map);
array->set_length(length);
array->set_elements(*storage);
return *array;
}
// In case of failure, fall through.
}
Handle<FixedArray> storage;

1
deps/v8/src/runtime.h

@ -260,7 +260,6 @@ namespace internal {
F(CreateSymbol, 1, 1) \
F(CreatePrivateSymbol, 1, 1) \
F(CreateGlobalPrivateSymbol, 1, 1) \
F(CreatePrivateOwnSymbol, 1, 1) \
F(NewSymbolWrapper, 1, 1) \
F(SymbolDescription, 1, 1) \
F(SymbolRegistry, 0, 1) \

2
deps/v8/src/unique.h

@ -174,7 +174,7 @@ class PrintableUnique : public Unique<T> {
return PrintableUnique<T>(zone, reinterpret_cast<Address>(*handle), handle);
}
const char* string() const { return string_; }
const char* string() { return string_; }
private:
const char* string_;

4
deps/v8/src/v8natives.js

@ -1855,9 +1855,7 @@ function FunctionConstructor(arg1) { // length == 1
var global_proxy = %GlobalProxy(global);
// Compile the string in the constructor and not a helper so that errors
// appear to come from here.
var f = %CompileString(source, true);
if (!IS_FUNCTION(f)) return f;
f = %_CallFunction(global_proxy, f);
var f = %_CallFunction(global_proxy, %CompileString(source, true));
%FunctionMarkNameShouldPrintAsAnonymous(f);
return f;
}

4
deps/v8/src/version.cc

@ -34,8 +34,8 @@
// system so their names cannot be changed without changing the scripts.
#define MAJOR_VERSION 3
#define MINOR_VERSION 28
#define BUILD_NUMBER 73
#define PATCH_LEVEL 0
#define BUILD_NUMBER 71
#define PATCH_LEVEL 19
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define IS_CANDIDATE_VERSION 0

7
deps/v8/test/benchmarks/benchmarks.status

@ -25,11 +25,14 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[
[ALWAYS, {
# Too slow in Debug mode.
'octane/mandreel': [PASS, ['mode == debug', SKIP]],
# Too slow in Debug mode. TODO(mstarzinger): Too slow for TF.
'octane/mandreel': [PASS, NO_VARIANTS, ['mode == debug', SKIP]],
# TODO(mstarzinger,ishell): Timeout with TF in predictable mode.
'octane/richards': [PASS, NO_VARIANTS],
# TODO(mstarzinger): Out of mem with TF.
'octane/zlib': [PASS, NO_VARIANTS],
}], # ALWAYS
]

1
deps/v8/test/cctest/compiler/graph-builder-tester.cc

@ -31,7 +31,6 @@ void MachineCallHelper::InitParameters(GraphBuilder* builder,
byte* MachineCallHelper::Generate() {
DCHECK(parameter_count() == 0 || parameters_ != NULL);
if (!Pipeline::SupportedBackend()) return NULL;
if (code_.is_null()) {
Zone* zone = graph_->zone();
CompilationInfo info(zone->isolate(), zone);

17
deps/v8/test/cctest/compiler/test-representation-change.cc

@ -192,11 +192,18 @@ TEST(SingleChanges) {
TEST(SignednessInWord32) {
RepresentationChangerTester r;
// TODO(titzer): assume that uses of a word32 without a sign mean tInt32.
CheckChange(IrOpcode::kChangeTaggedToInt32, rTagged, rWord32 | tInt32);
CheckChange(IrOpcode::kChangeTaggedToUint32, rTagged, rWord32 | tUint32);
CheckChange(IrOpcode::kChangeInt32ToFloat64, rWord32, rFloat64);
CheckChange(IrOpcode::kChangeFloat64ToInt32, rFloat64, rWord32);
// TODO(titzer): these are currently type errors because the output type is
// not specified. Maybe the RepresentationChanger should assume anything to or
// from {rWord32} is {tInt32}, i.e. signed, if not it is explicitly otherwise?
r.CheckTypeError(rTagged, rWord32 | tInt32);
r.CheckTypeError(rTagged, rWord32 | tUint32);
r.CheckTypeError(rWord32, rFloat64);
r.CheckTypeError(rFloat64, rWord32);
// CheckChange(IrOpcode::kChangeTaggedToInt32, rTagged, rWord32 | tInt32);
// CheckChange(IrOpcode::kChangeTaggedToUint32, rTagged, rWord32 | tUint32);
// CheckChange(IrOpcode::kChangeInt32ToFloat64, rWord32, rFloat64);
// CheckChange(IrOpcode::kChangeFloat64ToInt32, rFloat64, rWord32);
}

20
deps/v8/test/cctest/compiler/test-simplified-lowering.cc

@ -114,9 +114,9 @@ TEST(RunLoadMap) {
t.Return(load);
t.LowerAllNodes();
t.GenerateCode();
if (Pipeline::SupportedTarget()) {
t.GenerateCode();
Handle<JSObject> src = TestObject();
Handle<Map> src_map(src->map());
Object* result = t.Call(*src); // TODO(titzer): raw pointers in call
@ -132,9 +132,9 @@ TEST(RunStoreMap) {
t.Return(t.jsgraph.TrueConstant());
t.LowerAllNodes();
t.GenerateCode();
if (Pipeline::SupportedTarget()) {
t.GenerateCode();
Handle<JSObject> src = TestObject();
Handle<Map> src_map(src->map());
Handle<JSObject> dst = TestObject();
@ -152,9 +152,9 @@ TEST(RunLoadProperties) {
t.Return(load);
t.LowerAllNodes();
t.GenerateCode();
if (Pipeline::SupportedTarget()) {
t.GenerateCode();
Handle<JSObject> src = TestObject();
Handle<FixedArray> src_props(src->properties());
Object* result = t.Call(*src); // TODO(titzer): raw pointers in call
@ -171,9 +171,9 @@ TEST(RunLoadStoreMap) {
t.Return(load);
t.LowerAllNodes();
t.GenerateCode();
if (Pipeline::SupportedTarget()) {
t.GenerateCode();
Handle<JSObject> src = TestObject();
Handle<Map> src_map(src->map());
Handle<JSObject> dst = TestObject();
@ -194,9 +194,9 @@ TEST(RunLoadStoreFixedArrayIndex) {
t.Return(load);
t.LowerAllNodes();
t.GenerateCode();
if (Pipeline::SupportedTarget()) {
t.GenerateCode();
Handle<FixedArray> array = t.factory()->NewFixedArray(2);
Handle<JSObject> src = TestObject();
Handle<JSObject> dst = TestObject();
@ -223,9 +223,9 @@ TEST(RunLoadStoreArrayBuffer) {
t.Return(t.jsgraph.TrueConstant());
t.LowerAllNodes();
t.GenerateCode();
if (Pipeline::SupportedTarget()) {
t.GenerateCode();
Handle<JSArrayBuffer> array = t.factory()->NewJSArrayBuffer();
const int array_length = 2 * index;
Runtime::SetupArrayBufferAllocatingData(t.isolate(), array, array_length);
@ -407,9 +407,9 @@ class AccessTester : public HandleAndZoneScope {
t.StoreElement(access, ptr, t.Int32Constant(to_index), load);
t.Return(t.jsgraph.TrueConstant());
t.LowerAllNodes();
t.GenerateCode();
if (Pipeline::SupportedTarget()) {
t.GenerateCode();
Object* result = t.Call();
CHECK_EQ(t.isolate()->heap()->true_value(), result);
}
@ -429,9 +429,9 @@ class AccessTester : public HandleAndZoneScope {
t.StoreField(to_access, ptr, load);
t.Return(t.jsgraph.TrueConstant());
t.LowerAllNodes();
t.GenerateCode();
if (Pipeline::SupportedTarget()) {
t.GenerateCode();
Object* result = t.Call();
CHECK_EQ(t.isolate()->heap()->true_value(), result);
}
@ -468,9 +468,9 @@ class AccessTester : public HandleAndZoneScope {
index = t.environment()->Pop();
t.Return(t.jsgraph.TrueConstant());
t.LowerAllNodes();
t.GenerateCode();
if (Pipeline::SupportedTarget()) {
t.GenerateCode();
Object* result = t.Call();
CHECK_EQ(t.isolate()->heap()->true_value(), result);
}
@ -707,7 +707,7 @@ class TestingGraph : public HandleAndZoneScope, public GraphAndBuilders {
Node* tb = graph()->NewNode(common()->IfTrue(), br);
Node* fb = graph()->NewNode(common()->IfFalse(), br);
Node* m = graph()->NewNode(common()->Merge(2), tb, fb);
NodeProperties::ReplaceControlInput(ret, m);
ret->ReplaceInput(NodeProperties::FirstControlIndex(ret), m);
return br;
}

26
deps/v8/test/cctest/test-api.cc

@ -22736,32 +22736,6 @@ TEST(ScriptNameAndLineNumber) {
}
Local<v8::Context> call_eval_context;
Local<v8::Function> call_eval_bound_function;
static void CallEval(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Context::Scope scope(call_eval_context);
args.GetReturnValue().Set(
call_eval_bound_function->Call(call_eval_context->Global(), 0, NULL));
}
TEST(CrossActivationEval) {
LocalContext env;
v8::Isolate* isolate = env->GetIsolate();
v8::HandleScope scope(isolate);
{
call_eval_context = v8::Context::New(isolate);
v8::Context::Scope scope(call_eval_context);
call_eval_bound_function =
Local<Function>::Cast(CompileRun("eval.bind(this, '1')"));
}
env->Global()->Set(v8_str("CallEval"),
v8::FunctionTemplate::New(isolate, CallEval)->GetFunction());
Local<Value> result = CompileRun("CallEval();");
CHECK_EQ(result, v8::Integer::New(isolate, 1));
}
void SourceURLHelper(const char* source, const char* expected_source_url,
const char* expected_source_mapping_url) {
Local<Script> script = v8_compile(source);

22
deps/v8/test/cctest/test-spaces.cc

@ -203,6 +203,28 @@ static void VerifyMemoryChunk(Isolate* isolate,
}
TEST(Regress3540) {
Isolate* isolate = CcTest::i_isolate();
isolate->InitializeLoggingAndCounters();
Heap* heap = isolate->heap();
CHECK(heap->ConfigureHeapDefault());
MemoryAllocator* memory_allocator = new MemoryAllocator(isolate);
CHECK(
memory_allocator->SetUp(heap->MaxReserved(), heap->MaxExecutableSize()));
TestMemoryAllocatorScope test_allocator_scope(isolate, memory_allocator);
CodeRange* code_range = new CodeRange(isolate);
const size_t code_range_size = 4 * MB;
if (!code_range->SetUp(code_range_size)) return;
size_t allocated_size;
Address result;
for (int i = 0; i < 5; i++) {
result = code_range->AllocateRawMemory(
code_range_size - MB, code_range_size - MB, &allocated_size);
CHECK((result != NULL) == (i == 0));
}
}
static unsigned int Pseudorandom() {
static uint32_t lo = 2345;
lo = 18273 * (lo & 0xFFFFF) + (lo >> 16);

3
deps/v8/test/compiler-unittests/DEPS

@ -1,6 +1,5 @@
include_rules = [
"+src",
"+testing/gtest",
"+testing/gtest-type-names.h",
"+testing/gmock",
"+testing/gtest",
]

2
deps/v8/test/compiler-unittests/arm/instruction-selector-arm-unittest.cc

@ -11,7 +11,7 @@ namespace compiler {
class InstructionSelectorARMTest : public InstructionSelectorTest {};
TARGET_TEST_F(InstructionSelectorARMTest, Int32AddP) {
COMPILER_TEST_F(InstructionSelectorARMTest, Int32AddP) {
StreamBuilder m(this, kMachineWord32, kMachineWord32, kMachineWord32);
m.Return(m.Int32Add(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build();

257
deps/v8/test/compiler-unittests/change-lowering-unittest.cc

@ -1,257 +0,0 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/change-lowering.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/graph.h"
#include "src/compiler/node-properties-inl.h"
#include "src/compiler/simplified-operator.h"
#include "src/factory.h"
#include "test/compiler-unittests/compiler-unittests.h"
#include "test/compiler-unittests/node-matchers.h"
#include "testing/gtest-type-names.h"
using testing::_;
namespace v8 {
namespace internal {
namespace compiler {
template <typename T>
class ChangeLoweringTest : public CompilerTest {
public:
static const size_t kPointerSize = sizeof(T);
explicit ChangeLoweringTest(int num_parameters = 1)
: graph_(zone()), common_(zone()), simplified_(zone()) {
graph()->SetStart(graph()->NewNode(common()->Start(num_parameters)));
}
virtual ~ChangeLoweringTest() {}
protected:
Node* Parameter(int32_t index = 0) {
return graph()->NewNode(common()->Parameter(index), graph()->start());
}
Reduction Reduce(Node* node) {
CompilationInfo info(isolate(), zone());
Linkage linkage(&info);
ChangeLowering<kPointerSize> reducer(graph(), &linkage);
return reducer.Reduce(node);
}
Graph* graph() { return &graph_; }
Factory* factory() const { return isolate()->factory(); }
CommonOperatorBuilder* common() { return &common_; }
SimplifiedOperatorBuilder* simplified() { return &simplified_; }
PrintableUnique<HeapObject> true_unique() {
return PrintableUnique<HeapObject>::CreateImmovable(
zone(), factory()->true_value());
}
PrintableUnique<HeapObject> false_unique() {
return PrintableUnique<HeapObject>::CreateImmovable(
zone(), factory()->false_value());
}
private:
Graph graph_;
CommonOperatorBuilder common_;
SimplifiedOperatorBuilder simplified_;
};
typedef ::testing::Types<int32_t, int64_t> ChangeLoweringTypes;
TYPED_TEST_CASE(ChangeLoweringTest, ChangeLoweringTypes);
TARGET_TYPED_TEST(ChangeLoweringTest, ChangeBitToBool) {
Node* val = this->Parameter(0);
Node* node =
this->graph()->NewNode(this->simplified()->ChangeBitToBool(), val);
Reduction reduction = this->Reduce(node);
ASSERT_TRUE(reduction.Changed());
Node* phi = reduction.replacement();
EXPECT_THAT(phi, IsPhi(IsHeapConstant(this->true_unique()),
IsHeapConstant(this->false_unique()), _));
Node* merge = NodeProperties::GetControlInput(phi);
ASSERT_EQ(IrOpcode::kMerge, merge->opcode());
Node* if_true = NodeProperties::GetControlInput(merge, 0);
ASSERT_EQ(IrOpcode::kIfTrue, if_true->opcode());
Node* if_false = NodeProperties::GetControlInput(merge, 1);
ASSERT_EQ(IrOpcode::kIfFalse, if_false->opcode());
Node* branch = NodeProperties::GetControlInput(if_true);
EXPECT_EQ(branch, NodeProperties::GetControlInput(if_false));
EXPECT_THAT(branch, IsBranch(val, this->graph()->start()));
}
TARGET_TYPED_TEST(ChangeLoweringTest, StringAdd) {
Node* node = this->graph()->NewNode(this->simplified()->StringAdd(),
this->Parameter(0), this->Parameter(1));
Reduction reduction = this->Reduce(node);
EXPECT_FALSE(reduction.Changed());
}
class ChangeLowering32Test : public ChangeLoweringTest<int32_t> {
public:
virtual ~ChangeLowering32Test() {}
};
TARGET_TEST_F(ChangeLowering32Test, ChangeBoolToBit) {
Node* val = Parameter(0);
Node* node = graph()->NewNode(simplified()->ChangeBoolToBit(), val);
Reduction reduction = Reduce(node);
ASSERT_TRUE(reduction.Changed());
EXPECT_THAT(reduction.replacement(),
IsWord32Equal(val, IsHeapConstant(true_unique())));
}
TARGET_TEST_F(ChangeLowering32Test, ChangeInt32ToTagged) {
Node* val = Parameter(0);
Node* node = graph()->NewNode(simplified()->ChangeInt32ToTagged(), val);
Reduction reduction = Reduce(node);
ASSERT_TRUE(reduction.Changed());
Node* phi = reduction.replacement();
ASSERT_EQ(IrOpcode::kPhi, phi->opcode());
Node* smi = NodeProperties::GetValueInput(phi, 1);
ASSERT_THAT(smi, IsProjection(0, IsInt32AddWithOverflow(val, val)));
Node* heap_number = NodeProperties::GetValueInput(phi, 0);
ASSERT_EQ(IrOpcode::kCall, heap_number->opcode());
Node* merge = NodeProperties::GetControlInput(phi);
ASSERT_EQ(IrOpcode::kMerge, merge->opcode());
const int32_t kValueOffset = HeapNumber::kValueOffset - kHeapObjectTag;
EXPECT_THAT(NodeProperties::GetControlInput(merge, 0),
IsStore(kMachineFloat64, kNoWriteBarrier, heap_number,
IsInt32Constant(kValueOffset),
IsChangeInt32ToFloat64(val), _, heap_number));
Node* if_true = NodeProperties::GetControlInput(heap_number);
ASSERT_EQ(IrOpcode::kIfTrue, if_true->opcode());
Node* if_false = NodeProperties::GetControlInput(merge, 1);
ASSERT_EQ(IrOpcode::kIfFalse, if_false->opcode());
Node* branch = NodeProperties::GetControlInput(if_true);
EXPECT_EQ(branch, NodeProperties::GetControlInput(if_false));
EXPECT_THAT(branch,
IsBranch(IsProjection(1, IsInt32AddWithOverflow(val, val)),
graph()->start()));
}
TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToFloat64) {
Node* val = Parameter(0);
Node* node = graph()->NewNode(simplified()->ChangeTaggedToFloat64(), val);
Reduction reduction = Reduce(node);
ASSERT_TRUE(reduction.Changed());
const int32_t kShiftAmount =
kSmiTagSize + SmiTagging<kPointerSize>::kSmiShiftSize;
const int32_t kValueOffset = HeapNumber::kValueOffset - kHeapObjectTag;
Node* phi = reduction.replacement();
ASSERT_THAT(
phi, IsPhi(IsLoad(kMachineFloat64, val, IsInt32Constant(kValueOffset), _),
IsChangeInt32ToFloat64(
IsWord32Sar(val, IsInt32Constant(kShiftAmount))),
_));
Node* merge = NodeProperties::GetControlInput(phi);
ASSERT_EQ(IrOpcode::kMerge, merge->opcode());
Node* if_true = NodeProperties::GetControlInput(merge, 0);
ASSERT_EQ(IrOpcode::kIfTrue, if_true->opcode());
Node* if_false = NodeProperties::GetControlInput(merge, 1);
ASSERT_EQ(IrOpcode::kIfFalse, if_false->opcode());
Node* branch = NodeProperties::GetControlInput(if_true);
EXPECT_EQ(branch, NodeProperties::GetControlInput(if_false));
STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagSize == 1);
EXPECT_THAT(branch, IsBranch(IsWord32And(val, IsInt32Constant(kSmiTagMask)),
graph()->start()));
}
class ChangeLowering64Test : public ChangeLoweringTest<int64_t> {
public:
virtual ~ChangeLowering64Test() {}
};
TARGET_TEST_F(ChangeLowering64Test, ChangeBoolToBit) {
Node* val = Parameter(0);
Node* node = graph()->NewNode(simplified()->ChangeBoolToBit(), val);
Reduction reduction = Reduce(node);
ASSERT_TRUE(reduction.Changed());
EXPECT_THAT(reduction.replacement(),
IsWord64Equal(val, IsHeapConstant(true_unique())));
}
TARGET_TEST_F(ChangeLowering64Test, ChangeInt32ToTagged) {
Node* val = Parameter(0);
Node* node = graph()->NewNode(simplified()->ChangeInt32ToTagged(), val);
Reduction reduction = Reduce(node);
ASSERT_TRUE(reduction.Changed());
const int32_t kShiftAmount =
kSmiTagSize + SmiTagging<kPointerSize>::kSmiShiftSize;
EXPECT_THAT(reduction.replacement(),
IsWord64Shl(val, IsInt32Constant(kShiftAmount)));
}
TARGET_TEST_F(ChangeLowering64Test, ChangeTaggedToFloat64) {
Node* val = Parameter(0);
Node* node = graph()->NewNode(simplified()->ChangeTaggedToFloat64(), val);
Reduction reduction = Reduce(node);
ASSERT_TRUE(reduction.Changed());
const int32_t kShiftAmount =
kSmiTagSize + SmiTagging<kPointerSize>::kSmiShiftSize;
const int32_t kValueOffset = HeapNumber::kValueOffset - kHeapObjectTag;
Node* phi = reduction.replacement();
ASSERT_THAT(
phi, IsPhi(IsLoad(kMachineFloat64, val, IsInt32Constant(kValueOffset), _),
IsChangeInt32ToFloat64(IsConvertInt64ToInt32(
IsWord64Sar(val, IsInt32Constant(kShiftAmount)))),
_));
Node* merge = NodeProperties::GetControlInput(phi);
ASSERT_EQ(IrOpcode::kMerge, merge->opcode());
Node* if_true = NodeProperties::GetControlInput(merge, 0);
ASSERT_EQ(IrOpcode::kIfTrue, if_true->opcode());
Node* if_false = NodeProperties::GetControlInput(merge, 1);
ASSERT_EQ(IrOpcode::kIfFalse, if_false->opcode());
Node* branch = NodeProperties::GetControlInput(if_true);
EXPECT_EQ(branch, NodeProperties::GetControlInput(if_false));
STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagSize == 1);
EXPECT_THAT(branch, IsBranch(IsWord64And(val, IsInt32Constant(kSmiTagMask)),
graph()->start()));
}
} // namespace compiler
} // namespace internal
} // namespace v8

3
deps/v8/test/compiler-unittests/compiler-unittests.gyp

@ -20,11 +20,8 @@
'../..',
],
'sources': [ ### gcmole(all) ###
'change-lowering-unittest.cc',
'compiler-unittests.cc',
'instruction-selector-unittest.cc',
'node-matchers.cc',
'node-matchers.h',
],
'conditions': [
['v8_target_arch=="arm"', {

23
deps/v8/test/compiler-unittests/compiler-unittests.h

@ -13,33 +13,23 @@ namespace v8 {
namespace internal {
namespace compiler {
// The TARGET_TEST(Case, Name) macro works just like
// The COMPILER_TEST(Case, Name) macro works just like
// TEST(Case, Name), except that the test is disabled
// if the platform is not a supported TurboFan target.
#if V8_TURBOFAN_TARGET
#define TARGET_TEST(Case, Name) TEST(Case, Name)
#define COMPILER_TEST(Case, Name) TEST(Case, Name)
#else
#define TARGET_TEST(Case, Name) TEST(Case, DISABLED_##Name)
#define COMPILER_TEST(Case, Name) TEST(Case, DISABLED_##Name)
#endif
// The TARGET_TEST_F(Case, Name) macro works just like
// The COMPILER_TEST_F(Case, Name) macro works just like
// TEST_F(Case, Name), except that the test is disabled
// if the platform is not a supported TurboFan target.
#if V8_TURBOFAN_TARGET
#define TARGET_TEST_F(Case, Name) TEST_F(Case, Name)
#define COMPILER_TEST_F(Case, Name) TEST_F(Case, Name)
#else
#define TARGET_TEST_F(Case, Name) TEST_F(Case, DISABLED_##Name)
#endif
// The TARGET_TYPED_TEST(Case, Name) macro works just like
// TYPED_TEST(Case, Name), except that the test is disabled
// if the platform is not a supported TurboFan target.
#if V8_TURBOFAN_TARGET
#define TARGET_TYPED_TEST(Case, Name) TYPED_TEST(Case, Name)
#else
#define TARGET_TYPED_TEST(Case, Name) TYPED_TEST(Case, DISABLED_##Name)
#define COMPILER_TEST_F(Case, Name) TEST_F(Case, DISABLED_##Name)
#endif
@ -51,6 +41,7 @@ class CompilerTest : public ::testing::Test {
Isolate* isolate() const { return reinterpret_cast<Isolate*>(isolate_); }
Zone* zone() { return &zone_; }
protected:
static void SetUpTestCase();
static void TearDownTestCase();

4
deps/v8/test/compiler-unittests/instruction-selector-unittest.cc

@ -62,7 +62,7 @@ InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build(
}
TARGET_TEST_F(InstructionSelectorTest, ReturnP) {
COMPILER_TEST_F(InstructionSelectorTest, ReturnP) {
StreamBuilder m(this, kMachineWord32, kMachineWord32);
m.Return(m.Parameter(0));
Stream s = m.Build(kAllInstructions);
@ -74,7 +74,7 @@ TARGET_TEST_F(InstructionSelectorTest, ReturnP) {
}
TARGET_TEST_F(InstructionSelectorTest, ReturnImm) {
COMPILER_TEST_F(InstructionSelectorTest, ReturnImm) {
StreamBuilder m(this, kMachineWord32);
m.Return(m.Int32Constant(0));
Stream s = m.Build(kAllInstructions);

454
deps/v8/test/compiler-unittests/node-matchers.cc

@ -1,454 +0,0 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "test/compiler-unittests/node-matchers.h"
#include <ostream> // NOLINT(readability/streams)
#include "src/compiler/node-properties-inl.h"
using testing::MakeMatcher;
using testing::MatcherInterface;
using testing::MatchResultListener;
using testing::StringMatchResultListener;
namespace v8 {
namespace internal {
// TODO(bmeurer): Find a new home for these functions.
template <typename T>
inline std::ostream& operator<<(std::ostream& os,
const PrintableUnique<T>& value) {
return os << value.string();
}
namespace compiler {
namespace {
template <typename T>
bool PrintMatchAndExplain(const T& value, const char* value_name,
const Matcher<T>& value_matcher,
MatchResultListener* listener) {
StringMatchResultListener value_listener;
if (!value_matcher.MatchAndExplain(value, &value_listener)) {
*listener << "whose " << value_name << " " << value << " doesn't match";
if (value_listener.str() != "") {
*listener << ", " << value_listener.str();
}
return false;
}
return true;
}
class NodeMatcher : public MatcherInterface<Node*> {
public:
explicit NodeMatcher(IrOpcode::Value opcode) : opcode_(opcode) {}
virtual void DescribeTo(std::ostream* os) const V8_OVERRIDE {
*os << "is a " << IrOpcode::Mnemonic(opcode_) << " node";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
V8_OVERRIDE {
if (node == NULL) {
*listener << "which is NULL";
return false;
}
if (node->opcode() != opcode_) {
*listener << "whose opcode is " << IrOpcode::Mnemonic(node->opcode());
return false;
}
return true;
}
private:
const IrOpcode::Value opcode_;
};
class IsBranchMatcher V8_FINAL : public NodeMatcher {
public:
IsBranchMatcher(const Matcher<Node*>& value_matcher,
const Matcher<Node*>& control_matcher)
: NodeMatcher(IrOpcode::kBranch),
value_matcher_(value_matcher),
control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const V8_OVERRIDE {
NodeMatcher::DescribeTo(os);
*os << " whose value (";
value_matcher_.DescribeTo(os);
*os << ") and control (";
control_matcher_.DescribeTo(os);
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
V8_OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
"value", value_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetControlInput(node),
"control", control_matcher_, listener));
}
private:
const Matcher<Node*> value_matcher_;
const Matcher<Node*> control_matcher_;
};
template <typename T>
class IsConstantMatcher V8_FINAL : public NodeMatcher {
public:
IsConstantMatcher(IrOpcode::Value opcode, const Matcher<T>& value_matcher)
: NodeMatcher(opcode), value_matcher_(value_matcher) {}
virtual void DescribeTo(std::ostream* os) const V8_OVERRIDE {
NodeMatcher::DescribeTo(os);
*os << " whose value (";
value_matcher_.DescribeTo(os);
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
V8_OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<T>(node), "value", value_matcher_,
listener));
}
private:
const Matcher<T> value_matcher_;
};
class IsPhiMatcher V8_FINAL : public NodeMatcher {
public:
IsPhiMatcher(const Matcher<Node*>& value0_matcher,
const Matcher<Node*>& value1_matcher,
const Matcher<Node*>& control_matcher)
: NodeMatcher(IrOpcode::kPhi),
value0_matcher_(value0_matcher),
value1_matcher_(value1_matcher),
control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const V8_OVERRIDE {
NodeMatcher::DescribeTo(os);
*os << " whose value0 (";
value0_matcher_.DescribeTo(os);
*os << "), value1 (";
value1_matcher_.DescribeTo(os);
*os << ") and control (";
control_matcher_.DescribeTo(os);
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
V8_OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
"value0", value0_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1),
"value1", value1_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetControlInput(node),
"control", control_matcher_, listener));
}
private:
const Matcher<Node*> value0_matcher_;
const Matcher<Node*> value1_matcher_;
const Matcher<Node*> control_matcher_;
};
class IsProjectionMatcher V8_FINAL : public NodeMatcher {
public:
IsProjectionMatcher(const Matcher<int32_t>& index_matcher,
const Matcher<Node*>& base_matcher)
: NodeMatcher(IrOpcode::kProjection),
index_matcher_(index_matcher),
base_matcher_(base_matcher) {}
virtual void DescribeTo(std::ostream* os) const V8_OVERRIDE {
NodeMatcher::DescribeTo(os);
*os << " whose index (";
index_matcher_.DescribeTo(os);
*os << ") and base (";
base_matcher_.DescribeTo(os);
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
V8_OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<int32_t>(node), "index",
index_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "base",
base_matcher_, listener));
}
private:
const Matcher<int32_t> index_matcher_;
const Matcher<Node*> base_matcher_;
};
class IsLoadMatcher V8_FINAL : public NodeMatcher {
public:
IsLoadMatcher(const Matcher<MachineType>& type_matcher,
const Matcher<Node*>& base_matcher,
const Matcher<Node*>& index_matcher,
const Matcher<Node*>& effect_matcher)
: NodeMatcher(IrOpcode::kLoad),
type_matcher_(type_matcher),
base_matcher_(base_matcher),
index_matcher_(index_matcher),
effect_matcher_(effect_matcher) {}
virtual void DescribeTo(std::ostream* os) const V8_OVERRIDE {
NodeMatcher::DescribeTo(os);
*os << " whose type (";
type_matcher_.DescribeTo(os);
*os << "), base (";
base_matcher_.DescribeTo(os);
*os << "), index (";
index_matcher_.DescribeTo(os);
*os << ") and effect (";
effect_matcher_.DescribeTo(os);
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
V8_OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<MachineType>(node), "type",
type_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "base",
base_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1),
"index", index_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
effect_matcher_, listener));
}
private:
const Matcher<MachineType> type_matcher_;
const Matcher<Node*> base_matcher_;
const Matcher<Node*> index_matcher_;
const Matcher<Node*> effect_matcher_;
};
class IsStoreMatcher V8_FINAL : public NodeMatcher {
public:
IsStoreMatcher(const Matcher<MachineType>& type_matcher,
const Matcher<WriteBarrierKind> write_barrier_matcher,
const Matcher<Node*>& base_matcher,
const Matcher<Node*>& index_matcher,
const Matcher<Node*>& value_matcher,
const Matcher<Node*>& effect_matcher,
const Matcher<Node*>& control_matcher)
: NodeMatcher(IrOpcode::kStore),
type_matcher_(type_matcher),
write_barrier_matcher_(write_barrier_matcher),
base_matcher_(base_matcher),
index_matcher_(index_matcher),
value_matcher_(value_matcher),
effect_matcher_(effect_matcher),
control_matcher_(control_matcher) {}
virtual void DescribeTo(std::ostream* os) const V8_OVERRIDE {
NodeMatcher::DescribeTo(os);
*os << " whose type (";
type_matcher_.DescribeTo(os);
*os << "), write barrier (";
write_barrier_matcher_.DescribeTo(os);
*os << "), base (";
base_matcher_.DescribeTo(os);
*os << "), index (";
index_matcher_.DescribeTo(os);
*os << "), value (";
value_matcher_.DescribeTo(os);
*os << "), effect (";
effect_matcher_.DescribeTo(os);
*os << ") and control (";
control_matcher_.DescribeTo(os);
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
V8_OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(OpParameter<StoreRepresentation>(node).rep,
"type", type_matcher_, listener) &&
PrintMatchAndExplain(
OpParameter<StoreRepresentation>(node).write_barrier_kind,
"write barrier", write_barrier_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "base",
base_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1),
"index", index_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 2),
"value", value_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetEffectInput(node), "effect",
effect_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetControlInput(node),
"control", control_matcher_, listener));
}
private:
const Matcher<MachineType> type_matcher_;
const Matcher<WriteBarrierKind> write_barrier_matcher_;
const Matcher<Node*> base_matcher_;
const Matcher<Node*> index_matcher_;
const Matcher<Node*> value_matcher_;
const Matcher<Node*> effect_matcher_;
const Matcher<Node*> control_matcher_;
};
class IsBinopMatcher V8_FINAL : public NodeMatcher {
public:
IsBinopMatcher(IrOpcode::Value opcode, const Matcher<Node*>& lhs_matcher,
const Matcher<Node*>& rhs_matcher)
: NodeMatcher(opcode),
lhs_matcher_(lhs_matcher),
rhs_matcher_(rhs_matcher) {}
virtual void DescribeTo(std::ostream* os) const V8_OVERRIDE {
NodeMatcher::DescribeTo(os);
*os << " whose lhs (";
lhs_matcher_.DescribeTo(os);
*os << ") and rhs (";
rhs_matcher_.DescribeTo(os);
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
V8_OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0), "lhs",
lhs_matcher_, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 1), "rhs",
rhs_matcher_, listener));
}
private:
const Matcher<Node*> lhs_matcher_;
const Matcher<Node*> rhs_matcher_;
};
class IsUnopMatcher V8_FINAL : public NodeMatcher {
public:
IsUnopMatcher(IrOpcode::Value opcode, const Matcher<Node*>& input_matcher)
: NodeMatcher(opcode), input_matcher_(input_matcher) {}
virtual void DescribeTo(std::ostream* os) const V8_OVERRIDE {
NodeMatcher::DescribeTo(os);
*os << " whose input (";
input_matcher_.DescribeTo(os);
*os << ")";
}
virtual bool MatchAndExplain(Node* node, MatchResultListener* listener) const
V8_OVERRIDE {
return (NodeMatcher::MatchAndExplain(node, listener) &&
PrintMatchAndExplain(NodeProperties::GetValueInput(node, 0),
"input", input_matcher_, listener));
}
private:
const Matcher<Node*> input_matcher_;
};
}
Matcher<Node*> IsBranch(const Matcher<Node*>& value_matcher,
const Matcher<Node*>& control_matcher) {
return MakeMatcher(new IsBranchMatcher(value_matcher, control_matcher));
}
Matcher<Node*> IsInt32Constant(const Matcher<int32_t>& value_matcher) {
return MakeMatcher(
new IsConstantMatcher<int32_t>(IrOpcode::kInt32Constant, value_matcher));
}
Matcher<Node*> IsHeapConstant(
const Matcher<PrintableUnique<HeapObject> >& value_matcher) {
return MakeMatcher(new IsConstantMatcher<PrintableUnique<HeapObject> >(
IrOpcode::kHeapConstant, value_matcher));
}
Matcher<Node*> IsPhi(const Matcher<Node*>& value0_matcher,
const Matcher<Node*>& value1_matcher,
const Matcher<Node*>& merge_matcher) {
return MakeMatcher(
new IsPhiMatcher(value0_matcher, value1_matcher, merge_matcher));
}
Matcher<Node*> IsProjection(const Matcher<int32_t>& index_matcher,
const Matcher<Node*>& base_matcher) {
return MakeMatcher(new IsProjectionMatcher(index_matcher, base_matcher));
}
Matcher<Node*> IsLoad(const Matcher<MachineType>& type_matcher,
const Matcher<Node*>& base_matcher,
const Matcher<Node*>& index_matcher,
const Matcher<Node*>& effect_matcher) {
return MakeMatcher(new IsLoadMatcher(type_matcher, base_matcher,
index_matcher, effect_matcher));
}
Matcher<Node*> IsStore(const Matcher<MachineType>& type_matcher,
const Matcher<WriteBarrierKind>& write_barrier_matcher,
const Matcher<Node*>& base_matcher,
const Matcher<Node*>& index_matcher,
const Matcher<Node*>& value_matcher,
const Matcher<Node*>& effect_matcher,
const Matcher<Node*>& control_matcher) {
return MakeMatcher(new IsStoreMatcher(
type_matcher, write_barrier_matcher, base_matcher, index_matcher,
value_matcher, effect_matcher, control_matcher));
}
#define IS_BINOP_MATCHER(Name) \
Matcher<Node*> Is##Name(const Matcher<Node*>& lhs_matcher, \
const Matcher<Node*>& rhs_matcher) { \
return MakeMatcher( \
new IsBinopMatcher(IrOpcode::k##Name, lhs_matcher, rhs_matcher)); \
}
IS_BINOP_MATCHER(Word32And)
IS_BINOP_MATCHER(Word32Sar)
IS_BINOP_MATCHER(Word32Equal)
IS_BINOP_MATCHER(Word64And)
IS_BINOP_MATCHER(Word64Sar)
IS_BINOP_MATCHER(Word64Shl)
IS_BINOP_MATCHER(Word64Equal)
IS_BINOP_MATCHER(Int32AddWithOverflow)
#undef IS_BINOP_MATCHER
#define IS_UNOP_MATCHER(Name) \
Matcher<Node*> Is##Name(const Matcher<Node*>& input_matcher) { \
return MakeMatcher(new IsUnopMatcher(IrOpcode::k##Name, input_matcher)); \
}
IS_UNOP_MATCHER(ConvertInt64ToInt32)
IS_UNOP_MATCHER(ChangeInt32ToFloat64)
#undef IS_UNOP_MATCHER
} // namespace compiler
} // namespace internal
} // namespace v8

71
deps/v8/test/compiler-unittests/node-matchers.h

@ -1,71 +0,0 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_UNITTESTS_NODE_MATCHERS_H_
#define V8_COMPILER_UNITTESTS_NODE_MATCHERS_H_
#include "src/compiler/machine-operator.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace v8 {
namespace internal {
// Forward declarations.
class HeapObject;
template <class T>
class PrintableUnique;
namespace compiler {
// Forward declarations.
class Node;
using testing::Matcher;
Matcher<Node*> IsBranch(const Matcher<Node*>& value_matcher,
const Matcher<Node*>& control_matcher);
Matcher<Node*> IsHeapConstant(
const Matcher<PrintableUnique<HeapObject> >& value_matcher);
Matcher<Node*> IsInt32Constant(const Matcher<int32_t>& value_matcher);
Matcher<Node*> IsPhi(const Matcher<Node*>& value0_matcher,
const Matcher<Node*>& value1_matcher,
const Matcher<Node*>& merge_matcher);
Matcher<Node*> IsProjection(const Matcher<int32_t>& index_matcher,
const Matcher<Node*>& base_matcher);
Matcher<Node*> IsLoad(const Matcher<MachineType>& type_matcher,
const Matcher<Node*>& base_matcher,
const Matcher<Node*>& index_matcher,
const Matcher<Node*>& effect_matcher);
Matcher<Node*> IsStore(const Matcher<MachineType>& type_matcher,
const Matcher<WriteBarrierKind>& write_barrier_matcher,
const Matcher<Node*>& base_matcher,
const Matcher<Node*>& index_matcher,
const Matcher<Node*>& value_matcher,
const Matcher<Node*>& effect_matcher,
const Matcher<Node*>& control_matcher);
Matcher<Node*> IsWord32And(const Matcher<Node*>& lhs_matcher,
const Matcher<Node*>& rhs_matcher);
Matcher<Node*> IsWord32Sar(const Matcher<Node*>& lhs_matcher,
const Matcher<Node*>& rhs_matcher);
Matcher<Node*> IsWord32Equal(const Matcher<Node*>& lhs_matcher,
const Matcher<Node*>& rhs_matcher);
Matcher<Node*> IsWord64And(const Matcher<Node*>& lhs_matcher,
const Matcher<Node*>& rhs_matcher);
Matcher<Node*> IsWord64Shl(const Matcher<Node*>& lhs_matcher,
const Matcher<Node*>& rhs_matcher);
Matcher<Node*> IsWord64Sar(const Matcher<Node*>& lhs_matcher,
const Matcher<Node*>& rhs_matcher);
Matcher<Node*> IsWord64Equal(const Matcher<Node*>& lhs_matcher,
const Matcher<Node*>& rhs_matcher);
Matcher<Node*> IsInt32AddWithOverflow(const Matcher<Node*>& lhs_matcher,
const Matcher<Node*>& rhs_matcher);
Matcher<Node*> IsConvertInt64ToInt32(const Matcher<Node*>& input_matcher);
Matcher<Node*> IsChangeInt32ToFloat64(const Matcher<Node*>& input_matcher);
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_UNITTESTS_NODE_MATCHERS_H_

69
deps/v8/test/mjsunit/cross-realm-filtering.js

@ -70,72 +70,3 @@ assertSame(Realm.shared.caller_1, Realm.shared.result_1);
Realm.eval(realms[0], script);
assertSame(Realm.shared.caller_0, Realm.shared.result_0);
assertSame(null, Realm.shared.result_1);
// Check function constructor.
var ctor_script = "Function.constructor";
var ctor_a_script =
"(function() { return Function.constructor.apply(this, ['return 1;']); })";
var ctor_b_script = "Function.constructor.bind(this, 'return 1;')";
var ctor_c_script =
"(function() { return Function.constructor.call(this, 'return 1;'); })";
Realm.shared = {
ctor_0 : Realm.eval(realms[0], ctor_script),
ctor_1 : Realm.eval(realms[1], ctor_script),
ctor_a_0 : Realm.eval(realms[0], ctor_a_script),
ctor_a_1 : Realm.eval(realms[1], ctor_a_script),
ctor_b_0 : Realm.eval(realms[0], ctor_b_script),
ctor_b_1 : Realm.eval(realms[1], ctor_b_script),
ctor_c_0 : Realm.eval(realms[0], ctor_c_script),
ctor_c_1 : Realm.eval(realms[1], ctor_c_script),
}
var script_0 = " \
var ctor_0 = Realm.shared.ctor_0; \
Realm.shared.direct_0 = ctor_0('return 1'); \
Realm.shared.indirect_0 = (function() { return ctor_0('return 1;'); })(); \
Realm.shared.apply_0 = ctor_0.apply(this, ['return 1']); \
Realm.shared.bind_0 = ctor_0.bind(this, 'return 1')(); \
Realm.shared.call_0 = ctor_0.call(this, 'return 1'); \
Realm.shared.a_0 = Realm.shared.ctor_a_0(); \
Realm.shared.b_0 = Realm.shared.ctor_b_0(); \
Realm.shared.c_0 = Realm.shared.ctor_c_0(); \
";
script = script_0 + script_0.replace(/_0/g, "_1");
Realm.eval(realms[0], script);
assertSame(1, Realm.shared.direct_0());
assertSame(1, Realm.shared.indirect_0());
assertSame(1, Realm.shared.apply_0());
assertSame(1, Realm.shared.bind_0());
assertSame(1, Realm.shared.call_0());
assertSame(1, Realm.shared.a_0());
assertSame(1, Realm.shared.b_0());
assertSame(1, Realm.shared.c_0());
assertSame(undefined, Realm.shared.direct_1);
assertSame(undefined, Realm.shared.indirect_1);
assertSame(undefined, Realm.shared.apply_1);
assertSame(undefined, Realm.shared.bind_1);
assertSame(undefined, Realm.shared.call_1);
assertSame(1, Realm.shared.a_1());
assertSame(undefined, Realm.shared.b_1);
assertSame(1, Realm.shared.c_1());
Realm.eval(realms[1], script);
assertSame(undefined, Realm.shared.direct_0);
assertSame(undefined, Realm.shared.indirect_0);
assertSame(undefined, Realm.shared.apply_0);
assertSame(undefined, Realm.shared.bind_0);
assertSame(undefined, Realm.shared.call_0);
assertSame(1, Realm.shared.a_0());
assertSame(undefined, Realm.shared.b_0);
assertSame(1, Realm.shared.c_1());
assertSame(1, Realm.shared.direct_1());
assertSame(1, Realm.shared.indirect_1());
assertSame(1, Realm.shared.apply_1());
assertSame(1, Realm.shared.bind_1());
assertSame(1, Realm.shared.call_1());
assertSame(1, Realm.shared.a_1());
assertSame(1, Realm.shared.b_1());
assertSame(1, Realm.shared.c_1());

17
deps/v8/test/mjsunit/es6/array-iterator.js

@ -45,11 +45,8 @@ function assertHasOwnProperty(object, name, attrs) {
function TestArrayPrototype() {
assertHasOwnProperty(Array.prototype, 'entries', DONT_ENUM);
assertHasOwnProperty(Array.prototype, 'values', DONT_ENUM);
assertHasOwnProperty(Array.prototype, 'keys', DONT_ENUM);
assertHasOwnProperty(Array.prototype, Symbol.iterator, DONT_ENUM);
assertEquals(Array.prototype.values, Array.prototype[Symbol.iterator]);
}
TestArrayPrototype();
@ -61,7 +58,7 @@ function assertIteratorResult(value, done, result) {
function TestValues() {
var array = ['a', 'b', 'c'];
var iterator = array.values();
var iterator = array[Symbol.iterator]();
assertIteratorResult('a', false, iterator.next());
assertIteratorResult('b', false, iterator.next());
assertIteratorResult('c', false, iterator.next());
@ -75,7 +72,7 @@ TestValues();
function TestValuesMutate() {
var array = ['a', 'b', 'c'];
var iterator = array.values();
var iterator = array[Symbol.iterator]();
assertIteratorResult('a', false, iterator.next());
assertIteratorResult('b', false, iterator.next());
assertIteratorResult('c', false, iterator.next());
@ -142,17 +139,17 @@ TestEntriesMutate();
function TestArrayIteratorPrototype() {
var array = [];
var iterator = array.values();
var iterator = array.keys();
var ArrayIteratorPrototype = iterator.__proto__;
assertEquals(ArrayIteratorPrototype, array.values().__proto__);
assertEquals(ArrayIteratorPrototype, array[Symbol.iterator]().__proto__);
assertEquals(ArrayIteratorPrototype, array.keys().__proto__);
assertEquals(ArrayIteratorPrototype, array.entries().__proto__);
assertEquals(Object.prototype, ArrayIteratorPrototype.__proto__);
assertEquals('Array Iterator', %_ClassOf(array.values()));
assertEquals('Array Iterator', %_ClassOf(array[Symbol.iterator]()));
assertEquals('Array Iterator', %_ClassOf(array.keys()));
assertEquals('Array Iterator', %_ClassOf(array.entries()));
@ -169,7 +166,7 @@ function TestForArrayValues() {
var buffer = [];
var array = [0, 'a', true, false, null, /* hole */, undefined, NaN];
var i = 0;
for (var value of array.values()) {
for (var value of array[Symbol.iterator]()) {
buffer[i++] = value;
}
@ -242,7 +239,7 @@ TestForArrayValues();
function TestNonOwnSlots() {
var array = [0];
var iterator = array.values();
var iterator = array[Symbol.iterator]();
var object = {__proto__: iterator};
assertThrows(function() {

45
deps/v8/test/mjsunit/es6/math-log1p.js

@ -6,16 +6,16 @@ assertTrue(isNaN(Math.log1p(NaN)));
assertTrue(isNaN(Math.log1p(function() {})));
assertTrue(isNaN(Math.log1p({ toString: function() { return NaN; } })));
assertTrue(isNaN(Math.log1p({ valueOf: function() { return "abc"; } })));
assertEquals(Infinity, 1/Math.log1p(0));
assertEquals(-Infinity, 1/Math.log1p(-0));
assertEquals(Infinity, Math.log1p(Infinity));
assertEquals(-Infinity, Math.log1p(-1));
assertEquals("Infinity", String(1/Math.log1p(0)));
assertEquals("-Infinity", String(1/Math.log1p(-0)));
assertEquals("Infinity", String(Math.log1p(Infinity)));
assertEquals("-Infinity", String(Math.log1p(-1)));
assertTrue(isNaN(Math.log1p(-2)));
assertTrue(isNaN(Math.log1p(-Infinity)));
for (var x = 1E300; x > 1E16; x *= 0.8) {
for (var x = 1E300; x > 1E-1; x *= 0.8) {
var expected = Math.log(x + 1);
assertEqualsDelta(expected, Math.log1p(x), expected * 1E-16);
assertEqualsDelta(expected, Math.log1p(x), expected * 1E-14);
}
// Values close to 0:
@ -35,36 +35,5 @@ function log1p(x) {
for (var x = 1E-1; x > 1E-300; x *= 0.8) {
var expected = log1p(x);
assertEqualsDelta(expected, Math.log1p(x), expected * 1E-16);
assertEqualsDelta(expected, Math.log1p(x), expected * 1E-14);
}
// Issue 3481.
assertEquals(6.9756137364252422e-03,
Math.log1p(8070450532247929/Math.pow(2,60)));
// Tests related to the fdlibm implementation.
// Test largest double value.
assertEquals(709.782712893384, Math.log1p(1.7976931348623157e308));
// Test small values.
assertEquals(Math.pow(2, -55), Math.log1p(Math.pow(2, -55)));
assertEquals(9.313225741817976e-10, Math.log1p(Math.pow(2, -30)));
// Cover various code paths.
// -.2929 < x < .41422, k = 0
assertEquals(-0.2876820724517809, Math.log1p(-0.25));
assertEquals(0.22314355131420976, Math.log1p(0.25));
// 0.41422 < x < 9.007e15
assertEquals(2.3978952727983707, Math.log1p(10));
// x > 9.007e15
assertEquals(36.841361487904734, Math.log1p(10e15));
// Normalize u.
assertEquals(37.08337388996168, Math.log1p(12738099905822720));
// Normalize u/2.
assertEquals(37.08336444902049, Math.log1p(12737979646738432));
// |f| = 0, k != 0
assertEquals(1.3862943611198906, Math.log1p(3));
// |f| != 0, k != 0
assertEquals(1.3862945995384413, Math.log1p(3 + Math.pow(2,-20)));
// final if-clause: k = 0
assertEquals(0.5596157879354227, Math.log1p(0.75));
// final if-clause: k != 0
assertEquals(0.8109302162163288, Math.log1p(1.25));

4
deps/v8/test/mjsunit/es6/typed-array-iterator.js

@ -21,9 +21,9 @@ function TestTypedArrayPrototype(constructor) {
assertFalse(constructor.prototype.propertyIsEnumerable(Symbol.iterator));
assertEquals(Array.prototype.entries, constructor.prototype.entries);
assertEquals(Array.prototype.values, constructor.prototype.values);
assertEquals(Array.prototype[Symbol.iterator], constructor.prototype.values);
assertEquals(Array.prototype.keys, constructor.prototype.keys);
assertEquals(Array.prototype.values, constructor.prototype[Symbol.iterator]);
assertEquals(Array.prototype[Symbol.iterator], constructor.prototype[Symbol.iterator]);
}
constructors.forEach(TestTypedArrayPrototype);

5
deps/v8/test/mjsunit/mjsunit.status

@ -299,9 +299,6 @@
##############################################################################
['arch == arm64 or arch == android_arm64', {
# arm64 TF timeout.
'regress/regress-1257': [PASS, TIMEOUT],
# Requires bigger stack size in the Genesis and if stack size is increased,
# the test requires too much time to run. However, the problem test covers
# should be platform-independent.
@ -348,7 +345,7 @@
'bit-not': [PASS, SLOW],
'compiler/alloc-number': [PASS, SLOW],
'compiler/osr-assert': [PASS, SLOW],
'compiler/osr-warm': [PASS, TIMEOUT, SLOW],
'compiler/osr-warm': [PASS, SLOW],
'compiler/osr-with-args': [PASS, SLOW],
'debug-scopes': [PASS, SLOW],
'generated-transition-stub': [PASS, SLOW],

55
deps/v8/test/mjsunit/own-symbols.js

@ -1,55 +0,0 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --allow-natives-syntax
var s = %CreatePrivateOwnSymbol("s");
var s1 = %CreatePrivateOwnSymbol("s1");
function TestSimple() {
var p = {}
p[s] = "moo";
var o = Object.create(p);
assertEquals(undefined, o[s]);
assertEquals("moo", p[s]);
o[s] = "bow-wow";
assertEquals("bow-wow", o[s]);
assertEquals("moo", p[s]);
}
TestSimple();
function TestICs() {
var p = {}
p[s] = "moo";
var o = Object.create(p);
o[s1] = "bow-wow";
function checkNonOwn(o) {
assertEquals(undefined, o[s]);
assertEquals("bow-wow", o[s1]);
}
checkNonOwn(o);
// Test monomorphic/optimized.
for (var i = 0; i < 1000; i++) {
checkNonOwn(o);
}
// Test non-monomorphic.
for (var i = 0; i < 1000; i++) {
var oNew = Object.create(p);
oNew["s" + i] = i;
oNew[s1] = "bow-wow";
checkNonOwn(oNew);
}
}
TestICs();

314
deps/v8/test/mjsunit/regress/regress-3116.js

@ -0,0 +1,314 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function timezone(tz) {
var str = (new Date(2014, 0, 10)).toString();
if (tz == "CET") {
return str == "Fri Jan 10 2014 00:00:00 GMT+0100 (CET)";
}
if (tz == "BRT") {
return str == "Fri Jan 10 2014 00:00:00 GMT-0200 (BRST)";
}
if (tz == "PST") {
return str == "Fri Jan 10 2014 00:00:00 GMT-0800 (PST)";
}
return false;
}
if (timezone("CET")) {
assertEquals("Sat Mar 29 2014 22:59:00 GMT+0100 (CET)",
(new Date(2014, 2, 29, 22, 59)).toString());
assertEquals("Sat, 29 Mar 2014 21:59:00 GMT",
(new Date(2014, 2, 29, 22, 59)).toUTCString());
assertEquals("Sat Mar 29 2014 23:00:00 GMT+0100 (CET)",
(new Date(2014, 2, 29, 23, 0)).toString());
assertEquals("Sat, 29 Mar 2014 22:00:00 GMT",
(new Date(2014, 2, 29, 23, 0)).toUTCString());
assertEquals("Sat Mar 29 2014 23:59:00 GMT+0100 (CET)",
(new Date(2014, 2, 29, 23, 59)).toString());
assertEquals("Sat, 29 Mar 2014 22:59:00 GMT",
(new Date(2014, 2, 29, 23, 59)).toUTCString());
assertEquals("Sun Mar 30 2014 00:00:00 GMT+0100 (CET)",
(new Date(2014, 2, 30, 0, 0)).toString());
assertEquals("Sat, 29 Mar 2014 23:00:00 GMT",
(new Date(2014, 2, 30, 0, 0)).toUTCString());
assertEquals("Sun Mar 30 2014 00:59:00 GMT+0100 (CET)",
(new Date(2014, 2, 30, 0, 59)).toString());
assertEquals("Sat, 29 Mar 2014 23:59:00 GMT",
(new Date(2014, 2, 30, 0, 59)).toUTCString());
assertEquals("Sun Mar 30 2014 01:00:00 GMT+0100 (CET)",
(new Date(2014, 2, 30, 1, 0)).toString());
assertEquals("Sun, 30 Mar 2014 00:00:00 GMT",
(new Date(2014, 2, 30, 1, 0)).toUTCString());
assertEquals("Sun Mar 30 2014 01:59:00 GMT+0100 (CET)",
(new Date(2014, 2, 30, 1, 59)).toString());
assertEquals("Sun, 30 Mar 2014 00:59:00 GMT",
(new Date(2014, 2, 30, 1, 59)).toUTCString());
assertEquals("Sun Mar 30 2014 03:00:00 GMT+0200 (CEST)",
(new Date(2014, 2, 30, 2, 0)).toString());
assertEquals("Sun, 30 Mar 2014 01:00:00 GMT",
(new Date(2014, 2, 30, 2, 0)).toUTCString());
assertEquals("Sun Mar 30 2014 03:59:00 GMT+0200 (CEST)",
(new Date(2014, 2, 30, 2, 59)).toString());
assertEquals("Sun, 30 Mar 2014 01:59:00 GMT",
(new Date(2014, 2, 30, 2, 59)).toUTCString());
assertEquals("Sun Mar 30 2014 03:00:00 GMT+0200 (CEST)",
(new Date(2014, 2, 30, 3, 0)).toString());
assertEquals("Sun, 30 Mar 2014 01:00:00 GMT",
(new Date(2014, 2, 30, 3, 0)).toUTCString());
assertEquals("Sun Mar 30 2014 03:59:00 GMT+0200 (CEST)",
(new Date(2014, 2, 30, 3, 59)).toString());
assertEquals("Sun, 30 Mar 2014 01:59:00 GMT",
(new Date(2014, 2, 30, 3, 59)).toUTCString());
assertEquals("Sun Mar 30 2014 04:00:00 GMT+0200 (CEST)",
(new Date(2014, 2, 30, 4, 0)).toString());
assertEquals("Sun, 30 Mar 2014 02:00:00 GMT",
(new Date(2014, 2, 30, 4, 0)).toUTCString());
assertEquals("Sat Oct 25 2014 22:59:00 GMT+0200 (CEST)",
(new Date(2014, 9, 25, 22, 59)).toString());
assertEquals("Sat, 25 Oct 2014 20:59:00 GMT",
(new Date(2014, 9, 25, 22, 59)).toUTCString());
assertEquals("Sat Oct 25 2014 23:00:00 GMT+0200 (CEST)",
(new Date(2014, 9, 25, 23, 0)).toString());
assertEquals("Sat, 25 Oct 2014 21:00:00 GMT",
(new Date(2014, 9, 25, 23, 0)).toUTCString());
assertEquals("Sat Oct 25 2014 23:59:00 GMT+0200 (CEST)",
(new Date(2014, 9, 25, 23, 59)).toString());
assertEquals("Sat, 25 Oct 2014 21:59:00 GMT",
(new Date(2014, 9, 25, 23, 59)).toUTCString());
assertEquals("Sun Oct 26 2014 00:00:00 GMT+0200 (CEST)",
(new Date(2014, 9, 26, 0, 0)).toString());
assertEquals("Sat, 25 Oct 2014 22:00:00 GMT",
(new Date(2014, 9, 26, 0, 0)).toUTCString());
assertEquals("Sun Oct 26 2014 00:59:00 GMT+0200 (CEST)",
(new Date(2014, 9, 26, 0, 59)).toString());
assertEquals("Sat, 25 Oct 2014 22:59:00 GMT",
(new Date(2014, 9, 26, 0, 59)).toUTCString());
assertEquals("Sun Oct 26 2014 01:00:00 GMT+0200 (CEST)",
(new Date(2014, 9, 26, 1, 0)).toString());
assertEquals("Sat, 25 Oct 2014 23:00:00 GMT",
(new Date(2014, 9, 26, 1, 0)).toUTCString());
assertEquals("Sun Oct 26 2014 01:59:00 GMT+0200 (CEST)",
(new Date(2014, 9, 26, 1, 59)).toString());
assertEquals("Sat, 25 Oct 2014 23:59:00 GMT",
(new Date(2014, 9, 26, 1, 59)).toUTCString());
assertEquals("Sun Oct 26 2014 02:00:00 GMT+0200 (CEST)",
(new Date(2014, 9, 26, 2, 0)).toString());
assertEquals("Sun, 26 Oct 2014 00:00:00 GMT",
(new Date(2014, 9, 26, 2, 0)).toUTCString());
assertEquals("Sun Oct 26 2014 02:59:00 GMT+0200 (CEST)",
(new Date(2014, 9, 26, 2, 59)).toString());
assertEquals("Sun, 26 Oct 2014 00:59:00 GMT",
(new Date(2014, 9, 26, 2, 59)).toUTCString());
assertEquals("Sun Oct 26 2014 03:00:00 GMT+0100 (CET)",
(new Date(2014, 9, 26, 3, 0)).toString());
assertEquals("Sun, 26 Oct 2014 02:00:00 GMT",
(new Date(2014, 9, 26, 3, 0)).toUTCString());
assertEquals("Sun Oct 26 2014 03:59:00 GMT+0100 (CET)",
(new Date(2014, 9, 26, 3, 59)).toString());
assertEquals("Sun, 26 Oct 2014 02:59:00 GMT",
(new Date(2014, 9, 26, 3, 59)).toUTCString());
assertEquals("Sun Oct 26 2014 04:00:00 GMT+0100 (CET)",
(new Date(2014, 9, 26, 4, 0)).toString());
assertEquals("Sun, 26 Oct 2014 03:00:00 GMT",
(new Date(2014, 9, 26, 4, 0)).toUTCString());
}
if (timezone("BRT")) {
assertEquals("Sat Oct 18 2014 22:59:00 GMT-0300 (BRT)",
(new Date(2014, 9, 18, 22, 59)).toString());
assertEquals("Sun, 19 Oct 2014 01:59:00 GMT",
(new Date(2014, 9, 18, 22, 59)).toUTCString());
assertEquals("Sat Oct 18 2014 23:00:00 GMT-0300 (BRT)",
(new Date(2014, 9, 18, 23, 0)).toString());
assertEquals("Sun, 19 Oct 2014 02:00:00 GMT",
(new Date(2014, 9, 18, 23, 0)).toUTCString());
assertEquals("Sat Oct 18 2014 23:59:00 GMT-0300 (BRT)",
(new Date(2014, 9, 18, 23, 59)).toString());
assertEquals("Sun, 19 Oct 2014 02:59:00 GMT",
(new Date(2014, 9, 18, 23, 59)).toUTCString());
assertEquals("Sun Oct 19 2014 01:00:00 GMT-0200 (BRST)",
(new Date(2014, 9, 19, 0, 0)).toString());
assertEquals("Sun, 19 Oct 2014 03:00:00 GMT",
(new Date(2014, 9, 19, 0, 0)).toUTCString());
assertEquals("Sun Oct 19 2014 01:59:00 GMT-0200 (BRST)",
(new Date(2014, 9, 19, 0, 59)).toString());
assertEquals("Sun, 19 Oct 2014 03:59:00 GMT",
(new Date(2014, 9, 19, 0, 59)).toUTCString());
assertEquals("Sun Oct 19 2014 01:00:00 GMT-0200 (BRST)",
(new Date(2014, 9, 19, 1, 0)).toString());
assertEquals("Sun, 19 Oct 2014 03:00:00 GMT",
(new Date(2014, 9, 19, 1, 0)).toUTCString());
assertEquals("Sun Oct 19 2014 01:59:00 GMT-0200 (BRST)",
(new Date(2014, 9, 19, 1, 59)).toString());
assertEquals("Sun, 19 Oct 2014 03:59:00 GMT",
(new Date(2014, 9, 19, 1, 59)).toUTCString());
assertEquals("Sun Oct 19 2014 02:00:00 GMT-0200 (BRST)",
(new Date(2014, 9, 19, 2, 0)).toString());
assertEquals("Sun, 19 Oct 2014 04:00:00 GMT",
(new Date(2014, 9, 19, 2, 0)).toUTCString());
assertEquals("Sun Oct 19 2014 02:59:00 GMT-0200 (BRST)",
(new Date(2014, 9, 19, 2, 59)).toString());
assertEquals("Sun, 19 Oct 2014 04:59:00 GMT",
(new Date(2014, 9, 19, 2, 59)).toUTCString());
assertEquals("Sun Oct 19 2014 03:00:00 GMT-0200 (BRST)",
(new Date(2014, 9, 19, 3, 0)).toString());
assertEquals("Sun, 19 Oct 2014 05:00:00 GMT",
(new Date(2014, 9, 19, 3, 0)).toUTCString());
assertEquals("Sun Oct 19 2014 03:59:00 GMT-0200 (BRST)",
(new Date(2014, 9, 19, 3, 59)).toString());
assertEquals("Sun, 19 Oct 2014 05:59:00 GMT",
(new Date(2014, 9, 19, 3, 59)).toUTCString());
assertEquals("Sun Oct 19 2014 04:00:00 GMT-0200 (BRST)",
(new Date(2014, 9, 19, 4, 0)).toString());
assertEquals("Sun, 19 Oct 2014 06:00:00 GMT",
(new Date(2014, 9, 19, 4, 0)).toUTCString());
assertEquals("Sat Feb 15 2014 22:59:00 GMT-0200 (BRST)",
(new Date(2014, 1, 15, 22, 59)).toString());
assertEquals("Sun, 16 Feb 2014 00:59:00 GMT",
(new Date(2014, 1, 15, 22, 59)).toUTCString());
assertEquals("Sat Feb 15 2014 23:00:00 GMT-0200 (BRST)",
(new Date(2014, 1, 15, 23, 0)).toString());
assertEquals("Sun, 16 Feb 2014 01:00:00 GMT",
(new Date(2014, 1, 15, 23, 0)).toUTCString());
assertEquals("Sat Feb 15 2014 23:59:00 GMT-0200 (BRST)",
(new Date(2014, 1, 15, 23, 59)).toString());
assertEquals("Sun, 16 Feb 2014 01:59:00 GMT",
(new Date(2014, 1, 15, 23, 59)).toUTCString());
assertEquals("Sun Feb 16 2014 00:00:00 GMT-0300 (BRT)",
(new Date(2014, 1, 16, 0, 0)).toString());
assertEquals("Sun, 16 Feb 2014 03:00:00 GMT",
(new Date(2014, 1, 16, 0, 0)).toUTCString());
assertEquals("Sun Feb 16 2014 00:59:00 GMT-0300 (BRT)",
(new Date(2014, 1, 16, 0, 59)).toString());
assertEquals("Sun, 16 Feb 2014 03:59:00 GMT",
(new Date(2014, 1, 16, 0, 59)).toUTCString());
assertEquals("Sun Feb 16 2014 01:00:00 GMT-0300 (BRT)",
(new Date(2014, 1, 16, 1, 0)).toString());
assertEquals("Sun, 16 Feb 2014 04:00:00 GMT",
(new Date(2014, 1, 16, 1, 0)).toUTCString());
assertEquals("Sun Feb 16 2014 01:59:00 GMT-0300 (BRT)",
(new Date(2014, 1, 16, 1, 59)).toString());
assertEquals("Sun, 16 Feb 2014 04:59:00 GMT",
(new Date(2014, 1, 16, 1, 59)).toUTCString());
assertEquals("Sun Feb 16 2014 02:00:00 GMT-0300 (BRT)",
(new Date(2014, 1, 16, 2, 0)).toString());
assertEquals("Sun, 16 Feb 2014 05:00:00 GMT",
(new Date(2014, 1, 16, 2, 0)).toUTCString());
assertEquals("Sun Feb 16 2014 02:59:00 GMT-0300 (BRT)",
(new Date(2014, 1, 16, 2, 59)).toString());
assertEquals("Sun, 16 Feb 2014 05:59:00 GMT",
(new Date(2014, 1, 16, 2, 59)).toUTCString());
assertEquals("Sun Feb 16 2014 03:00:00 GMT-0300 (BRT)",
(new Date(2014, 1, 16, 3, 0)).toString());
assertEquals("Sun, 16 Feb 2014 06:00:00 GMT",
(new Date(2014, 1, 16, 3, 0)).toUTCString());
assertEquals("Sun Feb 16 2014 03:59:00 GMT-0300 (BRT)",
(new Date(2014, 1, 16, 3, 59)).toString());
assertEquals("Sun, 16 Feb 2014 06:59:00 GMT",
(new Date(2014, 1, 16, 3, 59)).toUTCString());
assertEquals("Sun Feb 16 2014 04:00:00 GMT-0300 (BRT)",
(new Date(2014, 1, 16, 4, 0)).toString());
assertEquals("Sun, 16 Feb 2014 07:00:00 GMT",
(new Date(2014, 1, 16, 4, 0)).toUTCString());
}
if (timezone("PST")) {
assertEquals("Sat Mar 08 2014 22:59:00 GMT-0800 (PST)",
(new Date(2014, 2, 8, 22, 59)).toString());
assertEquals("Sun, 09 Mar 2014 06:59:00 GMT",
(new Date(2014, 2, 8, 22, 59)).toUTCString());
assertEquals("Sat Mar 08 2014 23:00:00 GMT-0800 (PST)",
(new Date(2014, 2, 8, 23, 0)).toString());
assertEquals("Sun, 09 Mar 2014 07:00:00 GMT",
(new Date(2014, 2, 8, 23, 0)).toUTCString());
assertEquals("Sat Mar 08 2014 23:59:00 GMT-0800 (PST)",
(new Date(2014, 2, 8, 23, 59)).toString());
assertEquals("Sun, 09 Mar 2014 07:59:00 GMT",
(new Date(2014, 2, 8, 23, 59)).toUTCString());
assertEquals("Sun Mar 09 2014 00:00:00 GMT-0800 (PST)",
(new Date(2014, 2, 9, 0, 0)).toString());
assertEquals("Sun, 09 Mar 2014 08:00:00 GMT",
(new Date(2014, 2, 9, 0, 0)).toUTCString());
assertEquals("Sun Mar 09 2014 00:59:00 GMT-0800 (PST)",
(new Date(2014, 2, 9, 0, 59)).toString());
assertEquals("Sun, 09 Mar 2014 08:59:00 GMT",
(new Date(2014, 2, 9, 0, 59)).toUTCString());
assertEquals("Sun Mar 09 2014 01:00:00 GMT-0800 (PST)",
(new Date(2014, 2, 9, 1, 0)).toString());
assertEquals("Sun, 09 Mar 2014 09:00:00 GMT",
(new Date(2014, 2, 9, 1, 0)).toUTCString());
assertEquals("Sun Mar 09 2014 01:59:00 GMT-0800 (PST)",
(new Date(2014, 2, 9, 1, 59)).toString());
assertEquals("Sun, 09 Mar 2014 09:59:00 GMT",
(new Date(2014, 2, 9, 1, 59)).toUTCString());
assertEquals("Sun Mar 09 2014 03:00:00 GMT-0700 (PDT)",
(new Date(2014, 2, 9, 2, 0)).toString());
assertEquals("Sun, 09 Mar 2014 10:00:00 GMT",
(new Date(2014, 2, 9, 2, 0)).toUTCString());
assertEquals("Sun Mar 09 2014 03:59:00 GMT-0700 (PDT)",
(new Date(2014, 2, 9, 2, 59)).toString());
assertEquals("Sun, 09 Mar 2014 10:59:00 GMT",
(new Date(2014, 2, 9, 2, 59)).toUTCString());
assertEquals("Sun Mar 09 2014 03:00:00 GMT-0700 (PDT)",
(new Date(2014, 2, 9, 3, 0)).toString());
assertEquals("Sun, 09 Mar 2014 10:00:00 GMT",
(new Date(2014, 2, 9, 3, 0)).toUTCString());
assertEquals("Sun Mar 09 2014 03:59:00 GMT-0700 (PDT)",
(new Date(2014, 2, 9, 3, 59)).toString());
assertEquals("Sun, 09 Mar 2014 10:59:00 GMT",
(new Date(2014, 2, 9, 3, 59)).toUTCString());
assertEquals("Sun Mar 09 2014 04:00:00 GMT-0700 (PDT)",
(new Date(2014, 2, 9, 4, 0)).toString());
assertEquals("Sun, 09 Mar 2014 11:00:00 GMT",
(new Date(2014, 2, 9, 4, 0)).toUTCString());
assertEquals("Sat Nov 01 2014 22:59:00 GMT-0700 (PDT)",
(new Date(2014, 10, 1, 22, 59)).toString());
assertEquals("Sun, 02 Nov 2014 05:59:00 GMT",
(new Date(2014, 10, 1, 22, 59)).toUTCString());
assertEquals("Sat Nov 01 2014 23:00:00 GMT-0700 (PDT)",
(new Date(2014, 10, 1, 23, 0)).toString());
assertEquals("Sun, 02 Nov 2014 06:00:00 GMT",
(new Date(2014, 10, 1, 23, 0)).toUTCString());
assertEquals("Sat Nov 01 2014 23:59:00 GMT-0700 (PDT)",
(new Date(2014, 10, 1, 23, 59)).toString());
assertEquals("Sun, 02 Nov 2014 06:59:00 GMT",
(new Date(2014, 10, 1, 23, 59)).toUTCString());
assertEquals("Sun Nov 02 2014 00:00:00 GMT-0700 (PDT)",
(new Date(2014, 10, 2, 0, 0)).toString());
assertEquals("Sun, 02 Nov 2014 07:00:00 GMT",
(new Date(2014, 10, 2, 0, 0)).toUTCString());
assertEquals("Sun Nov 02 2014 00:59:00 GMT-0700 (PDT)",
(new Date(2014, 10, 2, 0, 59)).toString());
assertEquals("Sun, 02 Nov 2014 07:59:00 GMT",
(new Date(2014, 10, 2, 0, 59)).toUTCString());
assertEquals("Sun Nov 02 2014 01:00:00 GMT-0700 (PDT)",
(new Date(2014, 10, 2, 1, 0)).toString());
assertEquals("Sun, 02 Nov 2014 08:00:00 GMT",
(new Date(2014, 10, 2, 1, 0)).toUTCString());
assertEquals("Sun Nov 02 2014 01:59:00 GMT-0700 (PDT)",
(new Date(2014, 10, 2, 1, 59)).toString());
assertEquals("Sun, 02 Nov 2014 08:59:00 GMT",
(new Date(2014, 10, 2, 1, 59)).toUTCString());
assertEquals("Sun Nov 02 2014 02:00:00 GMT-0800 (PST)",
(new Date(2014, 10, 2, 2, 0)).toString());
assertEquals("Sun, 02 Nov 2014 10:00:00 GMT",
(new Date(2014, 10, 2, 2, 0)).toUTCString());
assertEquals("Sun Nov 02 2014 02:59:00 GMT-0800 (PST)",
(new Date(2014, 10, 2, 2, 59)).toString());
assertEquals("Sun, 02 Nov 2014 10:59:00 GMT",
(new Date(2014, 10, 2, 2, 59)).toUTCString());
assertEquals("Sun Nov 02 2014 03:00:00 GMT-0800 (PST)",
(new Date(2014, 10, 2, 3, 0)).toString());
assertEquals("Sun, 02 Nov 2014 11:00:00 GMT",
(new Date(2014, 10, 2, 3, 0)).toUTCString());
assertEquals("Sun Nov 02 2014 03:59:00 GMT-0800 (PST)",
(new Date(2014, 10, 2, 3, 59)).toString());
assertEquals("Sun, 02 Nov 2014 11:59:00 GMT",
(new Date(2014, 10, 2, 3, 59)).toUTCString());
assertEquals("Sun Nov 02 2014 04:00:00 GMT-0800 (PST)",
(new Date(2014, 10, 2, 4, 0)).toString());
assertEquals("Sun, 02 Nov 2014 12:00:00 GMT",
(new Date(2014, 10, 2, 4, 0)).toUTCString());
}

22
deps/v8/test/mjsunit/regress/regress-411210.js

@ -0,0 +1,22 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax --gc-interval=439 --random-seed=-423594851
var __v_3;
function __f_2() {
var __v_1 = new Array(3);
__v_1[0] = 10;
__v_1[1] = 15.5;
__v_3 = __f_2();
__v_1[2] = 20;
return __v_1;
}
try {
for (var __v_2 = 0; __v_2 < 3; ++__v_2) {
__v_3 = __f_2();
}
}
catch (e) { }

18
deps/v8/test/mjsunit/regress/regress-crbug-403409.js

@ -0,0 +1,18 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
Array.prototype[0] = 777;
var kElements = 10;
var input_array = [];
for (var i = 1; i < kElements; i++) {
input_array[i] = 0.5;
}
var output_array = input_array.concat(0.5);
assertEquals(kElements + 1, output_array.length);
assertEquals(777, output_array[0]);
for (var j = 1; j < kElements; j++) {
assertEquals(0.5, output_array[j]);
}

12
deps/v8/test/mjsunit/regress/regress-crbug-407946.js

@ -0,0 +1,12 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
function f(n) { return [0].indexOf((n - n) + 0); }
assertEquals(0, f(.1));
assertEquals(0, f(.1));
%OptimizeFunctionOnNextCall(f);
assertEquals(0, f(.1));

10
deps/v8/test/mjsunit/regress/regress-crbug-423687.js

@ -0,0 +1,10 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
var json = '{"a":{"c":2.1,"d":0},"b":{"c":7,"1024":8}}';
var data = JSON.parse(json);
data.b.c++;

18
deps/v8/test/mjsunit/regress/regress-force-constant-representation.js

@ -0,0 +1,18 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
// Test push double as tagged.
var a = [{}];
function f(a) {
a.push(Infinity);
}
f(a);
f(a);
f(a);
%OptimizeFunctionOnNextCall(f);
f(a);
assertEquals([{}, Infinity, Infinity, Infinity, Infinity], a);

6
deps/v8/test/mjsunit/regress/regress-json-parse-index.js

@ -0,0 +1,6 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var o = JSON.parse('{"\\u0030":100}');
assertEquals(100, o[0]);

14
deps/v8/test/mjsunit/regress/regress-reset-dictionary-elements.js

@ -0,0 +1,14 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var a = [];
a[10000] = 1;
a.length = 0;
a[1] = 1;
a.length = 0;
assertEquals(undefined, a[1]);
var o = {};
Object.freeze(o);
assertEquals(undefined, o[1]);

5
deps/v8/test/mjsunit/runtime-gen/createprivateownsymbol.js

@ -1,5 +0,0 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
// Flags: --allow-natives-syntax --harmony --harmony-proxies
var arg0 = "foo";
%CreatePrivateOwnSymbol(arg0);

2613
deps/v8/test/mjsunit/tools/profviz-test.log

File diff suppressed because it is too large

11
deps/v8/test/mjsunit/tools/tickprocessor-test-func-info.log

@ -0,0 +1,11 @@
shared-library,"shell",0x08048000,0x081ee000
shared-library,"/lib32/libm-2.7.so",0xf7db6000,0xf7dd9000
shared-library,"ffffe000-fffff000",0xffffe000,0xfffff000
profiler,"begin",1
code-creation,Stub,0,0x424260,348,"CompareStub_GE"
code-creation,LazyCompile,0,0x2a8100,18535,"DrawQube 3d-cube.js:188",0xf43abcac,
code-creation,LazyCompile,0,0x480100,3908,"DrawLine 3d-cube.js:17",0xf43abc50,
tick,0x424284,0,0,0x480600,0,0x2aaaa5
tick,0x42429f,0,0,0x480600,0,0x2aacb4
tick,0x48063d,0,0,0x2d0f7c,0,0x2aaec6
profiler,"end"

25
deps/v8/test/mjsunit/tools/tickprocessor-test.log

@ -0,0 +1,25 @@
shared-library,"shell",0x08048000,0x081ee000
shared-library,"/lib32/libm-2.7.so",0xf7db6000,0xf7dd9000
shared-library,"ffffe000-fffff000",0xffffe000,0xfffff000
profiler,"begin",1
code-creation,Stub,0,0xf540a100,474,"CEntryStub"
code-creation,Script,0,0xf541cd80,736,"exp.js"
code-creation,Stub,0,0xf541d0e0,47,"RuntimeStub_Math_exp"
code-creation,LazyCompile,0,0xf541d120,145,"exp native math.js:41"
function-creation,0xf441d280,0xf541d120
code-creation,LoadIC,0,0xf541d280,117,"j"
code-creation,LoadIC,0,0xf541d360,63,"i"
tick,0x80f82d1,0,0,0,0,0xf541ce5c
tick,0x80f89a1,0,0,0,0,0xf541ce5c
tick,0x8123b5c,0,0,0,0,0xf541d1a1,0xf541ceea
tick,0x8123b65,0,0,0,0,0xf541d1a1,0xf541ceea
tick,0xf541d2be,0,0,0,0
tick,0xf541d320,0,0,0,0
tick,0xf541d384,0,0,0,0
tick,0xf7db94da,0,0,0,0,0xf541d1a1,0xf541ceea
tick,0xf7db951c,0,0,0,0,0xf541d1a1,0xf541ceea
tick,0xf7dbc508,0,0,0,0,0xf541d1a1,0xf541ceea
tick,0xf7dbff21,0,0,0,0,0xf541d1a1,0xf541ceea
tick,0xf7edec90,0,0,0,0,0xf541d1a1,0xf541ceea
tick,0xffffe402,0,0,0,0
profiler,"end"

2
deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames-expected.txt

@ -68,7 +68,7 @@ PASS getSortedOwnPropertyNames(Object.prototype) is ['__defineGetter__', '__defi
PASS getSortedOwnPropertyNames(Function) is ['arguments', 'caller', 'length', 'name', 'prototype']
PASS getSortedOwnPropertyNames(Function.prototype) is ['apply', 'arguments', 'bind', 'call', 'caller', 'constructor', 'length', 'name', 'toString']
PASS getSortedOwnPropertyNames(Array) is ['arguments', 'caller', 'isArray', 'length', 'name', 'observe', 'prototype', 'unobserve']
PASS getSortedOwnPropertyNames(Array.prototype) is ['concat', 'constructor', 'entries', 'every', 'filter', 'forEach', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift', 'values']
PASS getSortedOwnPropertyNames(Array.prototype) is ['concat', 'constructor', 'entries', 'every', 'filter', 'forEach', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift']
PASS getSortedOwnPropertyNames(String) is ['arguments', 'caller', 'fromCharCode', 'length', 'name', 'prototype']
PASS getSortedOwnPropertyNames(String.prototype) is ['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat', 'constructor', 'fixed', 'fontcolor', 'fontsize', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'normalize', 'replace', 'search', 'slice', 'small', 'split', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'valueOf']
PASS getSortedOwnPropertyNames(Boolean) is ['arguments', 'caller', 'length', 'name', 'prototype']

2
deps/v8/test/webkit/fast/js/Object-getOwnPropertyNames.js

@ -76,7 +76,7 @@ var expectedPropertyNamesSet = {
"Function": "['arguments', 'caller', 'length', 'name', 'prototype']",
"Function.prototype": "['apply', 'arguments', 'bind', 'call', 'caller', 'constructor', 'length', 'name', 'toString']",
"Array": "['arguments', 'caller', 'isArray', 'length', 'name', 'observe', 'prototype', 'unobserve']",
"Array.prototype": "['concat', 'constructor', 'entries', 'every', 'filter', 'forEach', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift', 'values']",
"Array.prototype": "['concat', 'constructor', 'entries', 'every', 'filter', 'forEach', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift']",
"String": "['arguments', 'caller', 'fromCharCode', 'length', 'name', 'prototype']",
"String.prototype": "['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat', 'constructor', 'fixed', 'fontcolor', 'fontsize', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'normalize', 'replace', 'search', 'slice', 'small', 'split', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', 'valueOf']",
"Boolean": "['arguments', 'caller', 'length', 'name', 'prototype']",

3
deps/v8/test/webkit/webkit.status

@ -50,6 +50,9 @@
['simulator', {
'function-apply-aliased': [SKIP],
}], # 'simulator'
['arch == arm and simulator_run == True', {
'dfg-int-overflow-in-loop': [SKIP],
}], # 'arch == arm and simulator_run == True'
['arch == arm64 and simulator_run == True', {
'dfg-int-overflow-in-loop': [SKIP],
}], # 'arch == arm64 and simulator_run == True'

34
deps/v8/testing/gtest-type-names.h

@ -1,34 +0,0 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_TESTING_GTEST_TYPE_NAMES_H_
#define V8_TESTING_GTEST_TYPE_NAMES_H_
#include "include/v8stdint.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace testing {
namespace internal {
#define GET_TYPE_NAME(type) \
template <> \
std::string GetTypeName<type>() { \
return #type; \
}
GET_TYPE_NAME(int8_t)
GET_TYPE_NAME(uint8_t)
GET_TYPE_NAME(int16_t)
GET_TYPE_NAME(uint16_t)
GET_TYPE_NAME(int32_t)
GET_TYPE_NAME(uint32_t)
GET_TYPE_NAME(int64_t)
GET_TYPE_NAME(uint64_t)
GET_TYPE_NAME(float)
GET_TYPE_NAME(double)
#undef GET_TYPE_NAME
} // namespace internal
} // namespace testing
#endif // V8_TESTING_GTEST_TYPE_NAMES_H_

1
deps/v8/testing/gtest.gyp

@ -37,7 +37,6 @@
'gtest/src/gtest-test-part.cc',
'gtest/src/gtest-typed-test.cc',
'gtest/src/gtest.cc',
'gtest-type-names.h',
],
'sources!': [
'gtest/src/gtest-all.cc', # Not needed by our build.

13
deps/v8/third_party/fdlibm/fdlibm.cc

@ -26,7 +26,7 @@ namespace fdlibm {
inline double scalbn(double x, int y) { return _scalb(x, y); }
#endif // _MSC_VER
const double MathConstants::constants[] = {
const double TrigonometricConstants::constants[] = {
6.36619772367581382433e-01, // invpio2 0
1.57079632673412561417e+00, // pio2_1 1
6.07710050650619224932e-11, // pio2_1t 2
@ -61,17 +61,6 @@ const double MathConstants::constants[] = {
2.59073051863633712884e-05, // T12 31
7.85398163397448278999e-01, // pio4 32
3.06161699786838301793e-17, // pio4lo 33
6.93147180369123816490e-01, // ln2_hi 34
1.90821492927058770002e-10, // ln2_lo 35
1.80143985094819840000e+16, // 2^54 36
6.666666666666666666e-01, // 2/3 37
6.666666666666735130e-01, // LP1 38
3.999999999940941908e-01, // 39
2.857142874366239149e-01, // 40
2.222219843214978396e-01, // 41
1.818357216161805012e-01, // 42
1.531383769920937332e-01, // 43
1.479819860511658591e-01, // LP7 44
};

4
deps/v8/third_party/fdlibm/fdlibm.h

@ -22,8 +22,8 @@ namespace fdlibm {
int rempio2(double x, double* y);
// Constants to be exposed to builtins via Float64Array.
struct MathConstants {
static const double constants[45];
struct TrigonometricConstants {
static const double constants[34];
};
}
} // namespace v8::internal

192
deps/v8/third_party/fdlibm/fdlibm.js

@ -13,21 +13,21 @@
// modified significantly by Google Inc.
// Copyright 2014 the V8 project authors. All rights reserved.
//
// The following is a straightforward translation of fdlibm routines
// by Raymond Toy (rtoy@google.com).
// The following is a straightforward translation of fdlibm routines for
// sin, cos, and tan, by Raymond Toy (rtoy@google.com).
var kMath; // Initialized to a Float64Array during genesis and is not writable.
var kTrig; // Initialized to a Float64Array during genesis and is not writable.
const INVPIO2 = kMath[0];
const PIO2_1 = kMath[1];
const PIO2_1T = kMath[2];
const PIO2_2 = kMath[3];
const PIO2_2T = kMath[4];
const PIO2_3 = kMath[5];
const PIO2_3T = kMath[6];
const PIO4 = kMath[32];
const PIO4LO = kMath[33];
const INVPIO2 = kTrig[0];
const PIO2_1 = kTrig[1];
const PIO2_1T = kTrig[2];
const PIO2_2 = kTrig[3];
const PIO2_2T = kTrig[4];
const PIO2_3 = kTrig[5];
const PIO2_3T = kTrig[6];
const PIO4 = kTrig[32];
const PIO4LO = kTrig[33];
// Compute k and r such that x - k*pi/2 = r where |r| < pi/4. For
// precision, r is returned as two values y0 and y1 such that r = y0 + y1
@ -133,7 +133,7 @@ endmacro
// sin(x) = X + (S1*X + (X *(r-Y/2)+Y))
//
macro KSIN(x)
kMath[7+x]
kTrig[7+x]
endmacro
macro RETURN_KERNELSIN(X, Y, SIGN)
@ -177,7 +177,7 @@ endmacro
// thus, reducing the rounding error in the subtraction.
//
macro KCOS(x)
kMath[13+x]
kTrig[13+x]
endmacro
macro RETURN_KERNELCOS(X, Y, SIGN)
@ -199,7 +199,6 @@ macro RETURN_KERNELCOS(X, Y, SIGN)
}
endmacro
// kernel tan function on [-pi/4, pi/4], pi/4 ~ 0.7854
// Input x is assumed to be bounded by ~pi/4 in magnitude.
// Input y is the tail of x.
@ -236,7 +235,7 @@ endmacro
// and will cause incorrect results.
//
macro KTAN(x)
kMath[19+x]
kTrig[19+x]
endmacro
function KernelTan(x, y, returnTan) {
@ -355,164 +354,3 @@ function MathTan(x) {
REMPIO2(x);
return KernelTan(y0, y1, (n & 1) ? -1 : 1);
}
// ES6 draft 09-27-13, section 20.2.2.20.
// Math.log1p
//
// Method :
// 1. Argument Reduction: find k and f such that
// 1+x = 2^k * (1+f),
// where sqrt(2)/2 < 1+f < sqrt(2) .
//
// Note. If k=0, then f=x is exact. However, if k!=0, then f
// may not be representable exactly. In that case, a correction
// term is need. Let u=1+x rounded. Let c = (1+x)-u, then
// log(1+x) - log(u) ~ c/u. Thus, we proceed to compute log(u),
// and add back the correction term c/u.
// (Note: when x > 2**53, one can simply return log(x))
//
// 2. Approximation of log1p(f).
// Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s)
// = 2s + 2/3 s**3 + 2/5 s**5 + .....,
// = 2s + s*R
// We use a special Reme algorithm on [0,0.1716] to generate
// a polynomial of degree 14 to approximate R The maximum error
// of this polynomial approximation is bounded by 2**-58.45. In
// other words,
// 2 4 6 8 10 12 14
// R(z) ~ Lp1*s +Lp2*s +Lp3*s +Lp4*s +Lp5*s +Lp6*s +Lp7*s
// (the values of Lp1 to Lp7 are listed in the program)
// and
// | 2 14 | -58.45
// | Lp1*s +...+Lp7*s - R(z) | <= 2
// | |
// Note that 2s = f - s*f = f - hfsq + s*hfsq, where hfsq = f*f/2.
// In order to guarantee error in log below 1ulp, we compute log
// by
// log1p(f) = f - (hfsq - s*(hfsq+R)).
//
// 3. Finally, log1p(x) = k*ln2 + log1p(f).
// = k*ln2_hi+(f-(hfsq-(s*(hfsq+R)+k*ln2_lo)))
// Here ln2 is split into two floating point number:
// ln2_hi + ln2_lo,
// where n*ln2_hi is always exact for |n| < 2000.
//
// Special cases:
// log1p(x) is NaN with signal if x < -1 (including -INF) ;
// log1p(+INF) is +INF; log1p(-1) is -INF with signal;
// log1p(NaN) is that NaN with no signal.
//
// Accuracy:
// according to an error analysis, the error is always less than
// 1 ulp (unit in the last place).
//
// Constants:
// The hexadecimal values are the intended ones for the following
// constants. The decimal values may be used, provided that the
// compiler will convert from decimal to binary accurately enough
// to produce the hexadecimal values shown.
//
// Note: Assuming log() return accurate answer, the following
// algorithm can be used to compute log1p(x) to within a few ULP:
//
// u = 1+x;
// if (u==1.0) return x ; else
// return log(u)*(x/(u-1.0));
//
// See HP-15C Advanced Functions Handbook, p.193.
//
const LN2_HI = kMath[34];
const LN2_LO = kMath[35];
const TWO54 = kMath[36];
const TWO_THIRD = kMath[37];
macro KLOGP1(x)
(kMath[38+x])
endmacro
function MathLog1p(x) {
x = x * 1; // Convert to number.
var hx = %_DoubleHi(x);
var ax = hx & 0x7fffffff;
var k = 1;
var f = x;
var hu = 1;
var c = 0;
var u = x;
if (hx < 0x3fda827a) {
// x < 0.41422
if (ax >= 0x3ff00000) { // |x| >= 1
if (x === -1) {
return -INFINITY; // log1p(-1) = -inf
} else {
return NAN; // log1p(x<-1) = NaN
}
} else if (ax < 0x3c900000) {
// For |x| < 2^-54 we can return x.
return x;
} else if (ax < 0x3e200000) {
// For |x| < 2^-29 we can use a simple two-term Taylor series.
return x - x * x * 0.5;
}
if ((hx > 0) || (hx <= -0x402D413D)) { // (int) 0xbfd2bec3 = -0x402d413d
// -.2929 < x < 0.41422
k = 0;
}
}
// Handle Infinity and NAN
if (hx >= 0x7ff00000) return x;
if (k !== 0) {
if (hx < 0x43400000) {
// x < 2^53
u = 1 + x;
hu = %_DoubleHi(u);
k = (hu >> 20) - 1023;
c = (k > 0) ? 1 - (u - x) : x - (u - 1);
c = c / u;
} else {
hu = %_DoubleHi(u);
k = (hu >> 20) - 1023;
}
hu = hu & 0xfffff;
if (hu < 0x6a09e) {
u = %_ConstructDouble(hu | 0x3ff00000, %_DoubleLo(u)); // Normalize u.
} else {
++k;
u = %_ConstructDouble(hu | 0x3fe00000, %_DoubleLo(u)); // Normalize u/2.
hu = (0x00100000 - hu) >> 2;
}
f = u - 1;
}
var hfsq = 0.5 * f * f;
if (hu === 0) {
// |f| < 2^-20;
if (f === 0) {
if (k === 0) {
return 0.0;
} else {
return k * LN2_HI + (c + k * LN2_LO);
}
}
var R = hfsq * (1 - TWO_THIRD * f);
if (k === 0) {
return f - R;
} else {
return k * LN2_HI - ((R - (k * LN2_LO + c)) - f);
}
}
var s = f / (2 + f);
var z = s * s;
var R = z * (KLOGP1(0) + z * (KLOGP1(1) + z *
(KLOGP1(2) + z * (KLOGP1(3) + z *
(KLOGP1(4) + z * (KLOGP1(5) + z * KLOGP1(6)))))));
if (k === 0) {
return f - (hfsq - s * (hfsq + R));
} else {
return k * LN2_HI - ((hfsq - (s * (hfsq + R) + (k * LN2_LO + c))) - f);
}
}

20
deps/v8/tools/gen-postmortem-metadata.py

@ -70,6 +70,8 @@ consts_misc = [
{ 'name': 'ExternalStringTag', 'value': 'kExternalStringTag' },
{ 'name': 'SlicedStringTag', 'value': 'kSlicedStringTag' },
{ 'name': 'FailureTag', 'value': 'kFailureTag' },
{ 'name': 'FailureTagMask', 'value': 'kFailureTagMask' },
{ 'name': 'HeapObjectTag', 'value': 'kHeapObjectTag' },
{ 'name': 'HeapObjectTagMask', 'value': 'kHeapObjectTagMask' },
{ 'name': 'SmiTag', 'value': 'kSmiTag' },
@ -92,6 +94,8 @@ consts_misc = [
'value': 'DescriptorArray::kFirstIndex' },
{ 'name': 'prop_type_field',
'value': 'FIELD' },
{ 'name': 'prop_type_first_phantom',
'value': 'TRANSITION' },
{ 'name': 'prop_type_mask',
'value': 'PropertyDetails::TypeField::kMask' },
{ 'name': 'prop_index_mask',
@ -116,15 +120,11 @@ consts_misc = [
'value': 'DICTIONARY_ELEMENTS' },
{ 'name': 'bit_field2_elements_kind_mask',
'value': 'Map::ElementsKindBits::kMask' },
'value': 'Map::kElementsKindMask' },
{ 'name': 'bit_field2_elements_kind_shift',
'value': 'Map::ElementsKindBits::kShift' },
'value': 'Map::kElementsKindShift' },
{ 'name': 'bit_field3_dictionary_map_shift',
'value': 'Map::DictionaryMap::kShift' },
{ 'name': 'fieldindex_mask',
'value': 'PropertyDetails::FieldIndexField::kMask' },
{ 'name': 'fieldindex_shift',
'value': 'PropertyDetails::FieldIndexField::kShift' },
{ 'name': 'off_fp_context',
'value': 'StandardFrameConstants::kContextOffset' },
@ -150,7 +150,7 @@ extras_accessors = [
'Map, instance_size, int, kInstanceSizeOffset',
'Map, bit_field, char, kBitFieldOffset',
'Map, bit_field2, char, kBitField2Offset',
'Map, bit_field3, int, kBitField3Offset',
'Map, bit_field3, SMI, kBitField3Offset',
'Map, prototype, Object, kPrototypeOffset',
'NameDictionaryShape, prefix_size, int, kPrefixSize',
'NameDictionaryShape, entry_size, int, kEntrySize',
@ -196,9 +196,9 @@ header = '''
* This file is generated by %s. Do not edit directly.
*/
#include "src/v8.h"
#include "src/frames.h"
#include "src/frames-inl.h" /* for architecture-specific frame constants */
#include "v8.h"
#include "frames.h"
#include "frames-inl.h" /* for architecture-specific frame constants */
using namespace v8::internal;

7
deps/v8/tools/generate-runtime-tests.py

@ -47,11 +47,11 @@ EXPAND_MACROS = [
# that the parser doesn't bit-rot. Change the values as needed when you add,
# remove or change runtime functions, but make sure we don't lose our ability
# to parse them!
EXPECTED_FUNCTION_COUNT = 429
EXPECTED_FUZZABLE_COUNT = 332
EXPECTED_FUNCTION_COUNT = 428
EXPECTED_FUZZABLE_COUNT = 331
EXPECTED_CCTEST_COUNT = 7
EXPECTED_UNKNOWN_COUNT = 16
EXPECTED_BUILTINS_COUNT = 808
EXPECTED_BUILTINS_COUNT = 809
# Don't call these at all.
@ -226,7 +226,6 @@ CUSTOM_KNOWN_GOOD_INPUT = {
"CreateBreakIterator": ["'en-US'", "{type: 'string'}", None, None],
"CreateJSFunctionProxy": [None, "function() {}", None, None, None],
"CreatePrivateSymbol": ["\"foo\"", None],
"CreatePrivateOwnSymbol": ["\"foo\"", None],
"CreateSymbol": ["\"foo\"", None],
"DateParseString": [None, "new Array(8)", None],
"DefineAccessorPropertyUnchecked": [None, None, "function() {}",

4
deps/v8/tools/gyp/v8.gyp

@ -344,8 +344,6 @@
'../../src/compilation-cache.h',
'../../src/compiler/ast-graph-builder.cc',
'../../src/compiler/ast-graph-builder.h',
'../../src/compiler/change-lowering.cc',
'../../src/compiler/change-lowering.h',
'../../src/compiler/code-generator-impl.h',
'../../src/compiler/code-generator.cc',
'../../src/compiler/code-generator.h',
@ -1250,7 +1248,7 @@
['OS=="solaris"', {
'link_settings': {
'libraries': [
'-lnsl -lrt',
'-lnsl',
]},
'sources': [
'../../src/base/platform/platform-solaris.cc',

43
deps/v8/tools/run-tests.py

@ -28,6 +28,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from collections import OrderedDict
import itertools
import multiprocessing
import optparse
@ -52,6 +53,31 @@ from testrunner.objects import context
ARCH_GUESS = utils.DefaultArch()
DEFAULT_TESTS = ["mjsunit", "fuzz-natives", "base-unittests",
"cctest", "compiler-unittests", "message", "preparser"]
# Map of test name synonyms to lists of test suites. Should be ordered by
# expected runtimes (suites with slow test cases first). These groups are
# invoked in seperate steps on the bots.
TEST_MAP = {
"default": [
"mjsunit",
"fuzz-natives",
"cctest",
"message",
"preparser",
],
"optimize_for_size": [
"mjsunit",
"cctest",
"webkit",
],
"unittests": [
"compiler-unittests",
"heap-unittests",
"base-unittests",
"libplatform-unittests",
],
}
TIMEOUT_DEFAULT = 60
TIMEOUT_SCALEFACTOR = {"debug" : 4,
"release" : 1 }
@ -377,14 +403,23 @@ def Main():
suite_paths = utils.GetSuitePaths(join(workspace, "test"))
# Expand arguments with grouped tests. The args should reflect the list of
# suites as otherwise filters would break.
def ExpandTestGroups(name):
if name in TEST_MAP:
return [suite for suite in TEST_MAP[arg]]
else:
return [name]
args = reduce(lambda x, y: x + y,
[ExpandTestGroups(arg) for arg in args],
[])
if len(args) == 0:
suite_paths = [ s for s in DEFAULT_TESTS if s in suite_paths ]
else:
args_suites = set()
args_suites = OrderedDict() # Used as set
for arg in args:
suite = arg.split(os.path.sep)[0]
if not suite in args_suites:
args_suites.add(suite)
args_suites[arg.split(os.path.sep)[0]] = True
suite_paths = [ s for s in args_suites if s in suite_paths ]
suites = []

11
deps/v8/tools/v8.xcodeproj/README.txt

@ -0,0 +1,11 @@
The Xcode project for V8 has been retired. If an Xcode project
is needed for building on a Mac there is the option of using GYP to
generate it. Please look in the build directory in the root of the
V8 project. It contains the required infrastructure and a README.txt
file explaining how to get started.
Generating Xcode projects using GYP is how the Chromium
project integrated V8 into the Mac build.
The main build system for V8 is still SCons, see
http://code.google.com/apis/v8/build.html for details.

2
deps/v8/tools/whitespace.txt

@ -5,4 +5,4 @@ Try to write something funny. And please don't add trailing whitespace.
A Smi walks into a bar and says:
"I'm so deoptimized today!"
The doubles heard this and started to unbox.
The Smi looked at them and......................
The Smi looked at them and....................

Loading…
Cancel
Save