Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Commit

Permalink
Version 1.3.0.
Browse files Browse the repository at this point in the history
Allowed RegExp objects to be called as functions (issue 132).

Fixed issue where global property cells would escape after detaching the global object; see http://crbug.com/16276.

Added support for stepping into setters and getters in the debugger.

Changed the debugger to avoid stopping in its own JavaScript code and in the code of built-in functions.

Fixed issue 345 by avoiding duplicate escaping labels.

Fixed ARM code generator crash in short-circuited boolean expressions and added regression tests.

Added an external allocation limit to avoid issues where small V8 objects would hold on to large amounts of external memory without causing garbage collections.

Finished more of the inline caching stubs for x64 targets. 


git-svn-id: https://v8.googlecode.com/svn/trunk@2537 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
  • Loading branch information
kasperl@chromium.org committed Jul 27, 2009
1 parent 714fb02 commit 4578462
Show file tree
Hide file tree
Showing 95 changed files with 3,766 additions and 945 deletions.
25 changes: 25 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
2009-07-27: Version 1.3.0

Allowed RegExp objects to be called as functions (issue 132).

Fixed issue where global property cells would escape after
detaching the global object; see http://crbug.com/16276.

Added support for stepping into setters and getters in the
debugger.

Changed the debugger to avoid stopping in its own JavaScript code
and in the code of built-in functions.

Fixed issue 345 by avoiding duplicate escaping labels.

Fixed ARM code generator crash in short-circuited boolean
expressions and added regression tests.

Added an external allocation limit to avoid issues where small V8
objects would hold on to large amounts of external memory without
causing garbage collections.

Finished more of the inline caching stubs for x64 targets.


2009-07-13: Version 1.2.14

Added separate paged heap space for global property cells and
Expand Down
75 changes: 20 additions & 55 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -149,31 +149,22 @@ LIBRARY_FLAGS = {
'-Wstrict-aliasing=2'],
'CPPPATH': ANDROID_INCLUDES,
},
'wordsize:32': {
'arch:x64': {
'CCFLAGS': ['-m64'],
'LINKFLAGS': ['-m64']
}
},
'wordsize:64': {
'arch:ia32': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
},
'arch:arm': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
}
},
'arch:ia32': {
'CPPDEFINES': ['V8_TARGET_ARCH_IA32']
'CPPDEFINES': ['V8_TARGET_ARCH_IA32'],
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
},
'arch:arm': {
'CPPDEFINES': ['V8_TARGET_ARCH_ARM']
},
'simulator:arm': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
},
'arch:x64': {
'CCFLAGS': ['-fno-strict-aliasing'],
'CPPDEFINES': ['V8_TARGET_ARCH_X64']
'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
'CCFLAGS': ['-fno-strict-aliasing', '-m64'],
'LINKFLAGS': ['-m64'],
},
'prof:oprofile': {
'CPPDEFINES': ['ENABLE_OPROFILE_AGENT']
Expand Down Expand Up @@ -341,22 +332,6 @@ CCTEST_EXTRA_FLAGS = {
'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
}
},
'wordsize:32': {
'arch:x64': {
'CCFLAGS': ['-m64'],
'LINKFLAGS': ['-m64']
}
},
'wordsize:64': {
'arch:ia32': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
},
'arch:arm': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
}
}
},
'msvc': {
'all': {
Expand Down Expand Up @@ -408,21 +383,17 @@ SAMPLE_FLAGS = {
'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
}
},
'wordsize:32': {
'arch:x64': {
'CCFLAGS': ['-m64'],
'LINKFLAGS': ['-m64']
}
'arch:ia32': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
},
'wordsize:64': {
'arch:ia32': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
},
'arch:arm': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
}
'arch:x64': {
'CCFLAGS': ['-m64'],
'LINKFLAGS': ['-m64']
},
'simulator:arm': {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
},
'mode:release': {
'CCFLAGS': ['-O2']
Expand Down Expand Up @@ -533,7 +504,6 @@ def GuessToolchain(os):
OS_GUESS = utils.GuessOS()
TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS)
ARCH_GUESS = utils.GuessArchitecture()
WORDSIZE_GUESS = utils.GuessWordsize()


