Revision: 12227
Author: [email protected]
Date: Mon Jul 30 06:05:33 2012
Log: Version 3.12.18
Forced using bit-pattern for signed zero double. (issue 2239)
Made sure double to int conversion is correct. (issue 2260)
Performance and stability improvements on all platforms.
http://code.google.com/p/v8/source/detail?r=12227
Added:
/trunk/Makefile.android
Modified:
/trunk/ChangeLog
/trunk/Makefile
/trunk/src/arm/full-codegen-arm.cc
/trunk/src/ast.h
/trunk/src/conversions-inl.h
/trunk/src/conversions.h
/trunk/src/elements.cc
/trunk/src/flag-definitions.h
/trunk/src/heap.cc
/trunk/src/heap.h
/trunk/src/hydrogen.cc
/trunk/src/hydrogen.h
/trunk/src/ia32/full-codegen-ia32.cc
/trunk/src/mark-compact.cc
/trunk/src/mips/full-codegen-mips.cc
/trunk/src/objects-printer.cc
/trunk/src/objects.cc
/trunk/src/runtime.cc
/trunk/src/transitions-inl.h
/trunk/src/transitions.h
/trunk/src/version.cc
/trunk/src/x64/full-codegen-x64.cc
/trunk/test/cctest/test-heap.cc
/trunk/test/cctest/test-utils.cc
/trunk/tools/android-build.sh
/trunk/tools/test.py
=======================================
--- /dev/null
+++ /trunk/Makefile.android Mon Jul 30 06:05:33 2012
@@ -0,0 +1,92 @@
+# Copyright 2012 the V8 project authors. All rights reserved.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Those definitions should be consistent with the main Makefile
+ANDROID_ARCHES = android_ia32 android_arm
+MODES = release debug
+
+# Generates all combinations of ANDROID ARCHES and MODES,
+# e.g. "android_ia32.release" or "android_arm.release"
+ANDROID_BUILDS = $(foreach mode,$(MODES), \
+ $(addsuffix .$(mode),$(ANDROID_ARCHES)))
+
+HOST_OS = $(shell uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')
+ifeq ($(HOST_OS), linux)
+ TOOLCHAIN_DIR = linux-x86
+else
+ ifeq ($(HOST_OS), mac)
+ TOOLCHAIN_DIR = darwin-x86
+ else
+ $(error Host platform "${HOST_OS}" is not supported)
+ endif
+endif
+
+ifeq ($(ARCH), android_arm)
+ DEFINES = target_arch=arm v8_target_arch=arm android_target_arch=arm
+ DEFINES += arm_neon=0 armv7=1
+ TOOLCHAIN_ARCH = arm-linux-androideabi-4.4.3
+else
+ ifeq ($(ARCH), android_ia32)
+ DEFINES = target_arch=ia32 v8_target_arch=ia32 android_target_arch=x86
+ TOOLCHAIN_ARCH = x86-4.4.3
+ else
+ $(error Target architecture "${ARCH}" is not supported)
+ endif
+endif
+
+TOOLCHAIN_PATH = ${ANDROID_NDK_ROOT}/toolchains/${TOOLCHAIN_ARCH}/prebuilt
+ANDROID_TOOLCHAIN = ${TOOLCHAIN_PATH}/${TOOLCHAIN_DIR}/bin
+ifeq ($(wildcard $(ANDROID_TOOLCHAIN)),)
+ $(error Cannot find Android toolchain in "${ANDROID_TOOLCHAIN}")
+endif
+
+# For mksnapshot host generation.
+DEFINES += host_os=${HOST_OS}
+
+.SECONDEXPANSION:
+$(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$(basename $$@)
+ @$(MAKE) -C "$(OUTDIR)" -f Makefile.$(basename $@) \
+ CXX="$(ANDROID_TOOLCHAIN)/*-g++" \
+ AR="$(ANDROID_TOOLCHAIN)/*-ar" \
+ RANLIB="$(ANDROID_TOOLCHAIN)/*-ranlib" \
+ CC="$(ANDROID_TOOLCHAIN)/*-gcc" \
+ LD="$(ANDROID_TOOLCHAIN)/*-ld" \
+ LINK="$(ANDROID_TOOLCHAIN)/*-g++" \
+ BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
+ python -c "print raw_input().capitalize()") \
+ builddir="$(shell pwd)/$(OUTDIR)/$@"
+
+# Android GYP file generation targets.
+ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_ARCHES))
+$(ANDROID_MAKEFILES):
+ @GYP_GENERATORS=make-android \
+ GYP_DEFINES="${DEFINES}" \
+ CC="${ANDROID_TOOLCHAIN}/*-gcc" \
+ CXX="${ANDROID_TOOLCHAIN}/*-g++" \
+ build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \
+ -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \
+ -S.${ARCH} ${GYPFLAGS}
=======================================
--- /trunk/ChangeLog Fri Jul 27 01:03:27 2012
+++ /trunk/ChangeLog Mon Jul 30 06:05:33 2012
@@ -1,3 +1,12 @@
+2012-07-30: Version 3.12.18
+
+ Forced using bit-pattern for signed zero double. (issue 2239)
+
+ Made sure double to int conversion is correct. (issue 2260)
+
+ Performance and stability improvements on all platforms.
+
+
2012-07-27: Version 3.12.17
Always set the callee's context when calling a function from
optimized
=======================================
--- /trunk/Makefile Tue Jul 24 00:59:48 2012
+++ /trunk/Makefile Mon Jul 30 06:05:33 2012
@@ -178,9 +178,12 @@
$(ANDROID_ARCHES): $(addprefix $$@.,$(MODES))
$(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \
- must-set-ANDROID_NDK_ROOT
- @tools/android-build.sh $(basename $@) $(subst .,,$(suffix $@)) \
- $(OUTDIR) $(GYPFLAGS)
+ must-set-ANDROID_NDK_ROOT Makefile.android
+ @$(MAKE) -f Makefile.android $@ \
+ ARCH="$(basename $@)" \
+ MODE="$(subst .,,$(suffix $@))" \
+ OUTDIR="$(OUTDIR)" \
+ GYPFLAGS="$(GYPFLAGS)"
# Test targets.
check: all
@@ -231,8 +234,8 @@
clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)) native.clean
# GYP file generation targets.
-MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES))
-$(MAKEFILES): $(GYPFILES) $(ENVFILE)
+OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES))
+$(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE)
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
-Ibuild/standalone.gypi --depth=. \
=======================================
--- /trunk/src/arm/full-codegen-arm.cc Fri Jul 27 01:03:27 2012
+++ /trunk/src/arm/full-codegen-arm.cc Mon Jul 30 06:05:33 2012
@@ -2275,6 +2275,7 @@
if (key->IsPropertyName()) {
VisitForAccumulatorValue(expr->obj());
EmitNamedPropertyLoad(expr);
+ PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
context()->Plug(r0);
} else {
VisitForStackValue(expr->obj());
=======================================
--- /trunk/src/ast.h Tue Jul 24 00:59:48 2012
+++ /trunk/src/ast.h Mon Jul 30 06:05:33 2012
@@ -1512,6 +1512,9 @@
Expression* obj() const { return obj_; }
Expression* key() const { return key_; }
virtual int position() const { return pos_; }
+
+ // Bailout support.
+ int ReturnId() const { return return_id_; }
bool IsStringLength() const { return is_string_length_; }
bool IsStringAccess() const { return is_string_access_; }
@@ -1535,6 +1538,7 @@
obj_(obj),
key_(key),
pos_(pos),
+ return_id_(GetNextId(isolate)),
is_monomorphic_(false),
is_uninitialized_(false),
is_array_length_(false),
@@ -1546,6 +1550,7 @@
Expression* obj_;
Expression* key_;
int pos_;
+ const int return_id_;
SmallMapList receiver_types_;
bool is_monomorphic_ : 1;
=======================================
--- /trunk/src/conversions-inl.h Tue Jul 24 00:59:48 2012
+++ /trunk/src/conversions-inl.h Mon Jul 30 06:05:33 2012
@@ -49,6 +49,11 @@
inline double JunkStringValue() {
return BitCast<double, uint64_t>(kQuietNaNMask);
}
+
+
+inline double SignedZero(bool negative) {
+ return negative ? uint64_to_double(Double::kSignMask) : 0.0;
+}
// The fast double-to-unsigned-int conversion routine does not guarantee
=======================================
--- /trunk/src/conversions.h Tue Nov 29 06:28:56 2011
+++ /trunk/src/conversions.h Mon Jul 30 06:05:33 2012
@@ -52,8 +52,13 @@
}
-inline double SignedZero(bool negative) {
- return negative ? -0.0 : 0.0;
+// The fast double-to-(unsigned-)int conversion routine does not guarantee
+// rounding towards zero.
+// For NaN and values outside the int range, return INT_MIN or INT_MAX.
+inline int FastD2IChecked(double x) {
+ if (!(x >= INT_MIN)) return INT_MIN; // Negation to catch NaNs.
+ if (x > INT_MAX) return INT_MAX;
+ return static_cast<int>(x);
}
@@ -62,8 +67,6 @@
// The result is unspecified if x is infinite or NaN, or if the rounded
// integer value is outside the range of type int.
inline int FastD2I(double x) {
- // The static_cast convertion from double to int used to be slow, but
- // as new benchmarks show, now it is much faster than lrint().
return static_cast<int>(x);
}
=======================================
--- /trunk/src/elements.cc Wed Jun 13 04:51:58 2012
+++ /trunk/src/elements.cc Mon Jul 30 06:05:33 2012
@@ -800,7 +800,7 @@
}
} else {
// Otherwise, fill the unused tail with holes.
- int old_length = FastD2I(array->length()->Number());
+ int old_length = FastD2IChecked(array->length()->Number());
for (int i = length; i < old_length; i++) {
backing_store->set_the_hole(i);
}
=======================================
--- /trunk/src/flag-definitions.h Fri Jul 27 01:03:27 2012
+++ /trunk/src/flag-definitions.h Mon Jul 30 06:05:33 2012
@@ -213,6 +213,7 @@
"cache optimized code for closures")
DEFINE_bool(inline_construct, true, "inline constructor calls")
DEFINE_bool(inline_arguments, true, "inline functions with arguments
object")
+DEFINE_bool(inline_accessors, false, "inline JavaScript accessors")
DEFINE_int(loop_weight, 1, "loop weight for representation inference")
DEFINE_bool(optimize_for_in, true,
@@ -552,6 +553,8 @@
DEFINE_bool(heap_stats, false, "report heap statistics before and after
GC")
DEFINE_bool(code_stats, false, "report code statistics after GC")
DEFINE_bool(verify_heap, false, "verify heap pointers before and after GC")
+DEFINE_bool(verify_global_context_separation, false,
+ "verify that code holds on to at most one global context after
GC")
DEFINE_bool(print_handles, false, "report handles after GC")
DEFINE_bool(print_global_handles, false, "report global handles after GC")
=======================================
--- /trunk/src/heap.cc Fri Jul 27 01:03:27 2012
+++ /trunk/src/heap.cc Mon Jul 30 06:05:33 2012
@@ -6770,6 +6770,15 @@
#ifdef DEBUG
+// Triggers a depth-first traversal of reachable objects from one
+// given root object and finds a path to a specific heap object and
+// prints it.
+void Heap::TracePathToObjectFrom(Object* target, Object* root) {
+ PathTracer tracer(target, PathTracer::FIND_ALL, VISIT_ALL);
+ tracer.VisitPointer(&root);
+}
+
+
// Triggers a depth-first traversal of reachable objects from roots
// and finds a path to a specific heap object and prints it.
void Heap::TracePathToObject(Object* target) {
=======================================
--- /trunk/src/heap.h Fri Jul 27 01:03:27 2012
+++ /trunk/src/heap.h Mon Jul 30 06:05:33 2012
@@ -1285,6 +1285,7 @@
return disallow_allocation_failure_;
}
+ void TracePathToObjectFrom(Object* target, Object* root);
void TracePathToObject(Object* target);
void TracePathToGlobal();
#endif
=======================================
--- /trunk/src/hydrogen.cc Fri Jul 27 01:03:27 2012
+++ /trunk/src/hydrogen.cc Mon Jul 30 06:05:33 2012
@@ -4771,6 +4771,11 @@
// If we don't know the monomorphic type, do a generic store.
CHECK_ALIVE(store = BuildStoreNamedGeneric(literal, name,
value));
} else {
+#if DEBUG
+ Handle<AccessorPair> accessors;
+ Handle<JSObject> holder;
+ ASSERT(!LookupAccessorPair(map, name, &accessors, &holder));
+#endif
CHECK_ALIVE(store = BuildStoreNamedMonomorphic(literal,
name,
value,
@@ -5055,30 +5060,6 @@
// true = needs smi and map check.
return BuildStoreNamedField(object, name, value, map, &lookup, true);
}
-
- // Handle a known setter directly in the receiver.
- map->LookupDescriptor(NULL, *name, &lookup);
- if (lookup.IsPropertyCallbacks()) {
- Handle<Object> callback(lookup.GetValueFromMap(*map));
- Handle<JSObject> holder;
- if (!callback->IsAccessorPair()) {
- return BuildStoreNamedGeneric(object, name, value);
- }
- Handle<AccessorPair> accessors = Handle<AccessorPair>::cast(callback);
- return BuildCallSetter(object, value, map, accessors, holder);
- }
-
- // Handle a known setter somewhere in the prototype chain.
- LookupInPrototypes(map, name, &lookup);
- if (lookup.IsPropertyCallbacks()) {
- Handle<Object> callback(lookup.GetValue());
- Handle<JSObject> holder(lookup.holder());
- if (!callback->IsAccessorPair()) {
- return BuildStoreNamedGeneric(object, name, value);
- }
- Handle<AccessorPair> accessors = Handle<AccessorPair>::cast(callback);
- return BuildCallSetter(object, value, map, accessors, holder);
- }
// No luck, do a generic store.
return BuildStoreNamedGeneric(object, name, value);
@@ -5121,6 +5102,7 @@
// Use monomorphic load if property lookup results in the same field
index
// for all maps. Requires special map check on the set of all handled
maps.
+ AddInstruction(new(zone()) HCheckNonSmi(object));
HInstruction* instr;
if (count == types->length() && is_monomorphic_field) {
AddInstruction(new(zone()) HCheckMaps(object, types, zone()));
@@ -5221,36 +5203,52 @@
expr->RecordTypeFeedback(oracle(), zone());
CHECK_ALIVE(VisitForValue(prop->obj()));
- HValue* value = NULL;
- HInstruction* instr = NULL;
-
if (prop->key()->IsPropertyName()) {
// Named store.
CHECK_ALIVE(VisitForValue(expr->value()));
- value = Pop();
- HValue* object = Pop();
+ HValue* value = environment()->ExpressionStackAt(0);
+ HValue* object = environment()->ExpressionStackAt(1);
Literal* key = prop->key()->AsLiteral();
Handle<String> name = Handle<String>::cast(key->handle());
ASSERT(!name.is_null());
+ HInstruction* instr = NULL;
SmallMapList* types = expr->GetReceiverTypes();
if (expr->IsMonomorphic()) {
Handle<Map> map = types->first();
- CHECK_ALIVE(instr = BuildStoreNamedMonomorphic(object, name, value,
map));
- } else if (types != NULL && types->length() > 1) {
- HandlePolymorphicStoreNamedField(expr, object, value, types, name);
- return;
-
+ Handle<AccessorPair> accessors;
+ Handle<JSObject> holder;
+ if (LookupAccessorPair(map, name, &accessors, &holder)) {
+ Drop(2);
+ instr = BuildCallSetter(object, value, map, accessors, holder);
+ } else {
+ Drop(2);
+ CHECK_ALIVE(instr = BuildStoreNamedMonomorphic(object,
+ name,
+ value,
+ map));
+ }
+
+ } else if (types != NULL && types->length() > 1) {
+ Drop(2);
+ return HandlePolymorphicStoreNamedField(expr, object, value, types,
name);
} else {
+ Drop(2);
instr = BuildStoreNamedGeneric(object, name, value);
}
+
+ Push(value);
+ instr->set_position(expr->position());
+ AddInstruction(instr);
+ if (instr->HasObservableSideEffects())
AddSimulate(expr->AssignmentId());
+ return ast_context()->ReturnValue(Pop());
} else {
// Keyed store.
CHECK_ALIVE(VisitForValue(prop->key()));
CHECK_ALIVE(VisitForValue(expr->value()));
- value = Pop();
+ HValue* value = Pop();
HValue* key = Pop();
HValue* object = Pop();
bool has_side_effects = false;
@@ -5263,11 +5261,6 @@
AddSimulate(expr->AssignmentId());
return ast_context()->ReturnValue(Pop());
}
- Push(value);
- instr->set_position(expr->position());
- AddInstruction(instr);
- if (instr->HasObservableSideEffects()) AddSimulate(expr->AssignmentId());
- return ast_context()->ReturnValue(Pop());
}
@@ -5401,7 +5394,13 @@
HInstruction* load;
if (prop->IsMonomorphic()) {
map = prop->GetReceiverTypes()->first();
- load = BuildLoadNamedMonomorphic(object, name, prop, map);
+ Handle<AccessorPair> accessors;
+ Handle<JSObject> holder;
+ if (LookupAccessorPair(map, name, &accessors, &holder)) {
+ load = BuildCallGetter(object, map, accessors, holder);
+ } else {
+ load = BuildLoadNamedMonomorphic(object, name, prop, map);
+ }
} else {
load = BuildLoadNamedGeneric(object, name, prop);
}
@@ -5421,10 +5420,16 @@
// If we don't know the monomorphic type, do a generic store.
CHECK_ALIVE(store = BuildStoreNamedGeneric(object, name, instr));
} else {
- CHECK_ALIVE(store = BuildStoreNamedMonomorphic(object,
- name,
- instr,
- map));
+ Handle<AccessorPair> accessors;
+ Handle<JSObject> holder;
+ if (LookupAccessorPair(map, name, &accessors, &holder)) {
+ store = BuildCallSetter(object, instr, map, accessors, holder);
+ } else {
+ CHECK_ALIVE(store = BuildStoreNamedMonomorphic(object,
+ name,
+ instr,
+ map));
+ }
}
AddInstruction(store);
// Drop the simulated receiver and value. Return the value.
@@ -5669,6 +5674,40 @@
AddInstruction(new(zone()) HPushArgument(object));
return new(zone()) HCallConstantFunction(getter, 1);
}
+
+
+bool HGraphBuilder::LookupAccessorPair(Handle<Map> map,
+ Handle<String> name,
+ Handle<AccessorPair>* accessors,
+ Handle<JSObject>* holder) {
+ LookupResult lookup(isolate());
+
+ // Check for a JavaScript accessor directly in the map.
+ map->LookupDescriptor(NULL, *name, &lookup);
+ if (lookup.IsPropertyCallbacks()) {
+ Handle<Object> callback(lookup.GetValueFromMap(*map));
+ if (!callback->IsAccessorPair()) return false;
+ *accessors = Handle<AccessorPair>::cast(callback);
+ *holder = Handle<JSObject>();
+ return true;
+ }
+
+ // Everything else, e.g. a field, can't be an accessor call.
+ if (lookup.IsFound()) return false;
+
+ // Check for a JavaScript accessor somewhere in the proto chain.
+ LookupInPrototypes(map, name, &lookup);
+ if (lookup.IsPropertyCallbacks()) {
+ Handle<Object> callback(lookup.GetValue());
+ if (!callback->IsAccessorPair()) return false;
+ *accessors = Handle<AccessorPair>::cast(callback);
+ *holder = Handle<JSObject>(lookup.holder());
+ return true;
+ }
+
+ // We haven't found a JavaScript accessor anywhere.
+ return false;
+}
HInstruction* HGraphBuilder::BuildLoadNamedMonomorphic(HValue* object,
@@ -5689,29 +5728,6 @@
Handle<JSFunction> function(lookup.GetConstantFunctionFromMap(*map));
return new(zone()) HConstant(function, Representation::Tagged());
}
-
- // Handle a known getter directly in the receiver.
- if (lookup.IsPropertyCallbacks()) {
- Handle<Object> callback(lookup.GetValueFromMap(*map));
- Handle<JSObject> holder;
- if (!callback->IsAccessorPair()) {
- return BuildLoadNamedGeneric(object, name, expr);
- }
- Handle<AccessorPair> accessors = Handle<AccessorPair>::cast(callback);
- return BuildCallGetter(object, map, accessors, holder);
- }
-
- // Handle a known getter somewhere in the prototype chain.
- LookupInPrototypes(map, name, &lookup);
- if (lookup.IsPropertyCallbacks()) {
- Handle<Object> callback(lookup.GetValue());
- Handle<JSObject> holder(lookup.holder());
- if (!callback->IsAccessorPair()) {
- return BuildLoadNamedGeneric(object, name, expr);
- }
- Handle<AccessorPair> accessors =
Handle<AccessorPair>::cast(callback);
- return BuildCallGetter(object, map, accessors, holder);
- }
// No luck, do a generic load.
return BuildLoadNamedGeneric(object, name, expr);
@@ -6331,15 +6347,23 @@
Handle<String> name = expr->key()->AsLiteral()->AsPropertyName();
SmallMapList* types = expr->GetReceiverTypes();
- HValue* obj = Pop();
if (expr->IsMonomorphic()) {
- instr = BuildLoadNamedMonomorphic(obj, name, expr, types->first());
+ Handle<Map> map = types->first();
+ Handle<AccessorPair> accessors;
+ Handle<JSObject> holder;
+ if (LookupAccessorPair(map, name, &accessors, &holder)) {
+ AddCheckConstantFunction(holder, Top(), map, true);
+ Handle<JSFunction> getter(JSFunction::cast(accessors->getter()));
+ if (FLAG_inline_accessors && TryInlineGetter(getter, expr)) return;
+ AddInstruction(new(zone()) HPushArgument(Pop()));
+ instr = new(zone()) HCallConstantFunction(getter, 1);
+ } else {
+ instr = BuildLoadNamedMonomorphic(Pop(), name, expr, map);
+ }
} else if (types != NULL && types->length() > 1) {
- AddInstruction(new(zone()) HCheckNonSmi(obj));
- HandlePolymorphicLoadNamedField(expr, obj, types, name);
- return;
+ return HandlePolymorphicLoadNamedField(expr, Pop(), types, name);
} else {
- instr = BuildLoadNamedGeneric(obj, name, expr);
+ instr = BuildLoadNamedGeneric(Pop(), name, expr);
}
} else {
@@ -6898,6 +6922,18 @@
expr->ReturnId(),
CONSTRUCT_CALL_RETURN);
}
+
+
+bool HGraphBuilder::TryInlineGetter(Handle<JSFunction> getter,
+ Property* prop) {
+ return TryInline(CALL_AS_METHOD,
+ getter,
+ 0,
+ NULL,
+ prop->id(),
+ prop->ReturnId(),
+ NORMAL_RETURN);
+}
bool HGraphBuilder::TryInlineBuiltinFunctionCall(Call* expr, bool
drop_extra) {
@@ -7823,7 +7859,13 @@
HInstruction* load;
if (prop->IsMonomorphic()) {
map = prop->GetReceiverTypes()->first();
- load = BuildLoadNamedMonomorphic(object, name, prop, map);
+ Handle<AccessorPair> accessors;
+ Handle<JSObject> holder;
+ if (LookupAccessorPair(map, name, &accessors, &holder)) {
+ load = BuildCallGetter(object, map, accessors, holder);
+ } else {
+ load = BuildLoadNamedMonomorphic(object, name, prop, map);
+ }
} else {
load = BuildLoadNamedGeneric(object, name, prop);
}
@@ -7838,10 +7880,16 @@
// If we don't know the monomorphic type, do a generic store.
CHECK_ALIVE(store = BuildStoreNamedGeneric(object, name, after));
} else {
- CHECK_ALIVE(store = BuildStoreNamedMonomorphic(object,
- name,
- after,
- map));
+ Handle<AccessorPair> accessors;
+ Handle<JSObject> holder;
+ if (LookupAccessorPair(map, name, &accessors, &holder)) {
+ store = BuildCallSetter(object, after, map, accessors, holder);
+ } else {
+ CHECK_ALIVE(store = BuildStoreNamedMonomorphic(object,
+ name,
+ after,
+ map));
+ }
}
AddInstruction(store);
=======================================
--- /trunk/src/hydrogen.h Fri Jul 27 01:03:27 2012
+++ /trunk/src/hydrogen.h Mon Jul 30 06:05:33 2012
@@ -1040,6 +1040,7 @@
bool TryInlineCall(Call* expr, bool drop_extra = false);
bool TryInlineConstruct(CallNew* expr, HValue* receiver);
+ bool TryInlineGetter(Handle<JSFunction> getter, Property* prop);
bool TryInlineBuiltinMethodCall(Call* expr,
HValue* receiver,
Handle<Map> receiver_map,
@@ -1088,21 +1089,6 @@
HValue* right);
HInstruction* BuildIncrement(bool returns_original_input,
CountOperation* expr);
- HLoadNamedField* BuildLoadNamedField(HValue* object,
- Handle<Map> map,
- LookupResult* result,
- bool smi_and_map_check);
- HInstruction* BuildLoadNamedGeneric(HValue* object,
- Handle<String> name,
- Property* expr);
- HInstruction* BuildLoadKeyedGeneric(HValue* object, HValue* key);
- HInstruction* BuildExternalArrayElementAccess(
- HValue* external_elements,
- HValue* checked_key,
- HValue* val,
- HValue* dependency,
- ElementsKind elements_kind,
- bool is_store);
HInstruction* BuildFastElementAccess(HValue* elements,
HValue* checked_key,
HValue* val,
@@ -1147,6 +1133,22 @@
bool is_store,
bool* has_side_effects);
+ // Tries to find a JavaScript accessor of the given name in the prototype
+ // chain starting at the given map. Return true iff there is one,
including
+ // the corresponding AccessorPair plus its holder (which could be null
when
+ // the accessor is found directly in the given map).
+ bool LookupAccessorPair(Handle<Map> map,
+ Handle<String> name,
+ Handle<AccessorPair>* accessors,
+ Handle<JSObject>* holder);
+
+ HLoadNamedField* BuildLoadNamedField(HValue* object,
+ Handle<Map> map,
+ LookupResult* result,
+ bool smi_and_map_check);
+ HInstruction* BuildLoadNamedGeneric(HValue* object,
+ Handle<String> name,
+ Property* expr);
HInstruction* BuildCallGetter(HValue* object,
Handle<Map> map,
Handle<AccessorPair> accessors,
@@ -1155,15 +1157,15 @@
Handle<String> name,
Property* expr,
Handle<Map> map);
- HInstruction* BuildCallSetter(HValue* object,
- HValue* value,
- Handle<Map> map,
- Handle<AccessorPair> accessors,
- Handle<JSObject> holder);
- HInstruction* BuildStoreNamedMonomorphic(HValue* object,
- Handle<String> name,
- HValue* value,
- Handle<Map> map);
+ HInstruction* BuildLoadKeyedGeneric(HValue* object, HValue* key);
+ HInstruction* BuildExternalArrayElementAccess(
+ HValue* external_elements,
+ HValue* checked_key,
+ HValue* val,
+ HValue* dependency,
+ ElementsKind elements_kind,
+ bool is_store);
+
HInstruction* BuildStoreNamedField(HValue* object,
Handle<String> name,
HValue* value,
@@ -1173,6 +1175,15 @@
HInstruction* BuildStoreNamedGeneric(HValue* object,
Handle<String> name,
HValue* value);
+ HInstruction* BuildCallSetter(HValue* object,
+ HValue* value,
+ Handle<Map> map,
+ Handle<AccessorPair> accessors,
+ Handle<JSObject> holder);
+ HInstruction* BuildStoreNamedMonomorphic(HValue* object,
+ Handle<String> name,
+ HValue* value,
+ Handle<Map> map);
HInstruction* BuildStoreKeyedGeneric(HValue* object,
HValue* key,
HValue* value);
=======================================
--- /trunk/src/ia32/full-codegen-ia32.cc Wed Jul 25 08:01:47 2012
+++ /trunk/src/ia32/full-codegen-ia32.cc Mon Jul 30 06:05:33 2012
@@ -2214,6 +2214,7 @@
VisitForAccumulatorValue(expr->obj());
__ mov(edx, result_register());
EmitNamedPropertyLoad(expr);
+ PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
context()->Plug(eax);
} else {
VisitForStackValue(expr->obj());
=======================================
--- /trunk/src/mark-compact.cc Fri Jul 27 01:03:27 2012
+++ /trunk/src/mark-compact.cc Mon Jul 30 06:05:33 2012
@@ -223,6 +223,99 @@
VerifyEvacuationVisitor visitor;
heap->IterateStrongRoots(&visitor, VISIT_ALL);
}
+
+
+class VerifyGlobalContextSeparationVisitor: public ObjectVisitor {
+ public:
+ VerifyGlobalContextSeparationVisitor() : current_global_context_(NULL) {}
+
+ void VisitPointers(Object** start, Object** end) {
+ for (Object** current = start; current < end; current++) {
+ if ((*current)->IsHeapObject()) {
+ HeapObject* object = HeapObject::cast(*current);
+ if (object->IsString()) continue;
+ switch (object->map()->instance_type()) {
+ case JS_FUNCTION_TYPE:
+ CheckContext(JSFunction::cast(object)->context());
+ break;
+ case JS_GLOBAL_PROXY_TYPE:
+ CheckContext(JSGlobalProxy::cast(object)->context());
+ break;
+ case JS_GLOBAL_OBJECT_TYPE:
+ case JS_BUILTINS_OBJECT_TYPE:
+ CheckContext(GlobalObject::cast(object)->global_context());
+ break;
+ case JS_ARRAY_TYPE:
+ case JS_DATE_TYPE:
+ case JS_OBJECT_TYPE:
+ case JS_REGEXP_TYPE:
+ VisitPointer(HeapObject::RawField(object,
JSObject::kMapOffset));
+ break;
+ case MAP_TYPE:
+ VisitPointer(HeapObject::RawField(object,
Map::kPrototypeOffset));
+ VisitPointer(HeapObject::RawField(object,
Map::kConstructorOffset));
+ break;
+ case FIXED_ARRAY_TYPE:
+ if (object->IsContext()) {
+ CheckContext(object);
+ } else {
+ FixedArray* array = FixedArray::cast(object);
+ int length = array->length();
+ // Set array length to zero to prevent cycles while iterating
+ // over array bodies, this is easier than intrusive marking.
+ array->set_length(0);
+ array->IterateBody(
+ FIXED_ARRAY_TYPE, FixedArray::SizeFor(length), this);
+ array->set_length(length);
+ }
+ break;
+ case JS_GLOBAL_PROPERTY_CELL_TYPE:
+ case JS_PROXY_TYPE:
+ case JS_VALUE_TYPE:
+ case TYPE_FEEDBACK_INFO_TYPE:
+ object->Iterate(this);
+ break;
+ case ACCESSOR_INFO_TYPE:
+ case BYTE_ARRAY_TYPE:
+ case CALL_HANDLER_INFO_TYPE:
+ case CODE_TYPE:
+ case FIXED_DOUBLE_ARRAY_TYPE:
+ case HEAP_NUMBER_TYPE:
+ case INTERCEPTOR_INFO_TYPE:
+ case ODDBALL_TYPE:
+ case SCRIPT_TYPE:
+ case SHARED_FUNCTION_INFO_TYPE:
+ break;
+ default:
+ UNREACHABLE();
+ }
+ }
+ }
+ }
+
+ private:
+ void CheckContext(Object* context) {
+ if (!context->IsContext()) return;
+ Context* global_context = Context::cast(context)->global_context();
+ if (current_global_context_ == NULL) {
+ current_global_context_ = global_context;
+ } else {
+ CHECK_EQ(current_global_context_, global_context);
+ }
+ }
+
+ Context* current_global_context_;
+};
+
+
+static void VerifyGlobalContextSeparation(Heap* heap) {
+ HeapObjectIterator it(heap->code_space());
+
+ for (Object* object = it.Next(); object != NULL; object = it.Next()) {
+ VerifyGlobalContextSeparationVisitor visitor;
+ Code::cast(object)->CodeIterateBody(&visitor);
+ }
+}
#endif
@@ -296,6 +389,12 @@
if (!FLAG_collect_maps) ReattachInitialMaps();
+#ifdef DEBUG
+ if (FLAG_verify_global_context_separation) {
+ VerifyGlobalContextSeparation(heap_);
+ }
+#endif
+
Finish();
tracer_ = NULL;
=======================================
--- /trunk/src/mips/full-codegen-mips.cc Wed Jul 25 08:01:47 2012
+++ /trunk/src/mips/full-codegen-mips.cc Mon Jul 30 06:05:33 2012
@@ -2299,6 +2299,7 @@
if (key->IsPropertyName()) {
VisitForAccumulatorValue(expr->obj());
EmitNamedPropertyLoad(expr);
+ PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
context()->Plug(v0);
} else {
VisitForStackValue(expr->obj());
=======================================
--- /trunk/src/objects-printer.cc Tue Jul 10 04:28:27 2012
+++ /trunk/src/objects-printer.cc Mon Jul 30 06:05:33 2012
@@ -596,9 +596,9 @@
void TypeFeedbackInfo::TypeFeedbackInfoPrint(FILE* out) {
HeapObject::PrintHeader(out, "TypeFeedbackInfo");
- PrintF(out, "\n - ic_total_count: %d, ic_with_type_info_count: %d",
+ PrintF(out, " - ic_total_count: %d, ic_with_type_info_count: %d\n",
ic_total_count(), ic_with_type_info_count());
- PrintF(out, "\n - type_feedback_cells: ");
+ PrintF(out, " - type_feedback_cells: ");
type_feedback_cells()->FixedArrayPrint(out);
}
@@ -794,7 +794,14 @@
code()->ShortPrint(out);
if (HasSourceCode()) {
PrintF(out, "\n - source code = ");
- GetSourceCode()->ShortPrint(out);
+ String* source = String::cast(Script::cast(script())->source());
+ int start = start_position();
+ int length = end_position() - start;
+ SmartArrayPointer<char> source_string =
+ source->ToCString(DISALLOW_NULLS,
+ FAST_STRING_TRAVERSAL,
+ start, length, NULL);
+ PrintF(out, "%s", *source_string);
}
// Script files are often large, hard to read.
// PrintF(out, "\n - script =");
@@ -815,7 +822,7 @@
void JSGlobalProxy::JSGlobalProxyPrint(FILE* out) {
- PrintF(out, "global_proxy");
+ PrintF(out, "global_proxy ");
JSObjectPrint(out);
PrintF(out, "context : ");
context()->ShortPrint(out);
=======================================
--- /trunk/src/objects.cc Fri Jul 27 01:03:27 2012
+++ /trunk/src/objects.cc Mon Jul 30 06:05:33 2012
@@ -2646,7 +2646,7 @@
String* name_raw, DeleteMode mode) {
Isolate* isolate = GetIsolate();
HandleScope scope(isolate);
- Handle<Object> receiver(this);
+ Handle<JSProxy> receiver(this);
Handle<Object> name(name_raw);
Handle<Object> args[] = { name };
@@ -2656,8 +2656,9 @@
Object* bool_result = result->ToBoolean();
if (mode == STRICT_DELETION && bool_result == GetHeap()->false_value()) {
+ Handle<Object> handler(receiver->handler());
Handle<String> trap_name =
isolate->factory()->LookupAsciiSymbol("delete");
- Handle<Object> args[] = { Handle<Object>(handler()), trap_name };
+ Handle<Object> args[] = { handler, trap_name };
Handle<Object> error = isolate->factory()->NewTypeError(
"handler_failed", HandleVector(args, ARRAY_SIZE(args)));
isolate->Throw(*error);
@@ -7217,6 +7218,7 @@
if (!HasTransitionArray()) return;
TransitionArray* t = transitions();
+ MarkCompactCollector* collector = heap->mark_compact_collector();
int transition_index = 0;
@@ -7225,14 +7227,11 @@
if (!ClearBackPointer(heap, t->GetTarget(i))) {
if (i != transition_index) {
String* key = t->GetKey(i);
- Map* target = t->GetTarget(i);
t->SetKey(transition_index, key);
- t->SetTarget(transition_index, target);
- MarkCompactCollector* collector = heap->mark_compact_collector();
Object** key_slot = t->GetKeySlot(transition_index);
collector->RecordSlot(key_slot, key_slot, key);
- Object** target_slot = t->GetTargetSlot(transition_index);
- collector->RecordSlot(target_slot, target_slot, target);
+ // Target slots do not need to be recorded since maps are not
compacted.
+ t->SetTarget(transition_index, t->GetTarget(i));
}
transition_index++;
}
@@ -8511,6 +8510,8 @@
PrintF(out, "\n");
}
PrintF(out, "\n");
+ // Just print if type feedback info is ever used for optimized code.
+ ASSERT(type_feedback_info()->IsUndefined());
} else if (kind() == FUNCTION) {
unsigned offset = stack_check_table_offset();
// If there is no stack check table, the "table start" will at or after
@@ -8527,6 +8528,10 @@
}
PrintF(out, "\n");
}
+ if (!type_feedback_info()->IsUndefined()) {
+
TypeFeedbackInfo::cast(type_feedback_info())->TypeFeedbackInfoPrint(out);
+ PrintF(out, "\n");
+ }
}
PrintF("RelocInfo (size = %d)\n", relocation_size());
@@ -9666,8 +9671,9 @@
// Don't allow element properties to be redefined for external arrays.
if (HasExternalArrayElements() && set_mode == DEFINE_PROPERTY) {
Isolate* isolate = GetHeap()->isolate();
+ Handle<Object> receiver(this);
Handle<Object> number = isolate->factory()->NewNumberFromUint(index);
- Handle<Object> args[] = { Handle<Object>(this), number };
+ Handle<Object> args[] = { receiver, number };
Handle<Object> error = isolate->factory()->NewTypeError(
"redef_external_array_element", HandleVector(args,
ARRAY_SIZE(args)));
return isolate->Throw(*error);
=======================================
--- /trunk/src/runtime.cc Tue Jul 24 00:59:48 2012
+++ /trunk/src/runtime.cc Mon Jul 30 06:05:33 2012
@@ -3755,8 +3755,8 @@
} else {
CONVERT_DOUBLE_ARG_CHECKED(from_number, 1);
CONVERT_DOUBLE_ARG_CHECKED(to_number, 2);
- start = FastD2I(from_number);
- end = FastD2I(to_number);
+ start = FastD2IChecked(from_number);
+ end = FastD2IChecked(to_number);
}
RUNTIME_ASSERT(end >= start);
RUNTIME_ASSERT(start >= 0);
@@ -4224,7 +4224,7 @@
return *isolate->factory()->infinity_symbol();
}
CONVERT_DOUBLE_ARG_CHECKED(f_number, 1);
- int f = FastD2I(f_number);
+ int f = FastD2IChecked(f_number);
RUNTIME_ASSERT(f >= 0);
char* str = DoubleToFixedCString(value, f);
MaybeObject* res =
@@ -4249,7 +4249,7 @@
return *isolate->factory()->infinity_symbol();
}
CONVERT_DOUBLE_ARG_CHECKED(f_number, 1);
- int f = FastD2I(f_number);
+ int f = FastD2IChecked(f_number);
RUNTIME_ASSERT(f >= -1 && f <= 20);
char* str = DoubleToExponentialCString(value, f);
MaybeObject* res =
@@ -4274,7 +4274,7 @@
return *isolate->factory()->infinity_symbol();
}
CONVERT_DOUBLE_ARG_CHECKED(f_number, 1);
- int f = FastD2I(f_number);
+ int f = FastD2IChecked(f_number);
RUNTIME_ASSERT(f >= 1 && f <= 21);
char* str = DoubleToPrecisionCString(value, f);
MaybeObject* res =
=======================================
--- /trunk/src/transitions-inl.h Tue Jul 24 00:59:48 2012
+++ /trunk/src/transitions-inl.h Mon Jul 30 06:05:33 2012
@@ -142,14 +142,6 @@
ASSERT(transition_number < number_of_transitions());
return Map::cast(get(ToTargetIndex(transition_number)));
}
-
-
-Object** TransitionArray::GetTargetSlot(int transition_number) {
- ASSERT(transition_number < number_of_transitions());
- return HeapObject::RawField(
- reinterpret_cast<HeapObject*>(this),
- OffsetOfElementAt(ToTargetIndex(transition_number)));
-}
void TransitionArray::SetTarget(int transition_number, Map* value) {
=======================================
--- /trunk/src/transitions.h Tue Jul 24 00:59:48 2012
+++ /trunk/src/transitions.h Mon Jul 30 06:05:33 2012
@@ -53,7 +53,6 @@
inline Map* GetTarget(int transition_number);
inline void SetTarget(int transition_number, Map* target);
- inline Object** GetTargetSlot(int transition_number);
inline PropertyDetails GetTargetDetails(int transition_number);
=======================================
--- /trunk/src/version.cc Fri Jul 27 01:03:27 2012
+++ /trunk/src/version.cc Mon Jul 30 06:05:33 2012
@@ -34,7 +34,7 @@
// cannot be changed without changing the SCons build script.
#define MAJOR_VERSION 3
#define MINOR_VERSION 12
-#define BUILD_NUMBER 17
+#define BUILD_NUMBER 18
#define PATCH_LEVEL 0
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
=======================================
--- /trunk/src/x64/full-codegen-x64.cc Wed Jul 25 08:01:47 2012
+++ /trunk/src/x64/full-codegen-x64.cc Mon Jul 30 06:05:33 2012
@@ -2188,6 +2188,7 @@
if (key->IsPropertyName()) {
VisitForAccumulatorValue(expr->obj());
EmitNamedPropertyLoad(expr);
+ PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
context()->Plug(rax);
} else {
VisitForStackValue(expr->obj());
=======================================
--- /trunk/test/cctest/test-heap.cc Tue Jul 24 00:59:48 2012
+++ /trunk/test/cctest/test-heap.cc Mon Jul 30 06:05:33 2012
@@ -1966,3 +1966,21 @@
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
CHECK(SlicedString::cast(*slice)->parent()->IsSeqAsciiString());
}
+
+
+#ifdef OBJECT_PRINT
+TEST(PrintSharedFunctionInfo) {
+ InitializeVM();
+ v8::HandleScope scope;
+ const char* source = "f = function() { return 987654321; }\n"
+ "g = function() { return 123456789; }\n";
+ CompileRun(source);
+ Handle<JSFunction> g =
+ v8::Utils::OpenHandle(
+ *v8::Handle<v8::Function>::Cast(
+ v8::Context::GetCurrent()->Global()->Get(v8_str("g"))));
+
+ AssertNoAllocation no_alloc;
+ g->shared()->PrintLn();
+}
+#endif // OBJECT_PRINT
=======================================
--- /trunk/test/cctest/test-utils.cc Mon Jan 16 03:42:08 2012
+++ /trunk/test/cctest/test-utils.cc Mon Jul 30 06:05:33 2012
@@ -55,6 +55,22 @@
CHECK_EQ(-2, -8 >> 2);
CHECK_EQ(-2, static_cast<int8_t>(-8) >> 2);
CHECK_EQ(-2, static_cast<int>(static_cast<intptr_t>(-8) >> 2));
+
+ CHECK_EQ(-1000000, FastD2IChecked(-1000000.0));
+ CHECK_EQ(-1, FastD2IChecked(-1.0));
+ CHECK_EQ(0, FastD2IChecked(0.0));
+ CHECK_EQ(1, FastD2IChecked(1.0));
+ CHECK_EQ(1000000, FastD2IChecked(1000000.0));
+
+ CHECK_EQ(-1000000, FastD2IChecked(-1000000.123));
+ CHECK_EQ(-1, FastD2IChecked(-1.234));
+ CHECK_EQ(0, FastD2IChecked(0.345));
+ CHECK_EQ(1, FastD2IChecked(1.234));
+ CHECK_EQ(1000000, FastD2IChecked(1000000.123));
+
+ CHECK_EQ(INT_MAX, FastD2IChecked(1.0e100));
+ CHECK_EQ(INT_MIN, FastD2IChecked(-1.0e100));
+ CHECK_EQ(INT_MIN, FastD2IChecked(OS::nan_value()));
}
=======================================
--- /trunk/tools/android-build.sh Tue Jul 24 00:59:48 2012
+++ /trunk/tools/android-build.sh Mon Jul 30 06:05:33 2012
@@ -1,97 +0,0 @@
-#!/bin/bash
-# Copyright 2012 the V8 project authors. All rights reserved.
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided
-# with the distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-if [ ${#@} -lt 4 ] ; then
- echo "$0: Error: needs 4 arguments."
- exit 1
-fi
-
-ARCH=$1
-MODE=$2
-OUTDIR=$3
-GYPFLAGS=$4
-
-host_os=$(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')
-
-case "${host_os}" in
- "linux")
- toolchain_dir="linux-x86"
- ;;
- "mac")
- toolchain_dir="darwin-x86"
- ;;
- *)
- echo "$0: Host platform ${host_os} is not supported" >& 2
- exit 1
-esac
-
-case "${ARCH}" in
- "android_arm")
- DEFINES=" target_arch=arm v8_target_arch=arm android_target_arch=arm"
- DEFINES+=" arm_neon=0 armv7=1"
- toolchain_arch="arm-linux-androideabi-4.4.3"
- ;;
- "android_ia32")
- DEFINES=" target_arch=ia32 v8_target_arch=ia32 android_target_arch=x86"
- toolchain_arch="x86-4.4.3"
- ;;
- *)
- echo "$0: Target architecture ${ARCH} is not supported." >& 2
- echo "$0: Current supported architectures: android_arm|android_ia32."
& 2
- exit 1
-esac
-
-toolchain_path="${ANDROID_NDK_ROOT}/toolchains/${toolchain_arch}/prebuilt/"
-ANDROID_TOOLCHAIN="${toolchain_path}/${toolchain_dir}/bin"
-if [ ! -d "${ANDROID_TOOLCHAIN}" ]; then
- echo "$0: Cannot find Android toolchain in ${ANDROID_TOOLCHAIN}." >& 2
- echo "$0: The NDK version might be wrong." >& 2
- exit 1
-fi
-
-# For mksnapshot host generation.
-DEFINES+=" host_os=${host_os}"
-
-# The set of GYP_DEFINES to pass to gyp.
-export GYP_DEFINES="${DEFINES}"
-
-# Use the "android" flavor of the Makefile generator for both Linux and OS
X.
-export GYP_GENERATORS=make-android
-export CC=${ANDROID_TOOLCHAIN}/*-gcc
-export CXX=${ANDROID_TOOLCHAIN}/*-g++
-build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \
- -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \
- -S.${ARCH} ${GYPFLAGS}
-
-export AR=${ANDROID_TOOLCHAIN}/*-ar
-export RANLIB=${ANDROID_TOOLCHAIN}/*-ranlib
-export LD=${ANDROID_TOOLCHAIN}/*-ld
-export LINK=${ANDROID_TOOLCHAIN}/*-g++
-export BUILDTYPE=$(echo ${MODE} | python -c "print
raw_input().capitalize()")
-export builddir=${PWD}/${OUTDIR}/${ARCH}.${MODE}
-make -C "${OUTDIR}" -f Makefile.${ARCH}
=======================================
--- /trunk/tools/test.py Thu Jul 12 04:06:03 2012
+++ /trunk/tools/test.py Mon Jul 30 06:05:33 2012
@@ -299,8 +299,6 @@
'status_line': "[%(mins)02i:%(secs)02i|%%%(remaining) 4d|+%(passed)
4d|-%(failed) 4d]: %(test)s",
'stdout': '%s',
'stderr': '%s',
- 'clear': lambda last_line_length: ("\r" + (" " * last_line_length)
+ "\r"),
- 'max_length': 78
}
super(MonochromeProgressIndicator, self).__init__(cases, templates)
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev