Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Upgrade v8 to 1.3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Sep 23, 2009
1 parent be3ddde commit 2df13c7
Show file tree
Hide file tree
Showing 66 changed files with 2,564 additions and 569 deletions.
1 change: 1 addition & 0 deletions deps/v8/AUTHORS
Expand Up @@ -10,6 +10,7 @@ Alexandre Vassalotti <avassalotti@gmail.com>
Craig Schlenter <craig.schlenter@gmail.com>
Daniel Andersson <kodandersson@gmail.com>
Daniel James <dnljms@gmail.com>
Jan de Mooij <jandemooij@gmail.com>
Jay Freeman <saurik@saurik.com>
Joel Stanley <joel.stan@gmail.com>
Matt Hanselman <mjhanselman@gmail.com>
Expand Down
24 changes: 24 additions & 0 deletions deps/v8/ChangeLog
@@ -1,3 +1,27 @@
2009-09-23: Version 1.3.13

Fixed uninitialized memory problem.

Improved heap profiler support.


2009-09-22: Version 1.3.12

Changed behavior of |function|.toString() on built-in functions to
be compatible with other implementations. Patch by Jan de Mooij.

Added Object::IsDirty in the API.

Optimized array construction; it is now handled purely in native
code.

[ES5] Made properties of the arguments array enumerable.

[ES5] Added test suite adapter for the es5conform test suite.

[ES5] Added Object.keys function.


2009-09-15: Version 1.3.11

Fixed crash in error reporting during bootstrapping.
Expand Down
13 changes: 9 additions & 4 deletions deps/v8/LICENSE
Expand Up @@ -2,10 +2,15 @@ This license applies to all parts of V8 that are not externally
maintained libraries. The externally maintained libraries used by V8
are:

- PCRE test suite, located in test/mjsunit/regexp-pcre.js. This is
based on the test suite from PCRE-7.3, which is copyrighted by the
University of Cambridge and Google, Inc. The copyright notice and
license are embedded in regexp-pcre.js.
- PCRE test suite, located in
test/mjsunit/third_party/regexp-pcre.js. This is based on the
test suite from PCRE-7.3, which is copyrighted by the University
of Cambridge and Google, Inc. The copyright notice and license
are embedded in regexp-pcre.js.

- Layout tests, located in test/mjsunit/third_party. These are
based on layout tests from webkit.org which are copyrighted by
Apple Computer, Inc. and released under a 3-clause BSD license.