SIMPLE_OPTIONS = {
Expand Down Expand Up @@ -587,11 +557,6 @@ SIMPLE_OPTIONS = {
'default': 'on',
'help': 'use Microsoft Visual C++ link-time code generation'
},
'wordsize': {
'values': ['64', '32'],
'default': WORDSIZE_GUESS,
'help': 'the word size'
},
'simulator': {
'values': ['arm', 'none'],
'default': 'none',
Expand Down
32 changes: 32 additions & 0 deletions benchmarks/run.html
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,48 @@
NotifyScore: AddScore });
}

function ShowWarningIfObsolete() {
// If anything goes wrong we will just catch the exception and no
// warning is shown, i.e., no harm is done.
try {
var xmlhttp;
var next_version = parseInt(BenchmarkSuite.version) + 1;
var next_version_url = "../v" + next_version + "/run.html";
if (window.XMLHttpRequest) {
xmlhttp = new window.XMLHttpRequest();
} else if (window.ActiveXObject) {
xmlhttp = new window.ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open('GET', next_version_url, true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById('obsolete').style.display="block";
}
};
xmlhttp.send(null);
} catch(e) {
// Ignore exception if check for next version fails.
// Hence no warning is displayed.
}
}

function Load() {
var version = BenchmarkSuite.version;
document.getElementById("version").innerHTML = version;
ShowWarningIfObsolete();
setTimeout(Run, 200);
}
</script>
</head>
<body onload="Load()">
<div>
<div class="title"><h1>V8 Benchmark Suite - version <span id="version">?</span></h1></div>
<div class="warning" id="obsolete">
Warning! This is not the latest version of the V8 benchmark
suite. Consider running the
<a href="http://v8.googlecode.com/svn/data/benchmarks/current/run.html">
latest version</a>.
</div>
<table>
<tr>
<td class="contents">
Expand Down
9 changes: 9 additions & 0 deletions benchmarks/style.css
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ div.run {
border: 1px solid rgb(51, 102, 204);
}

div.warning {
background: #ffffd9;
border: 1px solid #d2d26a;
display: none;
margin: 1em 0 2em;
padding: 8px;
text-align: center;
}

#status {
text-align: center;
margin-top: 50px;
Expand Down
27 changes: 17 additions & 10 deletions include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ template <class T> class V8EXPORT_INLINE Handle {
/**
* Creates an empty handle.
*/
Handle();
inline Handle();

/**
* Creates a new handle for the specified value.
Expand Down Expand Up @@ -264,7 +264,7 @@ template <class T> class V8EXPORT_INLINE Handle {
*/
template <class T> class V8EXPORT_INLINE Local : public Handle<T> {
public:
Local();
inline Local();
template <class S> inline Local(Local<S> that)
: Handle<T>(reinterpret_cast<T*>(*that)) {
/**
Expand All @@ -284,7 +284,7 @@ template <class T> class V8EXPORT_INLINE Local : public Handle<T> {
* The referee is kept alive by the local handle even when
* the original handle is destroyed/disposed.
*/
static Local<T> New(Handle<T> that);
inline static Local<T> New(Handle<T> that);
};


Expand Down Expand Up @@ -312,7 +312,7 @@ template <class T> class V8EXPORT_INLINE Persistent : public Handle<T> {
* Creates an empty persistent handle that doesn't point to any
* storage cell.
*/
Persistent();
inline Persistent();

/**
* Creates a persistent handle for the same storage cell as the
Expand Down Expand Up @@ -353,36 +353,36 @@ template <class T> class V8EXPORT_INLINE Persistent : public Handle<T> {
* Creates a new persistent handle for an existing local or
* persistent handle.
*/
static Persistent<T> New(Handle<T> that);
inline static Persistent<T> New(Handle<T> that);

/**
* Releases the storage cell referenced by this persistent handle.
* Does not remove the reference to the cell from any handles.
* This handle's reference, and any any other references to the storage
* cell remain and IsEmpty will still return false.
*/
void Dispose();
inline void Dispose();

/**
* Make the reference to this object weak. When only weak handles
* refer to the object, the garbage collector will perform a
* callback to the given V8::WeakReferenceCallback function, passing
* it the object reference and the given parameters.
*/
void MakeWeak(void* parameters, WeakReferenceCallback callback);
inline void MakeWeak(void* parameters, WeakReferenceCallback callback);

/** Clears the weak reference to this object.*/
void ClearWeak();
inline void ClearWeak();

/**
*Checks if the handle holds the only reference to an object.
*/
bool IsNearDeath() const;
inline bool IsNearDeath() const;

/**
* Returns true if the handle's reference is weak.
*/
bool IsWeak() const;
inline bool IsWeak() const;

private:
friend class ImplementationUtilities;
Expand Down Expand Up @@ -1113,6 +1113,13 @@ class V8EXPORT Object : public Value {
/** Sets the value in an internal field. */
void SetInternalField(int index, Handle<Value> value);

// The two functions below do not perform index bounds checks and
// they do not check that the VM is still running. Use with caution.
/** Gets a native pointer from an internal field. */
void* GetPointerFromInternalField(int index);
/** Sets a native pointer in an internal field. */
void SetPointerInInternalField(int index, void* value);

// Testers for local properties.
bool HasRealNamedProperty(Handle<String> key);
bool HasRealIndexedProperty(uint32_t index);
Expand Down
2 changes: 1 addition & 1 deletion src/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ SOURCES = {
'codegen.cc', 'compilation-cache.cc', 'compiler.cc', 'contexts.cc',
'conversions.cc', 'counters.cc', 'dateparser.cc', 'debug.cc',
'debug-agent.cc', 'disassembler.cc', 'execution.cc', 'factory.cc',
'flags.cc', 'frames.cc', 'func-name-inferrer.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',
Expand Down
41 changes: 40 additions & 1 deletion src/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1085,8 +1085,9 @@ Local<Script> Script::Compile(v8::Handle<String> source,
// handle it if it turns out not to be in release mode.
ASSERT(pre_data == NULL || pre_data->SanityCheck());
// If the pre-data isn't sane we simply ignore it
if (pre_data != NULL && !pre_data->SanityCheck())
if (pre_data != NULL && !pre_data->SanityCheck()) {
pre_data = NULL;
}
i::Handle<i::JSFunction> boilerplate = i::Compiler::Compile(str,
name_obj,
line_offset,
Expand Down Expand Up @@ -2464,6 +2465,44 @@ void v8::Object::SetInternalField(int index, v8::Handle<Value> value) {
}


void* v8::Object::GetPointerFromInternalField(int index) {
i::Handle<i::JSObject> obj = Utils::OpenHandle(this);
i::Object* pointer = obj->GetInternalField(index);
if (pointer->IsSmi()) {
// Fast case, aligned native pointer.
return pointer;
}

// Read from uninitialized field.
if (!pointer->IsProxy()) {
// Play safe even if it's something unexpected.
ASSERT(pointer->IsUndefined());
return NULL;
}

// Unaligned native pointer.
return reinterpret_cast<void*>(i::Proxy::cast(pointer)->proxy());
}


void v8::Object::SetPointerInInternalField(int index, void* value) {
i::Handle<i::JSObject> obj = Utils::OpenHandle(this);
i::Object* as_object = reinterpret_cast<i::Object*>(value);
if (as_object->IsSmi()) {
// Aligned pointer, store as is.
obj->SetInternalField(index, as_object);
} else {
// Currently internal fields are used by DOM wrappers which only
// get garbage collected by the mark-sweep collector, so we
// pretenure the proxy.
HandleScope scope;
i::Handle<i::Proxy> proxy =
i::Factory::NewProxy(reinterpret_cast<i::Address>(value), i::TENURED);
if (!proxy.is_null()) obj->SetInternalField(index, *proxy);
}
}


// --- E n v i r o n m e n t ---

bool v8::V8::Initialize() {
Expand Down
Loading

0 comments on commit 4578462

Please sign in to comment.