- Dtoa, located under third_party/dtoa. This code is copyrighted by
David M. Gay and released under an MIT license.
Expand Down
17 changes: 13 additions & 4 deletions deps/v8/include/v8.h
Expand Up @@ -1238,6 +1238,15 @@ class V8EXPORT Object : public Value {
bool SetHiddenValue(Handle<String> key, Handle<Value> value);
Local<Value> GetHiddenValue(Handle<String> key);
bool DeleteHiddenValue(Handle<String> key);

/**
* Returns true if this is an instance of an api function (one
* created from a function created from a function template) and has
* been modified since it was created. Note that this method is
* conservative and may return true for objects that haven't actually
* been modified.
*/
bool IsDirty();

/**
* Clone this object with a fast but shallow copy. Values will point
Expand Down Expand Up @@ -1537,19 +1546,19 @@ enum AccessType {

/**
* Returns true if cross-context access should be allowed to the named
* property with the given key on the global object.
* property with the given key on the host object.
*/
typedef bool (*NamedSecurityCallback)(Local<Object> global,
typedef bool (*NamedSecurityCallback)(Local<Object> host,
Local<Value> key,
AccessType type,
Local<Value> data);


/**
* Returns true if cross-context access should be allowed to the indexed
* property with the given index on the global object.
* property with the given index on the host object.
*/
typedef bool (*IndexedSecurityCallback)(Local<Object> global,
typedef bool (*IndexedSecurityCallback)(Local<Object> host,
uint32_t index,
AccessType type,
Local<Value> data);
Expand Down
17 changes: 9 additions & 8 deletions deps/v8/src/SConscript
Expand Up @@ -42,14 +42,15 @@ SOURCES = {
'debug.cc', 'debug-agent.cc', 'disassembler.cc', 'execution.cc',
'factory.cc', 'flags.cc', 'frame-element.cc', 'frames.cc',
'func-name-inferrer.cc', 'global-handles.cc', 'handles.cc',
'hashmap.cc', 'heap.cc', 'ic.cc', 'interpreter-irregexp.cc',
'jsregexp.cc', 'jump-target.cc', 'log.cc', 'log-utils.cc',
'mark-compact.cc', 'messages.cc', 'objects.cc', 'oprofile-agent.cc',
'parser.cc', 'property.cc', 'regexp-macro-assembler.cc',
'regexp-macro-assembler-irregexp.cc', 'regexp-stack.cc',
'register-allocator.cc', 'rewriter.cc', 'runtime.cc', 'scanner.cc',
'scopeinfo.cc', 'scopes.cc', 'serialize.cc', 'snapshot-common.cc',
'spaces.cc', 'string-stream.cc', 'stub-cache.cc', 'token.cc', 'top.cc',
'hashmap.cc', 'heap.cc', 'heap-profiler.cc', 'ic.cc',
'interpreter-irregexp.cc', 'jsregexp.cc', 'jump-target.cc',
'log.cc', 'log-utils.cc', 'mark-compact.cc', 'messages.cc',
'objects.cc', 'oprofile-agent.cc', 'parser.cc', 'property.cc',
'regexp-macro-assembler.cc', 'regexp-macro-assembler-irregexp.cc',
'regexp-stack.cc', 'register-allocator.cc', 'rewriter.cc',
'runtime.cc', 'scanner.cc', 'scopeinfo.cc', 'scopes.cc',
'serialize.cc', 'snapshot-common.cc', 'spaces.cc',
'string-stream.cc', 'stub-cache.cc', 'token.cc', 'top.cc',
'unicode.cc', 'usage-analyzer.cc', 'utils.cc', 'v8-counters.cc',
'v8.cc', 'v8threads.cc', 'variables.cc', 'version.cc',
'virtual-frame.cc', 'zone.cc'
Expand Down
9 changes: 8 additions & 1 deletion deps/v8/src/api.cc
Expand Up @@ -1191,6 +1191,7 @@ v8::TryCatch::TryCatch()
exception_(i::Heap::the_hole_value()),
message_(i::Smi::FromInt(0)),
is_verbose_(false),
can_continue_(true),
capture_message_(true),
js_handler_(NULL) {
i::Top::RegisterTryCatchHandler(this);
Expand Down Expand Up @@ -1988,7 +1989,8 @@ Local<Array> v8::Object::GetPropertyNames() {
ENTER_V8;
v8::HandleScope scope;
i::Handle<i::JSObject> self = Utils::OpenHandle(this);
i::Handle<i::FixedArray> value = i::GetKeysInFixedArrayFor(self);
i::Handle<i::FixedArray> value =
i::GetKeysInFixedArrayFor(self, i::INCLUDE_PROTOS);
// Because we use caching to speed up enumeration it is important
// to never change the result of the basic enumeration function so
// we clone the result.
Expand Down Expand Up @@ -2155,6 +2157,11 @@ void v8::Object::TurnOnAccessCheck() {
}


bool v8::Object::IsDirty() {
return Utils::OpenHandle(this)->IsDirty();
}


Local<v8::Object> v8::Object::Clone() {
ON_BAILOUT("v8::Object::Clone()", return Local<Object>());
ENTER_V8;
Expand Down
16 changes: 16 additions & 0 deletions deps/v8/src/arm/builtins-arm.cc
Expand Up @@ -51,6 +51,22 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) {
}


void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// Just jump to the generic array code.
Code* code = Builtins::builtin(Builtins::ArrayCodeGeneric);
Handle<Code> array_code(code);
__ Jump(array_code, RelocInfo::CODE_TARGET);
}


void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) {
// Just jump to the generic construct code.
Code* code = Builtins::builtin(Builtins::JSConstructStubGeneric);
Handle<Code> generic_construct_stub(code);
__ Jump(generic_construct_stub, RelocInfo::CODE_TARGET);
}


void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- r0 : number of arguments
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/arm/codegen-arm.cc
Expand Up @@ -4335,7 +4335,7 @@ static void CountLeadingZeros(
Register source,
Register scratch,
Register zeros) {
#ifdef __ARM_ARCH_5__
#ifdef CAN_USE_ARMV5_INSTRUCTIONS
__ clz(zeros, source); // This instruction is only supported after ARM5.
#else
__ mov(zeros, Operand(0));
Expand Down
24 changes: 22 additions & 2 deletions deps/v8/src/arm/constants-arm.h
Expand Up @@ -43,10 +43,30 @@
# define USE_THUMB_INTERWORK 1
#endif

#if defined(__ARM_ARCH_5T__) || \
defined(__ARM_ARCH_5TE__) || \
defined(__ARM_ARCH_6__) || \
defined(__ARM_ARCH_7A__) || \
defined(__ARM_ARCH_7__)
# define CAN_USE_ARMV5_INSTRUCTIONS 1
# define CAN_USE_THUMB_INSTRUCTIONS 1
#endif

#if defined(__ARM_ARCH_6__) || \
defined(__ARM_ARCH_7A__) || \
defined(__ARM_ARCH_7__)
# define CAN_USE_ARMV6_INSTRUCTIONS 1
#endif

#if defined(__ARM_ARCH_7A__) || \
defined(__ARM_ARCH_7__)
# define CAN_USE_ARMV7_INSTRUCTIONS 1
#endif

// Simulator should support ARM5 instructions.
#if !defined(__arm__)
# define __ARM_ARCH_5__ 1
# define __ARM_ARCH_5T__ 1
# define CAN_USE_ARMV5_INSTRUCTIONS 1
# define CAN_USE_THUMB_INSTRUCTIONS 1
#endif

namespace assembler {
Expand Down
16 changes: 5 additions & 11 deletions deps/v8/src/arm/macro-assembler-arm.cc
Expand Up @@ -52,21 +52,15 @@ MacroAssembler::MacroAssembler(void* buffer, int size)


// We do not support thumb inter-working with an arm architecture not supporting
// the blx instruction (below v5t)
#if defined(USE_THUMB_INTERWORK)
#if !defined(__ARM_ARCH_5T__) && \
!defined(__ARM_ARCH_5TE__) && \
!defined(__ARM_ARCH_6__) && \
!defined(__ARM_ARCH_7A__) && \
!defined(__ARM_ARCH_7__)
// add tests for other versions above v5t as required
#error "for thumb inter-working we require architecture v5t or above"
#endif
// the blx instruction (below v5t). If you know what CPU you are compiling for
// you can use -march=armv7 or similar.
#if defined(USE_THUMB_INTERWORK) && !defined(CAN_USE_THUMB_INSTRUCTIONS)
# error "For thumb inter-working we require an architecture which supports blx"
#endif


// Using blx may yield better code, so use it when required or when available
#if defined(USE_THUMB_INTERWORK) || defined(__ARM_ARCH_5__)
#if defined(USE_THUMB_INTERWORK) || defined(CAN_USE_ARMV5_INSTRUCTIONS)
#define USE_BLX 1
#endif

Expand Down
4 changes: 3 additions & 1 deletion deps/v8/src/bootstrapper.cc
Expand Up @@ -654,6 +654,8 @@ void Genesis::CreateRoots(v8::Handle<v8::ObjectTemplate> global_template,
InstallFunction(global, "Array", JS_ARRAY_TYPE, JSArray::kSize,
Top::initial_object_prototype(), Builtins::ArrayCode,
true);
array_function->shared()->set_construct_stub(
Builtins::builtin(Builtins::ArrayConstructCode));
array_function->shared()->DontAdaptArguments();

// This seems a bit hackish, but we need to make sure Array.length
Expand Down Expand Up @@ -1471,7 +1473,7 @@ void Genesis::MakeFunctionInstancePrototypeWritable() {
HandleScope scope;

Handle<DescriptorArray> function_map_descriptors =
ComputeFunctionInstanceDescriptor(false, true);
ComputeFunctionInstanceDescriptor(false);
Handle<Map> fm = Factory::CopyMapDropDescriptors(Top::function_map());
fm->set_instance_descriptors(*function_map_descriptors);
Top::context()->global_context()->set_function_map(*fm);
Expand Down
6 changes: 4 additions & 2 deletions deps/v8/src/builtins.cc
Expand Up @@ -135,7 +135,9 @@ BUILTIN(EmptyFunction) {
BUILTIN_END


BUILTIN(ArrayCode) {
BUILTIN(ArrayCodeGeneric) {
Counters::array_function_runtime.Increment();

JSArray* array;
if (CalledAsConstructor()) {
array = JSArray::cast(*receiver);
Expand Down Expand Up @@ -166,7 +168,7 @@ BUILTIN(ArrayCode) {
// Take the argument as the length.
obj = array->Initialize(0);
if (obj->IsFailure()) return obj;
if (args.length() == 2) return array->SetElementsLength(args[1]);
return array->SetElementsLength(args[1]);
}

// Optimize the case where there are no parameters passed.
Expand Down
11 changes: 8 additions & 3 deletions deps/v8/src/builtins.h
Expand Up @@ -37,7 +37,7 @@ namespace internal {
\
V(EmptyFunction) \
\
V(ArrayCode) \
V(ArrayCodeGeneric) \
\
V(ArrayPush) \
V(ArrayPop) \
Expand Down Expand Up @@ -83,8 +83,10 @@ namespace internal {
\
/* Uses KeyedLoadIC_Initialize; must be after in list. */ \
V(FunctionCall, BUILTIN, UNINITIALIZED) \
V(FunctionApply, BUILTIN, UNINITIALIZED)

V(FunctionApply, BUILTIN, UNINITIALIZED) \
\
V(ArrayCode, BUILTIN, UNINITIALIZED) \
V(ArrayConstructCode, BUILTIN, UNINITIALIZED)

#ifdef ENABLE_DEBUGGER_SUPPORT
// Define list of builtins used by the debugger implemented in assembly.
Expand Down Expand Up @@ -217,6 +219,9 @@ class Builtins : public AllStatic {

static void Generate_FunctionCall(MacroAssembler* masm);
static void Generate_FunctionApply(MacroAssembler* masm);

static void Generate_ArrayCode(MacroAssembler* masm);
static void Generate_ArrayConstructCode(MacroAssembler* masm);
};

} } // namespace v8::internal
Expand Down

0 comments on commit 2df13c7

Please sign in to comment.