diff options
85 files changed, 3932 insertions, 427 deletions
diff --git a/V8Binding/v8/ChangeLog b/V8Binding/v8/ChangeLog index 4bfd8d5..c59661d 100644 --- a/V8Binding/v8/ChangeLog +++ b/V8Binding/v8/ChangeLog @@ -1,3 +1,30 @@ +2009-08-19: Version 1.3.5 + + Optimize initialization of some arrays in the builtins. + + Fix mac-nm script to support filenames with spaces. + + Support for using the V8 profiler when V8 is embedded in a Windows DLL. + + Changed typeof RegExp from 'object' to 'function' for compatibility. + Fixed bug where regexps were not callable across contexts. + + Added context independent script compilation to the API. + + Added API call to get the stack trace for an exception. + + Added API for getting object mirrors. + + Make sure that SSE3 instructions are used whenever possible even when + running off a snapshot generated without using SSE3 instructions. + + Tweaked the handling of the initial size and growth policy of the heap. + + Added native code generation for RegExp to 64-bit version. + + Added JavaScript debugger support to 64-bit version. + + 2009-08-13: Version 1.3.4 Added a readline() command to the d8 shell. diff --git a/V8Binding/v8/include/v8.h b/V8Binding/v8/include/v8.h index b931976..c7cc315 100644 --- a/V8Binding/v8/include/v8.h +++ b/V8Binding/v8/include/v8.h @@ -2223,10 +2223,47 @@ class V8EXPORT V8 { */ static int GetLogLines(int from_pos, char* dest_buf, int max_size); -#if defined(ANDROID) - // TODO: upstream to V8. - static void CollectAllGarbage(); -#endif + /** + * Retrieve the V8 thread id of the calling thread. + * + * The thread id for a thread should only be retrieved after the V8 + * lock has been acquired with a Locker object with that thread. + */ + static int GetCurrentThreadId(); + + /** + * Forcefully terminate execution of a JavaScript thread. This can + * be used to terminate long-running scripts. + * + * TerminateExecution should only be called when then V8 lock has + * been acquired with a Locker object. Therefore, in order to be + * able to terminate long-running threads, preemption must be + * enabled to allow the user of TerminateExecution to acquire the + * lock. + * + * The termination is achieved by throwing an exception that is + * uncatchable by JavaScript exception handlers. Termination + * exceptions act as if they were caught by a C++ TryCatch exception + * handlers. If forceful termination is used, any C++ TryCatch + * exception handler that catches an exception should check if that + * exception is a termination exception and immediately return if + * that is the case. Returning immediately in that case will + * continue the propagation of the termination exception if needed. + * + * The thread id passed to TerminateExecution must have been + * obtained by calling GetCurrentThreadId on the thread in question. + * + * \param thread_id The thread id of the thread to terminate. + */ + static void TerminateExecution(int thread_id); + + /** + * Forcefully terminate the current thread of JavaScript execution. + * + * This method can be used by any thread even if that thread has not + * acquired the V8 lock with a Locker object. + */ + static void TerminateExecution(); /** * Releases any resources used by v8 and stops any utility threads @@ -2247,6 +2284,12 @@ class V8EXPORT V8 { */ static void IdleNotification(bool is_high_priority); + /** + * Optional notification that the system is running low on memory. + * V8 uses these notifications to attempt to free memory. + */ + static void LowMemoryNotification(); + private: V8(); @@ -2286,6 +2329,21 @@ class V8EXPORT TryCatch { bool HasCaught() const; /** + * For certain types of exceptions, it makes no sense to continue + * execution. + * + * Currently, the only type of exception that can be caught by a + * TryCatch handler and for which it does not make sense to continue + * is termination exception. Such exceptions are thrown when the + * TerminateExecution methods are called to terminate a long-running + * script. + * + * If CanContinue returns false, the correct action is to perform + * any C++ cleanup needed and then return. + */ + bool CanContinue() const; + + /** * Returns the exception caught by this try/catch block. If no exception has * been caught an empty handle is returned. * @@ -2341,6 +2399,7 @@ class V8EXPORT TryCatch { void* exception_; void* message_; bool is_verbose_; + bool can_continue_; bool capture_message_; void* js_handler_; }; diff --git a/V8Binding/v8/src/api.cc b/V8Binding/v8/src/api.cc index 19d1173..7d97fc6 100644 --- a/V8Binding/v8/src/api.cc +++ b/V8Binding/v8/src/api.cc @@ -75,7 +75,7 @@ namespace v8 { i::V8::FatalProcessOutOfMemory(NULL); \ } \ bool call_depth_is_zero = thread_local.CallDepthIsZero(); \ - i::Top::optional_reschedule_exception(call_depth_is_zero); \ + i::Top::OptionalRescheduleException(call_depth_is_zero, false); \ return value; \ } \ } while (false) @@ -1208,6 +1208,11 @@ bool v8::TryCatch::HasCaught() const { } +bool v8::TryCatch::CanContinue() const { + return can_continue_; +} + + v8::Local<Value> v8::TryCatch::Exception() const { if (HasCaught()) { // Check for out of memory exception. @@ -2599,10 +2604,18 @@ bool v8::V8::Dispose() { } -void v8::V8::IdleNotification(bool is_high_priority) { +void v8::V8::IdleNotification(bool is_high_priority) { i::V8::IdleNotification(is_high_priority); } + +void v8::V8::LowMemoryNotification() { +#if defined(ANDROID) + i::Heap::CollectAllGarbage(true); +#endif +} + + const char* v8::V8::GetVersion() { static v8::internal::EmbeddedVector<char, 128> buffer; v8::internal::Version::GetString(buffer); @@ -3355,12 +3368,31 @@ int V8::GetLogLines(int from_pos, char* dest_buf, int max_size) { } -#if defined(ANDROID) -void V8::CollectAllGarbage() { - // TODO: call MarkCompact GC - i::Heap::CollectAllGarbage(); +int V8::GetCurrentThreadId() { + API_ENTRY_CHECK("V8::GetCurrentThreadId()"); + EnsureInitialized("V8::GetCurrentThreadId()"); + return i::Top::thread_id(); +} + + +void V8::TerminateExecution(int thread_id) { + if (!i::V8::IsRunning()) return; + API_ENTRY_CHECK("V8::GetCurrentThreadId()"); + // If the thread_id identifies the current thread just terminate + // execution right away. Otherwise, ask the thread manager to + // terminate the thread with the given id if any. + if (thread_id == i::Top::thread_id()) { + i::StackGuard::TerminateExecution(); + } else { + i::ThreadManager::TerminateExecution(thread_id); + } +} + + +void V8::TerminateExecution() { + if (!i::V8::IsRunning()) return; + i::StackGuard::TerminateExecution(); } -#endif String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) { diff --git a/V8Binding/v8/src/arm/assembler-arm.h b/V8Binding/v8/src/arm/assembler-arm.h index eeab4a7..b3ebb8b 100644 --- a/V8Binding/v8/src/arm/assembler-arm.h +++ b/V8Binding/v8/src/arm/assembler-arm.h @@ -430,7 +430,10 @@ class Assembler : public Malloced { // Distance between the instruction referring to the address of the call // target (ldr pc, [target addr in const pool]) and the return address - static const int kTargetAddrToReturnAddrDist = sizeof(Instr); + static const int kPatchReturnSequenceLength = sizeof(Instr); + // Distance between start of patched return sequence and the emitted address + // to jump to. + static const int kPatchReturnSequenceAddressOffset = 1; // --------------------------------------------------------------------------- diff --git a/V8Binding/v8/src/arm/builtins-arm.cc b/V8Binding/v8/src/arm/builtins-arm.cc index b5332ec..28524c8 100644 --- a/V8Binding/v8/src/arm/builtins-arm.cc +++ b/V8Binding/v8/src/arm/builtins-arm.cc @@ -39,7 +39,7 @@ namespace internal { void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) { - // TODO(1238487): Don't pass the function in a static variable. + // TODO(428): Don't pass the function in a static variable. __ mov(ip, Operand(ExternalReference::builtin_passed_function())); __ str(r1, MemOperand(ip, 0)); diff --git a/V8Binding/v8/src/arm/codegen-arm.cc b/V8Binding/v8/src/arm/codegen-arm.cc index d3507ec..71ffaa2 100644 --- a/V8Binding/v8/src/arm/codegen-arm.cc +++ b/V8Binding/v8/src/arm/codegen-arm.cc @@ -5701,7 +5701,8 @@ void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) { } -void CEntryStub::GenerateThrowOutOfMemory(MacroAssembler* masm) { +void CEntryStub::GenerateThrowUncatchable(MacroAssembler* masm, + UncatchableExceptionType type) { // Adjust this code if not the case. ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); @@ -5725,20 +5726,22 @@ void CEntryStub::GenerateThrowOutOfMemory(MacroAssembler* masm) { // Set the top handler address to next handler past the current ENTRY handler. ASSERT(StackHandlerConstants::kNextOffset == 0); - __ pop(r0); - __ str(r0, MemOperand(r3)); - - // Set external caught exception to false. - ExternalReference external_caught(Top::k_external_caught_exception_address); - __ mov(r0, Operand(false)); - __ mov(r2, Operand(external_caught)); - __ str(r0, MemOperand(r2)); + __ pop(r2); + __ str(r2, MemOperand(r3)); - // Set pending exception and r0 to out of memory exception. - Failure* out_of_memory = Failure::OutOfMemoryException(); - __ mov(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); - __ mov(r2, Operand(ExternalReference(Top::k_pending_exception_address))); - __ str(r0, MemOperand(r2)); + if (type == OUT_OF_MEMORY) { + // Set external caught exception to false. + ExternalReference external_caught(Top::k_external_caught_exception_address); + __ mov(r0, Operand(false)); + __ mov(r2, Operand(external_caught)); + __ str(r0, MemOperand(r2)); + + // Set pending exception and r0 to out of memory exception. + Failure* out_of_memory = Failure::OutOfMemoryException(); + __ mov(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); + __ mov(r2, Operand(ExternalReference(Top::k_pending_exception_address))); + __ str(r0, MemOperand(r2)); + } // Stack layout at this point. See also StackHandlerConstants. // sp -> state (ENTRY) @@ -5768,6 +5771,7 @@ void CEntryStub::GenerateThrowOutOfMemory(MacroAssembler* masm) { void CEntryStub::GenerateCore(MacroAssembler* masm, Label* throw_normal_exception, + Label* throw_termination_exception, Label* throw_out_of_memory_exception, StackFrame::Type frame_type, bool do_gc, @@ -5838,10 +5842,10 @@ void CEntryStub::GenerateCore(MacroAssembler* masm, __ tst(r0, Operand(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize)); __ b(eq, &retry); - Label continue_exception; - // If the returned failure is EXCEPTION then promote Top::pending_exception(). - __ cmp(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); - __ b(ne, &continue_exception); + // Special handling of out of memory exceptions. + Failure* out_of_memory = Failure::OutOfMemoryException(); + __ cmp(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); + __ b(eq, throw_out_of_memory_exception); // Retrieve the pending exception and clear the variable. __ mov(ip, Operand(ExternalReference::the_hole_value_location())); @@ -5850,11 +5854,10 @@ void CEntryStub::GenerateCore(MacroAssembler* masm, __ ldr(r0, MemOperand(ip)); __ str(r3, MemOperand(ip)); - __ bind(&continue_exception); - // Special handling of out of memory exception. - Failure* out_of_memory = Failure::OutOfMemoryException(); - __ cmp(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); - __ b(eq, throw_out_of_memory_exception); + // Special handling of termination exceptions which are uncatchable + // by javascript code. + __ cmp(r0, Operand(Factory::termination_exception())); + __ b(eq, throw_termination_exception); // Handle normal exception. __ jmp(throw_normal_exception); @@ -5887,24 +5890,23 @@ void CEntryStub::GenerateBody(MacroAssembler* masm, bool is_debug_break) { // r5: pointer to builtin function (C callee-saved) // r6: pointer to first argument (C callee-saved) - Label throw_out_of_memory_exception; Label throw_normal_exception; + Label throw_termination_exception; + Label throw_out_of_memory_exception; - // Call into the runtime system. Collect garbage before the call if - // running with --gc-greedy set. - if (FLAG_gc_greedy) { - Failure* failure = Failure::RetryAfterGC(0); - __ mov(r0, Operand(reinterpret_cast<intptr_t>(failure))); - } - GenerateCore(masm, &throw_normal_exception, + // Call into the runtime system. + GenerateCore(masm, + &throw_normal_exception, + &throw_termination_exception, &throw_out_of_memory_exception, frame_type, - FLAG_gc_greedy, + false, false); // Do space-specific GC and retry runtime call. GenerateCore(masm, &throw_normal_exception, + &throw_termination_exception, &throw_out_of_memory_exception, frame_type, true, @@ -5915,14 +5917,17 @@ void CEntryStub::GenerateBody(MacroAssembler* masm, bool is_debug_break) { __ mov(r0, Operand(reinterpret_cast<int32_t>(failure))); GenerateCore(masm, &throw_normal_exception, + &throw_termination_exception, &throw_out_of_memory_exception, frame_type, true, true); __ bind(&throw_out_of_memory_exception); - GenerateThrowOutOfMemory(masm); - // control flow for generated will not return. + GenerateThrowUncatchable(masm, OUT_OF_MEMORY); + + __ bind(&throw_termination_exception); + GenerateThrowUncatchable(masm, TERMINATION); __ bind(&throw_normal_exception); GenerateThrowTOS(masm); diff --git a/V8Binding/v8/src/arm/macro-assembler-arm.cc b/V8Binding/v8/src/arm/macro-assembler-arm.cc index 875c91e..4b02e2d 100644 --- a/V8Binding/v8/src/arm/macro-assembler-arm.cc +++ b/V8Binding/v8/src/arm/macro-assembler-arm.cc @@ -132,7 +132,7 @@ void MacroAssembler::Call(intptr_t target, RelocInfo::Mode rmode, // and the target address of the call would be referenced by the first // instruction rather than the second one, which would make it harder to patch // (two instructions before the return address, instead of one). - ASSERT(kTargetAddrToReturnAddrDist == sizeof(Instr)); + ASSERT(kPatchReturnSequenceLength == sizeof(Instr)); } diff --git a/V8Binding/v8/src/assembler.h b/V8Binding/v8/src/assembler.h index 879ee54..1ddc8a3 100644 --- a/V8Binding/v8/src/assembler.h +++ b/V8Binding/v8/src/assembler.h @@ -216,6 +216,9 @@ class RelocInfo BASE_EMBEDDED { // Patch the code with a call. void PatchCodeWithCall(Address target, int guard_bytes); + // Check whether the current instruction is currently a call + // sequence (whether naturally or a return sequence overwritten + // to enter the debugger). INLINE(bool IsCallInstruction()); #ifdef ENABLE_DISASSEMBLER diff --git a/V8Binding/v8/src/ast.h b/V8Binding/v8/src/ast.h index 3a309ac..ea83712 100644 --- a/V8Binding/v8/src/ast.h +++ b/V8Binding/v8/src/ast.h @@ -111,6 +111,7 @@ AST_NODE_LIST(DEF_FORWARD_DECLARATION) // Typedef only introduced to avoid unreadable code. // Please do appreciate the required space in "> >". typedef ZoneList<Handle<String> > ZoneStringList; +typedef ZoneList<Handle<Object> > ZoneObjectList; class AstNode: public ZoneObject { @@ -1226,6 +1227,9 @@ class FunctionLiteral: public Expression { int materialized_literal_count, bool contains_array_literal, int expected_property_count, + bool has_only_this_property_assignments, + bool has_only_simple_this_property_assignments, + Handle<FixedArray> this_property_assignments, int num_parameters, int start_position, int end_position, @@ -1236,6 +1240,10 @@ class FunctionLiteral: public Expression { materialized_literal_count_(materialized_literal_count), contains_array_literal_(contains_array_literal), expected_property_count_(expected_property_count), + has_only_this_property_assignments_(has_only_this_property_assignments), + has_only_simple_this_property_assignments_( + has_only_simple_this_property_assignments), + this_property_assignments_(this_property_assignments), num_parameters_(num_parameters), start_position_(start_position), end_position_(end_position), @@ -1265,6 +1273,15 @@ class FunctionLiteral: public Expression { int materialized_literal_count() { return materialized_literal_count_; } bool contains_array_literal() { return contains_array_literal_; } int expected_property_count() { return expected_property_count_; } + bool has_only_this_property_assignments() { + return has_only_this_property_assignments_; + } + bool has_only_simple_this_property_assignments() { + return has_only_simple_this_property_assignments_; + } + Handle<FixedArray> this_property_assignments() { + return this_property_assignments_; + } int num_parameters() { return num_parameters_; } bool AllowsLazyCompilation(); @@ -1291,6 +1308,9 @@ class FunctionLiteral: public Expression { int materialized_literal_count_; bool contains_array_literal_; int expected_property_count_; + bool has_only_this_property_assignments_; + bool has_only_simple_this_property_assignments_; + Handle<FixedArray> this_property_assignments_; int num_parameters_; int start_position_; int end_position_; diff --git a/V8Binding/v8/src/builtins.cc b/V8Binding/v8/src/builtins.cc index 1ea0245..dbd18f8 100644 --- a/V8Binding/v8/src/builtins.cc +++ b/V8Binding/v8/src/builtins.cc @@ -61,7 +61,7 @@ namespace internal { // ---------------------------------------------------------------------------- -// TODO(1238487): We should consider passing whether or not the +// TODO(428): We should consider passing whether or not the // builtin was invoked as a constructor as part of the // arguments. Maybe we also want to pass the called function? #define BUILTIN(name) \ @@ -336,9 +336,7 @@ BUILTIN(HandleApiCall) { HandleScope scope; bool is_construct = CalledAsConstructor(); - // TODO(1238487): This is not nice. We need to get rid of this - // kludgy behavior and start handling API calls in a more direct - // way - maybe compile specialized stubs lazily?. + // TODO(428): Remove use of static variable, handle API callbacks directly. Handle<JSFunction> function = Handle<JSFunction>(JSFunction::cast(Builtins::builtin_passed_function)); diff --git a/V8Binding/v8/src/codegen.cc b/V8Binding/v8/src/codegen.cc index c80d906..8e516c0 100644 --- a/V8Binding/v8/src/codegen.cc +++ b/V8Binding/v8/src/codegen.cc @@ -255,6 +255,10 @@ void CodeGenerator::SetFunctionInfo(Handle<JSFunction> fun, fun->shared()->set_is_expression(lit->is_expression()); fun->shared()->set_is_toplevel(is_toplevel); fun->shared()->set_inferred_name(*lit->inferred_name()); + fun->shared()->SetThisPropertyAssignmentsInfo( + lit->has_only_this_property_assignments(), + lit->has_only_simple_this_property_assignments(), + *lit->this_property_assignments()); } diff --git a/V8Binding/v8/src/codegen.h b/V8Binding/v8/src/codegen.h index 243d87c..d6967b7 100644 --- a/V8Binding/v8/src/codegen.h +++ b/V8Binding/v8/src/codegen.h @@ -70,6 +70,9 @@ // Mode to overwrite BinaryExpression values. enum OverwriteMode { NO_OVERWRITE, OVERWRITE_LEFT, OVERWRITE_RIGHT }; +// Types of uncatchable exceptions. +enum UncatchableExceptionType { OUT_OF_MEMORY, TERMINATION }; + #if V8_TARGET_ARCH_IA32 #include "ia32/codegen-ia32.h" @@ -291,12 +294,14 @@ class CEntryStub : public CodeStub { void GenerateBody(MacroAssembler* masm, bool is_debug_break); void GenerateCore(MacroAssembler* masm, Label* throw_normal_exception, + Label* throw_termination_exception, Label* throw_out_of_memory_exception, StackFrame::Type frame_type, bool do_gc, bool always_allocate_scope); void GenerateThrowTOS(MacroAssembler* masm); - void GenerateThrowOutOfMemory(MacroAssembler* masm); + void GenerateThrowUncatchable(MacroAssembler* masm, + UncatchableExceptionType type); private: Major MajorKey() { return CEntry; } diff --git a/V8Binding/v8/src/debug.cc b/V8Binding/v8/src/debug.cc index 18536f5..f2a2814 100644 --- a/V8Binding/v8/src/debug.cc +++ b/V8Binding/v8/src/debug.cc @@ -1452,14 +1452,15 @@ void Debug::SetAfterBreakTarget(JavaScriptFrame* frame) { // Find the call address in the running code. This address holds the call to // either a DebugBreakXXX or to the debug break return entry code if the // break point is still active after processing the break point. - Address addr = frame->pc() - Assembler::kTargetAddrToReturnAddrDist; + Address addr = frame->pc() - Assembler::kPatchReturnSequenceLength; // Check if the location is at JS exit. bool at_js_exit = false; RelocIterator it(debug_info->code()); while (!it.done()) { if (RelocInfo::IsJSReturn(it.rinfo()->rmode())) { - at_js_exit = it.rinfo()->pc() == addr - 1; + at_js_exit = (it.rinfo()->pc() == + addr - Assembler::kPatchReturnSequenceAddressOffset); } it.next(); } @@ -1477,8 +1478,9 @@ void Debug::SetAfterBreakTarget(JavaScriptFrame* frame) { addr += original_code->instruction_start() - code->instruction_start(); } - // Move one byte back to where the call instruction was placed. - thread_local_.after_break_target_ = addr - 1; + // Move back to where the call instruction sequence started. + thread_local_.after_break_target_ = + addr - Assembler::kPatchReturnSequenceAddressOffset; } else { // Check if there still is a debug break call at the target address. If the // break point has been removed it will have disappeared. If it have diff --git a/V8Binding/v8/src/debug.h b/V8Binding/v8/src/debug.h index 970dbbe..5b0273a 100644 --- a/V8Binding/v8/src/debug.h +++ b/V8Binding/v8/src/debug.h @@ -238,7 +238,10 @@ class Debug { // Returns whether the operation succeeded. static bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared); + // Returns true if the current stub call is patched to call the debugger. static bool IsDebugBreak(Address addr); + // Returns true if the current return statement has been patched to be + // a debugger breakpoint. static bool IsDebugBreakAtReturn(RelocInfo* rinfo); // Check whether a code stub with the specified major key is a possible break @@ -366,6 +369,7 @@ class Debug { // The x64 JS return sequence is padded with int3 to make it large // enough to hold a call instruction when the debugger patches it. + static const int kX64CallInstructionLength = 13; static const int kX64JSReturnSequenceLength = 13; // Code generator routines. diff --git a/V8Binding/v8/src/execution.cc b/V8Binding/v8/src/execution.cc index 9080f5e..0ad55bd 100644 --- a/V8Binding/v8/src/execution.cc +++ b/V8Binding/v8/src/execution.cc @@ -156,7 +156,8 @@ Handle<Object> Execution::TryCall(Handle<JSFunction> func, ASSERT(catcher.HasCaught()); ASSERT(Top::has_pending_exception()); ASSERT(Top::external_caught_exception()); - Top::optional_reschedule_exception(true); + bool is_bottom_call = HandleScopeImplementer::instance()->CallDepthIsZero(); + Top::OptionalRescheduleException(is_bottom_call, true); result = v8::Utils::OpenHandle(*catcher.Exception()); } @@ -328,6 +329,19 @@ void StackGuard::Preempt() { } +bool StackGuard::IsTerminateExecution() { + ExecutionAccess access; + return thread_local_.interrupt_flags_ & TERMINATE; +} + + +void StackGuard::TerminateExecution() { + ExecutionAccess access; + thread_local_.interrupt_flags_ |= TERMINATE; + set_limits(kInterruptLimit, access); +} + + #ifdef ENABLE_DEBUGGER_SUPPORT bool StackGuard::IsDebugBreak() { ExecutionAccess access; @@ -638,6 +652,10 @@ Object* Execution::HandleStackGuardInterrupt() { } #endif if (StackGuard::IsPreempted()) RuntimePreempt(); + if (StackGuard::IsTerminateExecution()) { + StackGuard::Continue(TERMINATE); + return Top::TerminateExecution(); + } if (StackGuard::IsInterrupted()) { // interrupt StackGuard::Continue(INTERRUPT); diff --git a/V8Binding/v8/src/execution.h b/V8Binding/v8/src/execution.h index 126b172..456cbe7 100644 --- a/V8Binding/v8/src/execution.h +++ b/V8Binding/v8/src/execution.h @@ -37,7 +37,8 @@ enum InterruptFlag { INTERRUPT = 1 << 0, DEBUGBREAK = 1 << 1, DEBUGCOMMAND = 1 << 2, - PREEMPT = 1 << 3 + PREEMPT = 1 << 3, + TERMINATE = 1 << 4 }; class Execution : public AllStatic { @@ -164,13 +165,15 @@ class StackGuard BASE_EMBEDDED { static void Preempt(); static bool IsInterrupted(); static void Interrupt(); - static void Continue(InterruptFlag after_what); + static bool IsTerminateExecution(); + static void TerminateExecution(); #ifdef ENABLE_DEBUGGER_SUPPORT - static void DebugBreak(); - static void DebugCommand(); static bool IsDebugBreak(); + static void DebugBreak(); static bool IsDebugCommand(); + static void DebugCommand(); #endif + static void Continue(InterruptFlag after_what); private: // You should hold the ExecutionAccess lock when calling this method. @@ -206,8 +209,13 @@ class StackGuard BASE_EMBEDDED { static void DisableInterrupts(); static const uintptr_t kLimitSize = kPointerSize * 128 * KB; +#ifdef V8_TARGET_ARCH_X64 + static const uintptr_t kInterruptLimit = V8_UINT64_C(0xfffffffffffffffe); + static const uintptr_t kIllegalLimit = V8_UINT64_C(0xffffffffffffffff); +#else static const uintptr_t kInterruptLimit = 0xfffffffe; static const uintptr_t kIllegalLimit = 0xffffffff; +#endif class ThreadLocal { public: diff --git a/V8Binding/v8/src/global-handles.cc b/V8Binding/v8/src/global-handles.cc index ed4e262..f868974 100644 --- a/V8Binding/v8/src/global-handles.cc +++ b/V8Binding/v8/src/global-handles.cc @@ -156,6 +156,10 @@ class GlobalHandles::Node : public Malloced { if (func != NULL) { v8::Persistent<v8::Object> object = ToApi<v8::Object>(handle()); { + // Forbid reuse of destroyed nodes as they might be already deallocated. + // It's fine though to reuse nodes that were destroyed in weak callback + // as those cannot be deallocated until we are back from the callback. + set_first_free(NULL); // Leaving V8. VMState state(EXTERNAL); func(object, par); diff --git a/V8Binding/v8/src/heap.cc b/V8Binding/v8/src/heap.cc index aa7a5c7..9b55e07 100644 --- a/V8Binding/v8/src/heap.cc +++ b/V8Binding/v8/src/heap.cc @@ -73,6 +73,10 @@ int Heap::amount_of_external_allocated_memory_at_last_global_gc_ = 0; int Heap::semispace_size_ = 512*KB; int Heap::old_generation_size_ = 128*MB; int Heap::initial_semispace_size_ = 128*KB; +#elif defined(V8_TARGET_ARCH_X64) +int Heap::semispace_size_ = 8*MB; +int Heap::old_generation_size_ = 1*GB; +int Heap::initial_semispace_size_ = 1*MB; #else int Heap::semispace_size_ = 4*MB; int Heap::old_generation_size_ = 512*MB; @@ -311,11 +315,13 @@ void Heap::GarbageCollectionEpilogue() { } -void Heap::CollectAllGarbage() { +void Heap::CollectAllGarbage(bool force_compaction) { // Since we are ignoring the return value, the exact choice of space does // not matter, so long as we do not specify NEW_SPACE, which would not // cause a full GC. + MarkCompactCollector::SetForceCompaction(force_compaction); CollectGarbage(0, OLD_POINTER_SPACE); + MarkCompactCollector::SetForceCompaction(false); } @@ -1050,6 +1056,7 @@ Object* Heap::AllocateMap(InstanceType instance_type, int instance_size) { map->set_constructor(null_value()); map->set_instance_size(instance_size); map->set_inobject_properties(0); + map->set_pre_allocated_property_fields(0); map->set_instance_descriptors(empty_descriptor_array()); map->set_code_cache(empty_fixed_array()); map->set_unused_property_fields(0); @@ -1407,6 +1414,9 @@ bool Heap::CreateInitialObjects() { if (obj->IsFailure()) return false; set_no_interceptor_result_sentinel(obj); + obj = CreateOddball(oddball_map(), "termination_exception", Smi::FromInt(-3)); + if (obj->IsFailure()) return false; + set_termination_exception(obj); // Allocate the empty string. obj = AllocateRawAsciiString(0, TENURED); @@ -1607,6 +1617,9 @@ Object* Heap::AllocateSharedFunctionInfo(Object* name) { share->set_start_position_and_type(0); share->set_debug_info(undefined_value()); share->set_inferred_name(empty_string()); + share->set_compiler_hints(0); + share->set_this_property_assignments_count(0); + share->set_this_property_assignments(undefined_value()); return result; } @@ -2046,16 +2059,10 @@ Object* Heap::AllocateArgumentsObject(Object* callee, int length) { Object* Heap::AllocateInitialMap(JSFunction* fun) { ASSERT(!fun->has_initial_map()); - // First create a new map with the expected number of properties being - // allocated in-object. - int expected_nof_properties = fun->shared()->expected_nof_properties(); - int instance_size = JSObject::kHeaderSize + - expected_nof_properties * kPointerSize; - if (instance_size > JSObject::kMaxInstanceSize) { - instance_size = JSObject::kMaxInstanceSize; - expected_nof_properties = (instance_size - JSObject::kHeaderSize) / - kPointerSize; - } + // First create a new map with the size and number of in-object properties + // suggested by the function. + int instance_size = fun->shared()->CalculateInstanceSize(); + int in_object_properties = fun->shared()->CalculateInObjectProperties(); Object* map_obj = Heap::AllocateMap(JS_OBJECT_TYPE, instance_size); if (map_obj->IsFailure()) return map_obj; @@ -2068,9 +2075,33 @@ Object* Heap::AllocateInitialMap(JSFunction* fun) { if (prototype->IsFailure()) return prototype; } Map* map = Map::cast(map_obj); - map->set_inobject_properties(expected_nof_properties); - map->set_unused_property_fields(expected_nof_properties); + map->set_inobject_properties(in_object_properties); + map->set_unused_property_fields(in_object_properties); map->set_prototype(prototype); + + // If the function has only simple this property assignments add field + // descriptors for these to the initial map as the object cannot be + // constructed without having these properties. + ASSERT(in_object_properties <= Map::kMaxPreAllocatedPropertyFields); + if (fun->shared()->has_only_this_property_assignments() && + fun->shared()->this_property_assignments_count() > 0) { + int count = fun->shared()->this_property_assignments_count(); + if (count > in_object_properties) { + count = in_object_properties; + } + DescriptorArray* descriptors = *Factory::NewDescriptorArray(count); + if (descriptors->IsFailure()) return descriptors; + for (int i = 0; i < count; i++) { + String* name = fun->shared()->GetThisPropertyAssignmentName(i); + ASSERT(name->IsSymbol()); + FieldDescriptor field(name, i, NONE); + descriptors->Set(i, &field); + } + descriptors->Sort(); + map->set_instance_descriptors(descriptors); + map->set_pre_allocated_property_fields(count); + map->set_unused_property_fields(in_object_properties - count); + } return map; } @@ -2102,7 +2133,11 @@ Object* Heap::AllocateJSObjectFromMap(Map* map, PretenureFlag pretenure) { ASSERT(map->instance_type() != JS_BUILTINS_OBJECT_TYPE); // Allocate the backing storage for the properties. - int prop_size = map->unused_property_fields() - map->inobject_properties(); + int prop_size = + map->pre_allocated_property_fields() + + map->unused_property_fields() - + map->inobject_properties(); + ASSERT(prop_size >= 0); Object* properties = AllocateFixedArray(prop_size, pretenure); if (properties->IsFailure()) return properties; @@ -2595,6 +2630,7 @@ Object* Heap::CopyFixedArray(FixedArray* src) { Object* Heap::AllocateFixedArray(int length) { + ASSERT(length >= 0); if (length == 0) return empty_fixed_array(); Object* result = AllocateRawFixedArray(length); if (!result->IsFailure()) { diff --git a/V8Binding/v8/src/heap.h b/V8Binding/v8/src/heap.h index 179f9af..a9d44c6 100644 --- a/V8Binding/v8/src/heap.h +++ b/V8Binding/v8/src/heap.h @@ -111,6 +111,7 @@ namespace internal { V(Object, nan_value, NanValue) \ V(Object, undefined_value, UndefinedValue) \ V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ + V(Object, termination_exception, TerminationException) \ V(Object, minus_zero_value, MinusZeroValue) \ V(Object, null_value, NullValue) \ V(Object, true_value, TrueValue) \ @@ -626,8 +627,9 @@ class Heap : public AllStatic { // Returns whether required_space bytes are available after the collection. static bool CollectGarbage(int required_space, AllocationSpace space); - // Performs a full garbage collection. - static void CollectAllGarbage(); + // Performs a full garbage collection. Force compaction if the + // parameter is true. + static void CollectAllGarbage(bool force_compaction = false); // Performs a full garbage collection if a context has been disposed // since the last time the check was performed. @@ -852,7 +854,11 @@ class Heap : public AllStatic { static const int kMaxMapSpaceSize = 8*MB; +#if defined(V8_TARGET_ARCH_X64) + static const int kMaxObjectSizeInNewSpace = 512*KB; +#else static const int kMaxObjectSizeInNewSpace = 256*KB; +#endif static NewSpace new_space_; static OldSpace* old_pointer_space_; diff --git a/V8Binding/v8/src/ia32/assembler-ia32.h b/V8Binding/v8/src/ia32/assembler-ia32.h index b648055..6a90e07 100644 --- a/V8Binding/v8/src/ia32/assembler-ia32.h +++ b/V8Binding/v8/src/ia32/assembler-ia32.h @@ -437,7 +437,10 @@ class Assembler : public Malloced { // Distance between the address of the code target in the call instruction // and the return address - static const int kTargetAddrToReturnAddrDist = kPointerSize; + static const int kPatchReturnSequenceLength = kPointerSize; + // Distance between start of patched return sequence and the emitted address + // to jump to. + static const int kPatchReturnSequenceAddressOffset = 1; // JMP imm32. // --------------------------------------------------------------------------- diff --git a/V8Binding/v8/src/ia32/builtins-ia32.cc b/V8Binding/v8/src/ia32/builtins-ia32.cc index a70a9d2..6de9de6 100644 --- a/V8Binding/v8/src/ia32/builtins-ia32.cc +++ b/V8Binding/v8/src/ia32/builtins-ia32.cc @@ -37,7 +37,7 @@ namespace internal { void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) { - // TODO(1238487): Don't pass the function in a static variable. + // TODO(428): Don't pass the function in a static variable. ExternalReference passed = ExternalReference::builtin_passed_function(); __ mov(Operand::StaticVariable(passed), edi); @@ -180,12 +180,16 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { // eax: initial map // ebx: JSObject // edi: start of next object + // Calculate the total number of properties described by the map. __ movzx_b(edx, FieldOperand(eax, Map::kUnusedPropertyFieldsOffset)); - __ movzx_b(ecx, FieldOperand(eax, Map::kInObjectPropertiesOffset)); + __ movzx_b(ecx, FieldOperand(eax, Map::kPreAllocatedPropertyFieldsOffset)); + __ add(edx, Operand(ecx)); // Calculate unused properties past the end of the in-object properties. + __ movzx_b(ecx, FieldOperand(eax, Map::kInObjectPropertiesOffset)); __ sub(edx, Operand(ecx)); // Done if no extra properties are to be allocated. __ j(zero, &allocated); + __ Assert(positive, "Property allocation count failed."); // Scale the number of elements by pointer size and add the header for // FixedArrays to the start of the next object calculation from above. @@ -321,6 +325,7 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { __ pop(ecx); __ lea(esp, Operand(esp, ebx, times_2, 1 * kPointerSize)); // 1 ~ receiver __ push(ecx); + __ IncrementCounter(&Counters::constructed_objects, 1); __ ret(0); } diff --git a/V8Binding/v8/src/ia32/codegen-ia32.cc b/V8Binding/v8/src/ia32/codegen-ia32.cc index 9542b16..bf1f81b 100644 --- a/V8Binding/v8/src/ia32/codegen-ia32.cc +++ b/V8Binding/v8/src/ia32/codegen-ia32.cc @@ -6752,11 +6752,10 @@ void GenericBinaryOpStub::Generate(MacroAssembler* masm) { // Reserve space for converted numbers. __ sub(Operand(esp), Immediate(2 * kPointerSize)); - bool use_sse3 = CpuFeatures::IsSupported(CpuFeatures::SSE3); - if (use_sse3) { + if (use_sse3_) { // Truncate the operands to 32-bit integers and check for // exceptions in doing so. - CpuFeatures::Scope scope(CpuFeatures::SSE3); + CpuFeatures::Scope scope(CpuFeatures::SSE3); __ fisttp_s(Operand(esp, 0 * kPointerSize)); __ fisttp_s(Operand(esp, 1 * kPointerSize)); __ fnstsw_ax(); @@ -6841,7 +6840,7 @@ void GenericBinaryOpStub::Generate(MacroAssembler* masm) { // the runtime system. __ bind(&operand_conversion_failure); __ add(Operand(esp), Immediate(2 * kPointerSize)); - if (use_sse3) { + if (use_sse3_) { // If we've used the SSE3 instructions for truncating the // floating point values to integers and it failed, we have a // pending #IA exception. Clear it. @@ -7506,6 +7505,7 @@ void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) { void CEntryStub::GenerateCore(MacroAssembler* masm, Label* throw_normal_exception, + Label* throw_termination_exception, Label* throw_out_of_memory_exception, StackFrame::Type frame_type, bool do_gc, @@ -7569,10 +7569,9 @@ void CEntryStub::GenerateCore(MacroAssembler* masm, __ test(eax, Immediate(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize)); __ j(zero, &retry, taken); - Label continue_exception; - // If the returned failure is EXCEPTION then promote Top::pending_exception(). - __ cmp(eax, reinterpret_cast<int32_t>(Failure::Exception())); - __ j(not_equal, &continue_exception); + // Special handling of out of memory exceptions. + __ cmp(eax, reinterpret_cast<int32_t>(Failure::OutOfMemoryException())); + __ j(equal, throw_out_of_memory_exception); // Retrieve the pending exception and clear the variable. ExternalReference pending_exception_address(Top::k_pending_exception_address); @@ -7581,10 +7580,10 @@ void CEntryStub::GenerateCore(MacroAssembler* masm, Operand::StaticVariable(ExternalReference::the_hole_value_location())); __ mov(Operand::StaticVariable(pending_exception_address), edx); - __ bind(&continue_exception); - // Special handling of out of memory exception. - __ cmp(eax, reinterpret_cast<int32_t>(Failure::OutOfMemoryException())); - __ j(equal, throw_out_of_memory_exception); + // Special handling of termination exceptions which are uncatchable + // by javascript code. + __ cmp(eax, Factory::termination_exception()); + __ j(equal, throw_termination_exception); // Handle normal exception. __ jmp(throw_normal_exception); @@ -7594,7 +7593,8 @@ void CEntryStub::GenerateCore(MacroAssembler* masm, } -void CEntryStub::GenerateThrowOutOfMemory(MacroAssembler* masm) { +void CEntryStub::GenerateThrowUncatchable(MacroAssembler* masm, + UncatchableExceptionType type) { // Adjust this code if not the case. ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); @@ -7619,17 +7619,19 @@ void CEntryStub::GenerateThrowOutOfMemory(MacroAssembler* masm) { ASSERT(StackHandlerConstants::kNextOffset == 0); __ pop(Operand::StaticVariable(handler_address)); - // Set external caught exception to false. - ExternalReference external_caught(Top::k_external_caught_exception_address); - __ mov(eax, false); - __ mov(Operand::StaticVariable(external_caught), eax); + if (type == OUT_OF_MEMORY) { + // Set external caught exception to false. + ExternalReference external_caught(Top::k_external_caught_exception_address); + __ mov(eax, false); + __ mov(Operand::StaticVariable(external_caught), eax); - // Set pending exception and eax to out of memory exception. - ExternalReference pending_exception(Top::k_pending_exception_address); - __ mov(eax, reinterpret_cast<int32_t>(Failure::OutOfMemoryException())); - __ mov(Operand::StaticVariable(pending_exception), eax); + // Set pending exception and eax to out of memory exception. + ExternalReference pending_exception(Top::k_pending_exception_address); + __ mov(eax, reinterpret_cast<int32_t>(Failure::OutOfMemoryException())); + __ mov(Operand::StaticVariable(pending_exception), eax); + } - // Clear the context pointer; + // Clear the context pointer. __ xor_(esi, Operand(esi)); // Restore fp from handler and discard handler state. @@ -7668,24 +7670,23 @@ void CEntryStub::GenerateBody(MacroAssembler* masm, bool is_debug_break) { // edi: number of arguments including receiver (C callee-saved) // esi: argv pointer (C callee-saved) - Label throw_out_of_memory_exception; Label throw_normal_exception; + Label throw_termination_exception; + Label throw_out_of_memory_exception; - // Call into the runtime system. Collect garbage before the call if - // running with --gc-greedy set. - if (FLAG_gc_greedy) { - Failure* failure = Failure::RetryAfterGC(0); - __ mov(eax, Immediate(reinterpret_cast<int32_t>(failure))); - } - GenerateCore(masm, &throw_normal_exception, + // Call into the runtime system. + GenerateCore(masm, + &throw_normal_exception, + &throw_termination_exception, &throw_out_of_memory_exception, frame_type, - FLAG_gc_greedy, + false, false); // Do space-specific GC and retry runtime call. GenerateCore(masm, &throw_normal_exception, + &throw_termination_exception, &throw_out_of_memory_exception, frame_type, true, @@ -7696,14 +7697,17 @@ void CEntryStub::GenerateBody(MacroAssembler* masm, bool is_debug_break) { __ mov(eax, Immediate(reinterpret_cast<int32_t>(failure))); GenerateCore(masm, &throw_normal_exception, + &throw_termination_exception, &throw_out_of_memory_exception, frame_type, true, true); __ bind(&throw_out_of_memory_exception); - GenerateThrowOutOfMemory(masm); - // control flow for generated will not return. + GenerateThrowUncatchable(masm, OUT_OF_MEMORY); + + __ bind(&throw_termination_exception); + GenerateThrowUncatchable(masm, TERMINATION); __ bind(&throw_normal_exception); GenerateThrowTOS(masm); diff --git a/V8Binding/v8/src/ia32/codegen-ia32.h b/V8Binding/v8/src/ia32/codegen-ia32.h index 3b0971d..afdbffe 100644 --- a/V8Binding/v8/src/ia32/codegen-ia32.h +++ b/V8Binding/v8/src/ia32/codegen-ia32.h @@ -618,6 +618,7 @@ class GenericBinaryOpStub: public CodeStub { OverwriteMode mode, GenericBinaryFlags flags) : op_(op), mode_(mode), flags_(flags) { + use_sse3_ = CpuFeatures::IsSupported(CpuFeatures::SSE3); ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); } @@ -627,6 +628,7 @@ class GenericBinaryOpStub: public CodeStub { Token::Value op_; OverwriteMode mode_; GenericBinaryFlags flags_; + bool use_sse3_; const char* GetName(); @@ -639,9 +641,10 @@ class GenericBinaryOpStub: public CodeStub { } #endif - // Minor key encoding in 16 bits FOOOOOOOOOOOOOMM. + // Minor key encoding in 16 bits FSOOOOOOOOOOOOMM. class ModeBits: public BitField<OverwriteMode, 0, 2> {}; - class OpBits: public BitField<Token::Value, 2, 13> {}; + class OpBits: public BitField<Token::Value, 2, 12> {}; + class SSE3Bits: public BitField<bool, 14, 1> {}; class FlagBits: public BitField<GenericBinaryFlags, 15, 1> {}; Major MajorKey() { return GenericBinaryOp; } @@ -649,7 +652,8 @@ class GenericBinaryOpStub: public CodeStub { // Encode the parameters in a unique 16 bit value. return OpBits::encode(op_) | ModeBits::encode(mode_) - | FlagBits::encode(flags_); + | FlagBits::encode(flags_) + | SSE3Bits::encode(use_sse3_); } void Generate(MacroAssembler* masm); }; diff --git a/V8Binding/v8/src/ia32/debug-ia32.cc b/V8Binding/v8/src/ia32/debug-ia32.cc index 9913a39..4ef0862 100644 --- a/V8Binding/v8/src/ia32/debug-ia32.cc +++ b/V8Binding/v8/src/ia32/debug-ia32.cc @@ -195,8 +195,8 @@ void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) { void Debug::GenerateReturnDebugBreakEntry(MacroAssembler* masm) { - // OK to clobber ebx as we are returning from a JS function in the code - // generated by Ia32CodeGenerator::ExitJSFrame. + // OK to clobber ebx as we are returning from a JS function through the code + // generated by CodeGenerator::GenerateReturnSequence() ExternalReference debug_break_return = ExternalReference(Debug_Address::DebugBreakReturn()); __ mov(ebx, Operand::StaticVariable(debug_break_return)); diff --git a/V8Binding/v8/src/ia32/ic-ia32.cc b/V8Binding/v8/src/ia32/ic-ia32.cc index 08ffe2f..fa9b8a2 100644 --- a/V8Binding/v8/src/ia32/ic-ia32.cc +++ b/V8Binding/v8/src/ia32/ic-ia32.cc @@ -840,7 +840,7 @@ void KeyedStoreIC::RestoreInlinedVersion(Address address) { bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { // The address of the instruction following the call. Address test_instruction_address = - address + Assembler::kTargetAddrToReturnAddrDist; + address + Assembler::kPatchReturnSequenceLength; // If the instruction following the call is not a test eax, nothing // was inlined. if (*test_instruction_address != kTestEaxByte) return false; @@ -867,7 +867,7 @@ bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { static bool PatchInlinedMapCheck(Address address, Object* map) { Address test_instruction_address = - address + Assembler::kTargetAddrToReturnAddrDist; + address + Assembler::kPatchReturnSequenceLength; // The keyed load has a fast inlined case if the IC call instruction // is immediately followed by a test instruction. if (*test_instruction_address != kTestEaxByte) return false; diff --git a/V8Binding/v8/src/ic-inl.h b/V8Binding/v8/src/ic-inl.h index 08304d8..38d61dc 100644 --- a/V8Binding/v8/src/ic-inl.h +++ b/V8Binding/v8/src/ic-inl.h @@ -38,7 +38,7 @@ namespace internal { Address IC::address() { // Get the address of the call. - Address result = pc() - Assembler::kTargetAddrToReturnAddrDist; + Address result = pc() - Assembler::kPatchReturnSequenceLength; #ifdef ENABLE_DEBUGGER_SUPPORT // First check if any break points are active if not just return the address diff --git a/V8Binding/v8/src/ic.cc b/V8Binding/v8/src/ic.cc index f4d74c9..393ccbf 100644 --- a/V8Binding/v8/src/ic.cc +++ b/V8Binding/v8/src/ic.cc @@ -122,7 +122,7 @@ Address IC::OriginalCodeAddress() { // Get the address of the call site in the active code. This is the // place where the call to DebugBreakXXX is and where the IC // normally would be. - Address addr = pc() - Assembler::kTargetAddrToReturnAddrDist; + Address addr = pc() - Assembler::kPatchReturnSequenceLength; // Return the address in the original code. This is the place where // the call which has been overwritten by the DebugBreakXXX resides // and the place where the inline cache system should look. diff --git a/V8Binding/v8/src/ic.h b/V8Binding/v8/src/ic.h index 860b7e6..007b035 100644 --- a/V8Binding/v8/src/ic.h +++ b/V8Binding/v8/src/ic.h @@ -390,7 +390,7 @@ class KeyedStoreIC: public IC { // Support for patching the map that is checked in an inlined // version of keyed store. // The address is the patch point for the IC call - // (Assembler::kTargetAddrToReturnAddrDist before the end of + // (Assembler::kPatchReturnSequenceLength before the end of // the call/return address). // The map is the new map that the inlined code should check against. static bool PatchInlinedStore(Address address, Object* map); diff --git a/V8Binding/v8/src/mark-compact.cc b/V8Binding/v8/src/mark-compact.cc index 6e823b3..10e81ac 100644 --- a/V8Binding/v8/src/mark-compact.cc +++ b/V8Binding/v8/src/mark-compact.cc @@ -39,6 +39,7 @@ namespace internal { // ------------------------------------------------------------------------- // MarkCompactCollector +bool MarkCompactCollector::force_compaction_ = false; bool MarkCompactCollector::compacting_collection_ = false; int MarkCompactCollector::previous_marked_count_ = 0; @@ -110,7 +111,7 @@ void MarkCompactCollector::Prepare(GCTracer* tracer) { #endif ASSERT(!FLAG_always_compact || !FLAG_never_compact); - compacting_collection_ = FLAG_always_compact; + compacting_collection_ = FLAG_always_compact || force_compaction_; // We compact the old generation if it gets too fragmented (ie, we could // recover an expected amount of space by reclaiming the waste and free diff --git a/V8Binding/v8/src/mark-compact.h b/V8Binding/v8/src/mark-compact.h index bd9e4a0..0bd212e 100644 --- a/V8Binding/v8/src/mark-compact.h +++ b/V8Binding/v8/src/mark-compact.h @@ -75,6 +75,12 @@ class MarkCompactCollector: public AllStatic { // Type of functions to process non-live objects. typedef void (*ProcessNonLiveFunction)(HeapObject* object); + // Set the global force_compaction flag, it must be called before Prepare + // to take effect. + static void SetForceCompaction(bool value) { + force_compaction_ = value; + } + // Prepares for GC by resetting relocation info in old and map spaces and // choosing spaces to compact. static void Prepare(GCTracer* tracer); @@ -117,6 +123,10 @@ class MarkCompactCollector: public AllStatic { // The current stage of the collector. static CollectorState state_; #endif + + // Global flag that forces a compaction. + static bool force_compaction_; + // Global flag indicating whether spaces were compacted on the last GC. static bool compacting_collection_; diff --git a/V8Binding/v8/src/messages.cc b/V8Binding/v8/src/messages.cc index a3fffcb..e16b1b2 100644 --- a/V8Binding/v8/src/messages.cc +++ b/V8Binding/v8/src/messages.cc @@ -147,14 +147,12 @@ Handle<String> MessageHandler::GetMessage(Handle<Object> data) { Handle<String> fmt_str = Factory::LookupAsciiSymbol("FormatMessage"); Handle<JSFunction> fun = Handle<JSFunction>( - JSFunction::cast( - Top::builtins()->GetProperty(*fmt_str))); + JSFunction::cast(Top::builtins()->GetProperty(*fmt_str))); Object** argv[1] = { data.location() }; bool caught_exception; Handle<Object> result = - Execution::TryCall(fun, Top::builtins(), 1, argv, - &caught_exception); + Execution::TryCall(fun, Top::builtins(), 1, argv, &caught_exception); if (caught_exception || !result->IsString()) { return Factory::LookupAsciiSymbol("<error>"); diff --git a/V8Binding/v8/src/objects-debug.cc b/V8Binding/v8/src/objects-debug.cc index 40001f9..f713171 100644 --- a/V8Binding/v8/src/objects-debug.cc +++ b/V8Binding/v8/src/objects-debug.cc @@ -371,9 +371,9 @@ void JSObject::JSObjectVerify() { VerifyHeapPointer(properties()); VerifyHeapPointer(elements()); if (HasFastProperties()) { - CHECK(map()->unused_property_fields() == - (map()->inobject_properties() + properties()->length() - - map()->NextFreePropertyIndex())); + CHECK_EQ(map()->unused_property_fields(), + (map()->inobject_properties() + properties()->length() - + map()->NextFreePropertyIndex())); } } @@ -462,6 +462,7 @@ void Map::MapPrint() { HeapObject::PrintHeader("Map"); PrintF(" - type: %s\n", TypeToString(instance_type())); PrintF(" - instance size: %d\n", instance_size()); + PrintF(" - inobject properties: %d\n", inobject_properties()); PrintF(" - unused property fields: %d\n", unused_property_fields()); if (is_hidden_prototype()) { PrintF(" - hidden_prototype\n"); @@ -619,6 +620,12 @@ void SharedFunctionInfo::SharedFunctionInfoPrint() { PrintF("\n - debug info = "); debug_info()->ShortPrint(); PrintF("\n - length = %d", length()); + PrintF("\n - has_only_this_property_assignments = %d", + has_only_this_property_assignments()); + PrintF("\n - has_only_simple_this_property_assignments = %d", + has_only_simple_this_property_assignments()); + PrintF("\n - this_property_assignments = "); + this_property_assignments()->ShortPrint(); PrintF("\n"); } @@ -698,7 +705,8 @@ void Oddball::OddballVerify() { } else { ASSERT(number->IsSmi()); int value = Smi::cast(number)->value(); - ASSERT(value == 0 || value == 1 || value == -1 || value == -2); + ASSERT(value == 0 || value == 1 || value == -1 || + value == -2 || value == -3); } } diff --git a/V8Binding/v8/src/objects-inl.h b/V8Binding/v8/src/objects-inl.h index a3bd3ce..91aae2f 100644 --- a/V8Binding/v8/src/objects-inl.h +++ b/V8Binding/v8/src/objects-inl.h @@ -91,7 +91,13 @@ PropertyDetails PropertyDetails::AsDeleted() { } -#define BOOL_ACCESSORS(holder, field, name, offset) \ +#define BOOL_GETTER(holder, field, name, offset) \ + bool holder::name() { \ + return BooleanBit::get(field(), offset); \ + } \ + + +#define BOOL_ACCESSORS(holder, field, name, offset) \ bool holder::name() { \ return BooleanBit::get(field(), offset); \ } \ @@ -782,6 +788,7 @@ Failure* Failure::Exception() { return Construct(EXCEPTION); } + Failure* Failure::OutOfMemoryException() { return Construct(OUT_OF_MEMORY_EXCEPTION); } @@ -1937,6 +1944,11 @@ int Map::inobject_properties() { } +int Map::pre_allocated_property_fields() { + return READ_BYTE_FIELD(this, kPreAllocatedPropertyFieldsOffset); +} + + int HeapObject::SizeFromMap(Map* map) { InstanceType instance_type = map->instance_type(); // Only inline the most frequent cases. @@ -1969,6 +1981,14 @@ void Map::set_inobject_properties(int value) { } +void Map::set_pre_allocated_property_fields(int value) { + ASSERT(0 <= value && value < 256); + WRITE_BYTE_FIELD(this, + kPreAllocatedPropertyFieldsOffset, + static_cast<byte>(value)); +} + + InstanceType Map::instance_type() { return static_cast<InstanceType>(READ_BYTE_FIELD(this, kInstanceTypeOffset)); } @@ -2298,6 +2318,8 @@ ACCESSORS(SharedFunctionInfo, function_data, Object, ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset) ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset) ACCESSORS(SharedFunctionInfo, inferred_name, String, kInferredNameOffset) +ACCESSORS(SharedFunctionInfo, this_property_assignments, Object, + kThisPropertyAssignmentsOffset) BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, kHiddenPrototypeBit) @@ -2308,6 +2330,13 @@ BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_expression, kIsExpressionBit) BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_toplevel, kIsTopLevelBit) +BOOL_GETTER(SharedFunctionInfo, compiler_hints, + has_only_this_property_assignments, + kHasOnlyThisPropertyAssignments) +BOOL_GETTER(SharedFunctionInfo, compiler_hints, + has_only_simple_this_property_assignments, + kHasOnlySimpleThisPropertyAssignments) + INT_ACCESSORS(SharedFunctionInfo, length, kLengthOffset) INT_ACCESSORS(SharedFunctionInfo, formal_parameter_count, @@ -2319,6 +2348,10 @@ INT_ACCESSORS(SharedFunctionInfo, start_position_and_type, INT_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) INT_ACCESSORS(SharedFunctionInfo, function_token_position, kFunctionTokenPositionOffset) +INT_ACCESSORS(SharedFunctionInfo, compiler_hints, + kCompilerHintsOffset) +INT_ACCESSORS(SharedFunctionInfo, this_property_assignments_count, + kThisPropertyAssignmentsCountOffset) void SharedFunctionInfo::DontAdaptArguments() { diff --git a/V8Binding/v8/src/objects.cc b/V8Binding/v8/src/objects.cc index c3051b8..e4a3a67 100644 --- a/V8Binding/v8/src/objects.cc +++ b/V8Binding/v8/src/objects.cc @@ -4780,6 +4780,48 @@ Object* SharedFunctionInfo::GetSourceCode() { } +int SharedFunctionInfo::CalculateInstanceSize() { + int instance_size = + JSObject::kHeaderSize + + expected_nof_properties() * kPointerSize; + if (instance_size > JSObject::kMaxInstanceSize) { + instance_size = JSObject::kMaxInstanceSize; + } + return instance_size; +} + + +int SharedFunctionInfo::CalculateInObjectProperties() { + return (CalculateInstanceSize() - JSObject::kHeaderSize) / kPointerSize; +} + + +void SharedFunctionInfo::SetThisPropertyAssignmentsInfo( + bool only_this_property_assignments, + bool only_simple_this_property_assignments, + FixedArray* assignments) { + ASSERT(this_property_assignments()->IsUndefined()); + set_compiler_hints(BooleanBit::set(compiler_hints(), + kHasOnlyThisPropertyAssignments, + only_this_property_assignments)); + set_compiler_hints(BooleanBit::set(compiler_hints(), + kHasOnlySimpleThisPropertyAssignments, + only_simple_this_property_assignments)); + set_this_property_assignments(assignments); + set_this_property_assignments_count(assignments->length() / 3); +} + + +String* SharedFunctionInfo::GetThisPropertyAssignmentName(int index) { + Object* obj = this_property_assignments(); + ASSERT(obj->IsFixedArray()); + ASSERT(index < this_property_assignments_count()); + obj = FixedArray::cast(obj)->get(index * 3); + ASSERT(obj->IsString()); + return String::cast(obj); +} + + // Support function for printing the source code to a StringStream // without any allocation in the heap. void SharedFunctionInfo::SourceCodePrint(StringStream* accumulator, @@ -4826,6 +4868,8 @@ void SharedFunctionInfo::SharedFunctionInfoIterateBody(ObjectVisitor* v) { IteratePointers(v, kNameOffset, kConstructStubOffset + kPointerSize); IteratePointers(v, kInstanceClassNameOffset, kScriptOffset + kPointerSize); IteratePointers(v, kDebugInfoOffset, kInferredNameOffset + kPointerSize); + IteratePointers(v, kThisPropertyAssignmentsOffset, + kThisPropertyAssignmentsOffset + kPointerSize); } diff --git a/V8Binding/v8/src/objects.h b/V8Binding/v8/src/objects.h index 03f0f3d..a402961 100644 --- a/V8Binding/v8/src/objects.h +++ b/V8Binding/v8/src/objects.h @@ -2704,6 +2704,10 @@ class Map: public HeapObject { inline int inobject_properties(); inline void set_inobject_properties(int value); + // Count of property fields pre-allocated in the object when first allocated. + inline int pre_allocated_property_fields(); + inline void set_pre_allocated_property_fields(int value); + // Instance type. inline InstanceType instance_type(); inline void set_instance_type(InstanceType value); @@ -2869,6 +2873,8 @@ class Map: public HeapObject { void MapVerify(); #endif + static const int kMaxPreAllocatedPropertyFields = 255; + // Layout description. static const int kInstanceSizesOffset = HeapObject::kHeaderSize; static const int kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize; @@ -2882,7 +2888,8 @@ class Map: public HeapObject { // Byte offsets within kInstanceSizesOffset. static const int kInstanceSizeOffset = kInstanceSizesOffset + 0; static const int kInObjectPropertiesOffset = kInstanceSizesOffset + 1; - // The bytes at positions 2 and 3 are not in use at the moment. + static const int kPreAllocatedPropertyFieldsOffset = kInstanceSizesOffset + 2; + // The byte at position 3 is not in use at the moment. // Byte offsets within kInstanceAttributesOffset attributes. static const int kInstanceTypeOffset = kInstanceAttributesOffset + 0; @@ -3090,10 +3097,42 @@ class SharedFunctionInfo: public HeapObject { inline bool is_toplevel(); inline void set_is_toplevel(bool value); + // Bit field containing various information collected by the compiler to + // drive optimization. + inline int compiler_hints(); + inline void set_compiler_hints(int value); + + // Add information on assignments of the form this.x = ...; + void SetThisPropertyAssignmentsInfo( + bool has_only_this_property_assignments, + bool has_only_simple_this_property_assignments, + FixedArray* this_property_assignments); + + // Indicate that this function only consists of assignments of the form + // this.x = ...;. + inline bool has_only_this_property_assignments(); + + // Indicate that this function only consists of assignments of the form + // this.x = y; where y is either a constant or refers to an argument. + inline bool has_only_simple_this_property_assignments(); + + // For functions which only contains this property assignments this provides + // access to the names for the properties assigned. + DECL_ACCESSORS(this_property_assignments, Object) + inline int this_property_assignments_count(); + inline void set_this_property_assignments_count(int value); + String* GetThisPropertyAssignmentName(int index); + // [source code]: Source code for the function. bool HasSourceCode(); Object* GetSourceCode(); + // Calculate the instance size. + int CalculateInstanceSize(); + + // Calculate the number of in-object properties. + int CalculateInObjectProperties(); + // Dispatched behavior. void SharedFunctionInfoIterateBody(ObjectVisitor* v); // Set max_length to -1 for unlimited length. @@ -3129,7 +3168,12 @@ class SharedFunctionInfo: public HeapObject { static const int kScriptOffset = kExternalReferenceDataOffset + kPointerSize; static const int kDebugInfoOffset = kScriptOffset + kPointerSize; static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize; - static const int kSize = kInferredNameOffset + kPointerSize; + static const int kCompilerHintsOffset = kInferredNameOffset + kPointerSize; + static const int kThisPropertyAssignmentsOffset = + kCompilerHintsOffset + kPointerSize; + static const int kThisPropertyAssignmentsCountOffset = + kThisPropertyAssignmentsOffset + kPointerSize; + static const int kSize = kThisPropertyAssignmentsCountOffset + kPointerSize; private: // Bit positions in length_and_flg. @@ -3146,6 +3190,10 @@ class SharedFunctionInfo: public HeapObject { static const int kStartPositionShift = 2; static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); + // Bit positions in compiler_hints. + static const int kHasOnlyThisPropertyAssignments = 0; + static const int kHasOnlySimpleThisPropertyAssignments = 1; + DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); }; diff --git a/V8Binding/v8/src/parser.cc b/V8Binding/v8/src/parser.cc index e3b72a3..5cc6341 100644 --- a/V8Binding/v8/src/parser.cc +++ b/V8Binding/v8/src/parser.cc @@ -678,6 +678,25 @@ class TemporaryScope BASE_EMBEDDED { void set_contains_array_literal() { contains_array_literal_ = true; } bool contains_array_literal() { return contains_array_literal_; } + void SetThisPropertyAssignmentInfo( + bool only_this_property_assignments, + bool only_simple_this_property_assignments, + Handle<FixedArray> this_property_assignments) { + only_this_property_assignments_ = only_this_property_assignments; + only_simple_this_property_assignments_ = + only_simple_this_property_assignments; + this_property_assignments_ = this_property_assignments; + } + bool only_this_property_assignments() { + return only_this_property_assignments_; + } + bool only_simple_this_property_assignments() { + return only_simple_this_property_assignments_; + } + Handle<FixedArray> this_property_assignments() { + return this_property_assignments_; + } + void AddProperty() { expected_property_count_++; } int expected_property_count() { return expected_property_count_; } private: @@ -695,6 +714,10 @@ class TemporaryScope BASE_EMBEDDED { // Properties count estimation. int expected_property_count_; + bool only_this_property_assignments_; + bool only_simple_this_property_assignments_; + Handle<FixedArray> this_property_assignments_; + // Bookkeeping Parser* parser_; TemporaryScope* parent_; @@ -707,6 +730,9 @@ TemporaryScope::TemporaryScope(Parser* parser) : materialized_literal_count_(0), contains_array_literal_(false), expected_property_count_(0), + only_this_property_assignments_(false), + only_simple_this_property_assignments_(false), + this_property_assignments_(Factory::empty_fixed_array()), parser_(parser), parent_(parser->temp_scope_) { parser->temp_scope_ = this; @@ -1218,12 +1244,20 @@ FunctionLiteral* Parser::ParseProgram(Handle<String> source, bool ok = true; ParseSourceElements(&body, Token::EOS, &ok); if (ok) { - result = NEW(FunctionLiteral(no_name, top_scope_, - body.elements(), - temp_scope.materialized_literal_count(), - temp_scope.contains_array_literal(), - temp_scope.expected_property_count(), - 0, 0, source->length(), false)); + result = NEW(FunctionLiteral( + no_name, + top_scope_, + body.elements(), + temp_scope.materialized_literal_count(), + temp_scope.contains_array_literal(), + temp_scope.expected_property_count(), + temp_scope.only_this_property_assignments(), + temp_scope.only_simple_this_property_assignments(), + temp_scope.this_property_assignments(), + 0, + 0, + source->length(), + false)); } else if (scanner().stack_overflow()) { Top::StackOverflow(); } @@ -1314,9 +1348,23 @@ void PreParser::ReportMessageAt(Scanner::Location source_location, } +// Base class containing common code for the different finder classes used by +// the parser. +class ParserFinder { + protected: + ParserFinder() {} + static Assignment* AsAssignment(Statement* stat) { + if (stat == NULL) return NULL; + ExpressionStatement* exp_stat = stat->AsExpressionStatement(); + if (exp_stat == NULL) return NULL; + return exp_stat->expression()->AsAssignment(); + } +}; + + // An InitializationBlockFinder finds and marks sequences of statements of the // form x.y.z.a = ...; x.y.z.b = ...; etc. -class InitializationBlockFinder { +class InitializationBlockFinder : public ParserFinder { public: InitializationBlockFinder() : first_in_block_(NULL), last_in_block_(NULL), block_size_(0) {} @@ -1341,13 +1389,6 @@ class InitializationBlockFinder { } private: - static Assignment* AsAssignment(Statement* stat) { - if (stat == NULL) return NULL; - ExpressionStatement* exp_stat = stat->AsExpressionStatement(); - if (exp_stat == NULL) return NULL; - return exp_stat->expression()->AsAssignment(); - } - // Returns true if the expressions appear to denote the same object. // In the context of initialization blocks, we only consider expressions // of the form 'x.y.z'. @@ -1418,6 +1459,161 @@ class InitializationBlockFinder { }; +// A ThisNamedPropertyAssigmentFinder finds and marks statements of the form +// this.x = ...;, where x is a named property. It also determines whether a +// function contains only assignments of this type. +class ThisNamedPropertyAssigmentFinder : public ParserFinder { + public: + ThisNamedPropertyAssigmentFinder() + : only_this_property_assignments_(true), + only_simple_this_property_assignments_(true), + names_(NULL), + assigned_arguments_(NULL), + assigned_constants_(NULL) {} + + void Update(Scope* scope, Statement* stat) { + // Bail out if function already has non this property assignment + // statements. + if (!only_this_property_assignments_) { + return; + } + + // Check whether this statement is of the form this.x = ...; + Assignment* assignment = AsAssignment(stat); + if (IsThisPropertyAssignment(assignment)) { + HandleThisPropertyAssignment(scope, assignment); + } else { + only_this_property_assignments_ = false; + only_simple_this_property_assignments_ = false; + } + } + + // Returns whether only statements of the form this.x = ...; was encountered. + bool only_this_property_assignments() { + return only_this_property_assignments_; + } + + // Returns whether only statements of the form this.x = y; where y is either a + // constant or a function argument was encountered. + bool only_simple_this_property_assignments() { + return only_simple_this_property_assignments_; + } + + // Returns a fixed array containing three elements for each assignment of the + // form this.x = y; + Handle<FixedArray> GetThisPropertyAssignments() { + if (names_ == NULL) { + return Factory::empty_fixed_array(); + } + ASSERT(names_ != NULL); + ASSERT(assigned_arguments_ != NULL); + ASSERT_EQ(names_->length(), assigned_arguments_->length()); + ASSERT_EQ(names_->length(), assigned_constants_->length()); + Handle<FixedArray> assignments = + Factory::NewFixedArray(names_->length() * 3); + for (int i = 0; i < names_->length(); i++) { + assignments->set(i * 3, *names_->at(i)); + assignments->set(i * 3 + 1, Smi::FromInt(assigned_arguments_->at(i))); + assignments->set(i * 3 + 2, *assigned_constants_->at(i)); + } + return assignments; + } + + private: + bool IsThisPropertyAssignment(Assignment* assignment) { + if (assignment != NULL) { + Property* property = assignment->target()->AsProperty(); + return assignment->op() == Token::ASSIGN + && property != NULL + && property->obj()->AsVariableProxy() != NULL + && property->obj()->AsVariableProxy()->is_this(); + } + return false; + } + + void HandleThisPropertyAssignment(Scope* scope, Assignment* assignment) { + // Check that the property assigned to is a named property. + Property* property = assignment->target()->AsProperty(); + ASSERT(property != NULL); + Literal* literal = property->key()->AsLiteral(); + uint32_t dummy; + if (literal != NULL && + literal->handle()->IsString() && + !String::cast(*(literal->handle()))->AsArrayIndex(&dummy)) { + Handle<String> key = Handle<String>::cast(literal->handle()); + + // Check whether the value assigned is either a constant or matches the + // name of one of the arguments to the function. + if (assignment->value()->AsLiteral() != NULL) { + // Constant assigned. + Literal* literal = assignment->value()->AsLiteral(); + AssignmentFromConstant(key, literal->handle()); + } else if (assignment->value()->AsVariableProxy() != NULL) { + // Variable assigned. + Handle<String> name = + assignment->value()->AsVariableProxy()->name(); + // Check whether the variable assigned matches an argument name. + int index = -1; + for (int i = 0; i < scope->num_parameters(); i++) { + if (*scope->parameter(i)->name() == *name) { + // Assigned from function argument. + index = i; + break; + } + } + if (index != -1) { + AssignmentFromParameter(key, index); + } else { + AssignmentFromSomethingElse(key); + } + } else { + AssignmentFromSomethingElse(key); + } + } + } + + void AssignmentFromParameter(Handle<String> name, int index) { + EnsureAllocation(); + names_->Add(name); + assigned_arguments_->Add(index); + assigned_constants_->Add(Factory::undefined_value()); + } + + void AssignmentFromConstant(Handle<String> name, Handle<Object> value) { + EnsureAllocation(); + names_->Add(name); + assigned_arguments_->Add(-1); + assigned_constants_->Add(value); + } + + void AssignmentFromSomethingElse(Handle<String> name) { + EnsureAllocation(); + names_->Add(name); + assigned_arguments_->Add(-1); + assigned_constants_->Add(Factory::undefined_value()); + + // The this assignment is not a simple one. + only_simple_this_property_assignments_ = false; + } + + void EnsureAllocation() { + if (names_ == NULL) { + ASSERT(assigned_arguments_ == NULL); + ASSERT(assigned_constants_ == NULL); + names_ = new ZoneStringList(4); + assigned_arguments_ = new ZoneList<int>(4); + assigned_constants_ = new ZoneObjectList(4); + } + } + + bool only_this_property_assignments_; + bool only_simple_this_property_assignments_; + ZoneStringList* names_; + ZoneList<int>* assigned_arguments_; + ZoneObjectList* assigned_constants_; +}; + + void* Parser::ParseSourceElements(ZoneListWrapper<Statement>* processor, int end_token, bool* ok) { @@ -1432,15 +1628,33 @@ void* Parser::ParseSourceElements(ZoneListWrapper<Statement>* processor, ASSERT(processor != NULL); InitializationBlockFinder block_finder; + ThisNamedPropertyAssigmentFinder this_property_assignment_finder; while (peek() != end_token) { Statement* stat = ParseStatement(NULL, CHECK_OK); if (stat == NULL || stat->IsEmpty()) continue; // We find and mark the initialization blocks on top level code only. // This is because the optimization prevents reuse of the map transitions, // so it should be used only for code that will only be run once. - if (top_scope_->is_global_scope()) block_finder.Update(stat); + if (top_scope_->is_global_scope()) { + block_finder.Update(stat); + } + // Find and mark all assignments to named properties in this (this.x =) + if (top_scope_->is_function_scope()) { + this_property_assignment_finder.Update(top_scope_, stat); + } processor->Add(stat); } + + // Propagate the collected information on this property assignments. + if (top_scope_->is_function_scope()) { + if (this_property_assignment_finder.only_this_property_assignments()) { + temp_scope_->SetThisPropertyAssignmentInfo( + this_property_assignment_finder.only_this_property_assignments(), + this_property_assignment_finder. + only_simple_this_property_assignments(), + this_property_assignment_finder.GetThisPropertyAssignments()); + } + } return 0; } @@ -3507,6 +3721,9 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name, int materialized_literal_count; int expected_property_count; bool contains_array_literal; + bool only_this_property_assignments; + bool only_simple_this_property_assignments; + Handle<FixedArray> this_property_assignments; if (is_lazily_compiled && pre_data() != NULL) { FunctionEntry entry = pre_data()->GetFunctionEnd(start_pos); int end_pos = entry.end_pos(); @@ -3514,12 +3731,20 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name, scanner_.SeekForward(end_pos); materialized_literal_count = entry.literal_count(); expected_property_count = entry.property_count(); + only_this_property_assignments = false; + only_simple_this_property_assignments = false; + this_property_assignments = Factory::empty_fixed_array(); contains_array_literal = entry.contains_array_literal(); } else { ParseSourceElements(&body, Token::RBRACE, CHECK_OK); materialized_literal_count = temp_scope.materialized_literal_count(); expected_property_count = temp_scope.expected_property_count(); contains_array_literal = temp_scope.contains_array_literal(); + only_this_property_assignments = + temp_scope.only_this_property_assignments(); + only_simple_this_property_assignments = + temp_scope.only_simple_this_property_assignments(); + this_property_assignments = temp_scope.this_property_assignments(); } Expect(Token::RBRACE, CHECK_OK); @@ -3534,10 +3759,18 @@ FunctionLiteral* Parser::ParseFunctionLiteral(Handle<String> var_name, } FunctionLiteral* function_literal = - NEW(FunctionLiteral(name, top_scope_, - body.elements(), materialized_literal_count, - contains_array_literal, expected_property_count, - num_parameters, start_pos, end_pos, + NEW(FunctionLiteral(name, + top_scope_, + body.elements(), + materialized_literal_count, + contains_array_literal, + expected_property_count, + only_this_property_assignments, + only_simple_this_property_assignments, + this_property_assignments, + num_parameters, + start_pos, + end_pos, function_name->length() > 0)); if (!is_pre_parsing_) { function_literal->set_function_token_position(function_token_position); diff --git a/V8Binding/v8/src/platform-win32.cc b/V8Binding/v8/src/platform-win32.cc index 633b2c2..0a2d990 100644 --- a/V8Binding/v8/src/platform-win32.cc +++ b/V8Binding/v8/src/platform-win32.cc @@ -54,6 +54,10 @@ #define _WIN32_WINNT 0x500 #endif +#ifdef _WIN64 +#error Windows 64-bit blatforms not supported +#endif + #include <windows.h> #include <time.h> // For LocalOffset() implementation. diff --git a/V8Binding/v8/src/runtime.cc b/V8Binding/v8/src/runtime.cc index 36fdd65..b3e8aa4 100644 --- a/V8Binding/v8/src/runtime.cc +++ b/V8Binding/v8/src/runtime.cc @@ -4380,6 +4380,8 @@ static Object* Runtime_NewObject(Arguments args) { Handle<Code> stub = ComputeConstructStub(map); function->shared()->set_construct_stub(*stub); } + Counters::constructed_objects.Increment(); + Counters::constructed_objects_runtime.Increment(); return *result; } diff --git a/V8Binding/v8/src/scopes.cc b/V8Binding/v8/src/scopes.cc index 78ed035..25873fa 100644 --- a/V8Binding/v8/src/scopes.cc +++ b/V8Binding/v8/src/scopes.cc @@ -108,14 +108,31 @@ Variable* VariableMap::Lookup(Handle<String> name) { // Dummy constructor -Scope::Scope() - : inner_scopes_(0), +Scope::Scope(Type type) + : outer_scope_(NULL), + inner_scopes_(0), + type_(type), + scope_name_(Factory::empty_symbol()), variables_(false), temps_(0), params_(0), dynamics_(NULL), unresolved_(0), - decls_(0) { + decls_(0), + receiver_(NULL), + function_(NULL), + arguments_(NULL), + arguments_shadow_(NULL), + illegal_redecl_(NULL), + scope_inside_with_(false), + scope_contains_with_(false), + scope_calls_eval_(false), + outer_scope_calls_eval_(false), + inner_scope_calls_eval_(false), + outer_scope_is_eval_scope_(false), + force_eager_compilation_(false), + num_stack_slots_(0), + num_heap_slots_(0) { } diff --git a/V8Binding/v8/src/scopes.h b/V8Binding/v8/src/scopes.h index 5767d9f..fc627df 100644 --- a/V8Binding/v8/src/scopes.h +++ b/V8Binding/v8/src/scopes.h @@ -93,7 +93,6 @@ class Scope: public ZoneObject { GLOBAL_SCOPE // the top-level scope for a program or a top-level eval }; - Scope(); Scope(Scope* outer_scope, Type type); virtual ~Scope() { } @@ -130,7 +129,7 @@ class Scope: public ZoneObject { Variable* DeclareGlobal(Handle<String> name); // Add a parameter to the parameter list. The parameter must have been - // declared via Declare. The same parameter may occur more then once in + // declared via Declare. The same parameter may occur more than once in // the parameter list; they must be added in source order, from left to // right. void AddParameter(Variable* var); @@ -286,6 +285,8 @@ class Scope: public ZoneObject { protected: friend class ParserFactory; + explicit Scope(Type type); + // Scope tree. Scope* outer_scope_; // the immediately enclosing outer scope, or NULL ZoneList<Scope*> inner_scopes_; // the immediately enclosed inner scopes @@ -375,7 +376,7 @@ class Scope: public ZoneObject { class DummyScope : public Scope { public: - DummyScope() { + DummyScope() : Scope(GLOBAL_SCOPE) { outer_scope_ = this; } diff --git a/V8Binding/v8/src/spaces.cc b/V8Binding/v8/src/spaces.cc index 67d3482..9227a87 100644 --- a/V8Binding/v8/src/spaces.cc +++ b/V8Binding/v8/src/spaces.cc @@ -862,8 +862,6 @@ bool NewSpace::Setup(Address start, int size) { ASSERT(initial_semispace_capacity <= maximum_semispace_capacity); ASSERT(IsPowerOf2(maximum_semispace_capacity)); - maximum_capacity_ = maximum_semispace_capacity; - capacity_ = initial_semispace_capacity; // Allocate and setup the histogram arrays if necessary. #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING) @@ -876,15 +874,17 @@ bool NewSpace::Setup(Address start, int size) { #undef SET_NAME #endif - ASSERT(size == 2 * maximum_capacity_); + ASSERT(size == 2 * maximum_semispace_capacity); ASSERT(IsAddressAligned(start, size, 0)); - if (!to_space_.Setup(start, capacity_, maximum_capacity_)) { + if (!to_space_.Setup(start, + initial_semispace_capacity, + maximum_semispace_capacity)) { return false; } - if (!from_space_.Setup(start + maximum_capacity_, - capacity_, - maximum_capacity_)) { + if (!from_space_.Setup(start + maximum_semispace_capacity, + initial_semispace_capacity, + maximum_semispace_capacity)) { return false; } @@ -916,7 +916,6 @@ void NewSpace::TearDown() { #endif start_ = NULL; - capacity_ = 0; allocation_info_.top = NULL; allocation_info_.limit = NULL; mc_forwarding_info_.top = NULL; @@ -953,12 +952,11 @@ void NewSpace::Flip() { bool NewSpace::Grow() { - ASSERT(capacity_ < maximum_capacity_); + ASSERT(Capacity() < MaximumCapacity()); // TODO(1240712): Failure to double the from space can result in // semispaces of different sizes. In the event of that failure, the // to space doubling should be rolled back before returning false. if (!to_space_.Grow() || !from_space_.Grow()) return false; - capacity_ = to_space_.Capacity() + from_space_.Capacity(); allocation_info_.limit = to_space_.high(); ASSERT_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_); return true; @@ -1082,10 +1080,9 @@ void SemiSpace::TearDown() { bool SemiSpace::Grow() { // Commit 50% extra space but only up to maximum capacity. - int extra = RoundUp(capacity_ / 2, OS::AllocateAlignment()); - if (capacity_ + extra > maximum_capacity_) { - extra = maximum_capacity_ - capacity_; - } + int maximum_extra = maximum_capacity_ - capacity_; + int extra = Min(RoundUp(capacity_ / 2, OS::AllocateAlignment()), + maximum_extra); if (!MemoryAllocator::CommitBlock(high(), extra, executable())) { return false; } diff --git a/V8Binding/v8/src/spaces.h b/V8Binding/v8/src/spaces.h index 15f0628..f12e0e4 100644 --- a/V8Binding/v8/src/spaces.h +++ b/V8Binding/v8/src/spaces.h @@ -1054,6 +1054,10 @@ class SemiSpace : public Space { // Returns the current capacity of the semi space. int Capacity() { return capacity_; } + // Returns the maximum capacity of the semi space. + int MaximumCapacity() { return maximum_capacity_; } + + private: // The current and maximum capacity of the space. int capacity_; @@ -1164,12 +1168,18 @@ class NewSpace : public Space { // Return the allocated bytes in the active semispace. virtual int Size() { return top() - bottom(); } // Return the current capacity of a semispace. - int Capacity() { return capacity_; } + int Capacity() { + ASSERT(to_space_.Capacity() == from_space_.Capacity()); + return to_space_.Capacity(); + } // Return the available bytes without growing in the active semispace. int Available() { return Capacity() - Size(); } // Return the maximum capacity of a semispace. - int MaximumCapacity() { return maximum_capacity_; } + int MaximumCapacity() { + ASSERT(to_space_.MaximumCapacity() == from_space_.MaximumCapacity()); + return to_space_.MaximumCapacity(); + } // Return the address of the allocation pointer in the active semispace. Address top() { return allocation_info_.top; } @@ -1275,10 +1285,6 @@ class NewSpace : public Space { } private: - // The current and maximum capacities of a semispace. - int capacity_; - int maximum_capacity_; - // The semispaces. SemiSpace to_space_; SemiSpace from_space_; diff --git a/V8Binding/v8/src/third_party/dtoa/dtoa.c b/V8Binding/v8/src/third_party/dtoa/dtoa.c index 5caa96d..fadc6d1 100644 --- a/V8Binding/v8/src/third_party/dtoa/dtoa.c +++ b/V8Binding/v8/src/third_party/dtoa/dtoa.c @@ -1535,7 +1535,7 @@ strtod double aadj, aadj1, adj, rv, rv0; Long L; ULong y, z; - Bigint *bb, *bb1, *bd, *bd0, *bs, *delta; + Bigint *bb = NULL, *bb1, *bd = NULL, *bd0, *bs = NULL, *delta = NULL; #ifdef SET_INEXACT int inexact, oldinexact; #endif diff --git a/V8Binding/v8/src/top.cc b/V8Binding/v8/src/top.cc index 96d4a01..550703a 100644 --- a/V8Binding/v8/src/top.cc +++ b/V8Binding/v8/src/top.cc @@ -98,6 +98,7 @@ void Top::InitializeThreadLocal() { thread_local_.stack_is_cooked_ = false; thread_local_.try_catch_handler_ = NULL; thread_local_.context_ = NULL; + thread_local_.thread_id_ = ThreadManager::kInvalidId; thread_local_.external_caught_exception_ = false; thread_local_.failed_access_check_callback_ = NULL; clear_pending_exception(); @@ -598,6 +599,12 @@ Failure* Top::StackOverflow() { } +Failure* Top::TerminateExecution() { + DoThrow(Heap::termination_exception(), NULL, NULL); + return Failure::Exception(); +} + + Failure* Top::Throw(Object* exception, MessageLocation* location) { DoThrow(exception, location, NULL); return Failure::Exception(); @@ -694,7 +701,8 @@ void Top::ReportUncaughtException(Handle<Object> exception, } -bool Top::ShouldReportException(bool* is_caught_externally) { +bool Top::ShouldReturnException(bool* is_caught_externally, + bool catchable_by_javascript) { // Find the top-most try-catch handler. StackHandler* handler = StackHandler::FromAddress(Top::handler(Top::GetCurrentThread())); @@ -712,7 +720,8 @@ bool Top::ShouldReportException(bool* is_caught_externally) { // // See comments in RegisterTryCatchHandler for details. *is_caught_externally = try_catch != NULL && - (handler == NULL || handler == try_catch->js_handler_); + (handler == NULL || handler == try_catch->js_handler_ || + !catchable_by_javascript); if (*is_caught_externally) { // Only report the exception if the external handler is verbose. @@ -735,12 +744,17 @@ void Top::DoThrow(Object* exception, // Determine reporting and whether the exception is caught externally. bool is_caught_externally = false; bool is_out_of_memory = exception == Failure::OutOfMemoryException(); - bool should_return_exception = ShouldReportException(&is_caught_externally); - bool report_exception = !is_out_of_memory && should_return_exception; + bool is_termination_exception = exception == Heap::termination_exception(); + bool catchable_by_javascript = !is_termination_exception && !is_out_of_memory; + bool should_return_exception = + ShouldReturnException(&is_caught_externally, catchable_by_javascript); + bool report_exception = catchable_by_javascript && should_return_exception; #ifdef ENABLE_DEBUGGER_SUPPORT // Notify debugger of exception. - Debugger::OnException(exception_handle, report_exception); + if (catchable_by_javascript) { + Debugger::OnException(exception_handle, report_exception); + } #endif // Generate the message. @@ -791,14 +805,21 @@ void Top::ReportPendingMessages() { // the global context. Note: We have to mark the global context here // since the GenerateThrowOutOfMemory stub cannot make a RuntimeCall to // set it. + bool external_caught = thread_local_.external_caught_exception_; HandleScope scope; if (thread_local_.pending_exception_ == Failure::OutOfMemoryException()) { context()->mark_out_of_memory(); + } else if (thread_local_.pending_exception_ == + Heap::termination_exception()) { + if (external_caught) { + thread_local_.try_catch_handler_->can_continue_ = false; + thread_local_.try_catch_handler_->exception_ = Heap::null_value(); + } } else { Handle<Object> exception(pending_exception()); - bool external_caught = thread_local_.external_caught_exception_; thread_local_.external_caught_exception_ = false; if (external_caught) { + thread_local_.try_catch_handler_->can_continue_ = true; thread_local_.try_catch_handler_->exception_ = thread_local_.pending_exception_; if (!thread_local_.pending_message_obj_->IsTheHole()) { @@ -834,16 +855,30 @@ void Top::TraceException(bool flag) { } -bool Top::optional_reschedule_exception(bool is_bottom_call) { +bool Top::OptionalRescheduleException(bool is_bottom_call, + bool force_clear_catchable) { // Allways reschedule out of memory exceptions. if (!is_out_of_memory()) { - // Never reschedule the exception if this is the bottom call. - bool clear_exception = is_bottom_call; + bool is_termination_exception = + pending_exception() == Heap::termination_exception(); + + // Do not reschedule the exception if this is the bottom call or + // if we are asked to clear catchable exceptions. Termination + // exceptions are not catchable and are only cleared if this is + // the bottom call. + bool clear_exception = is_bottom_call || + (force_clear_catchable && !is_termination_exception); - // If the exception is externally caught, clear it if there are no - // JavaScript frames on the way to the C++ frame that has the - // external handler. - if (thread_local_.external_caught_exception_) { + if (is_termination_exception) { + thread_local_.external_caught_exception_ = false; + if (is_bottom_call) { + clear_pending_exception(); + return false; + } + } else if (thread_local_.external_caught_exception_) { + // If the exception is externally caught, clear it if there are no + // JavaScript frames on the way to the C++ frame that has the + // external handler. ASSERT(thread_local_.try_catch_handler_ != NULL); Address external_handler_address = reinterpret_cast<Address>(thread_local_.try_catch_handler_); diff --git a/V8Binding/v8/src/top.h b/V8Binding/v8/src/top.h index 25242f7..d4d73c2 100644 --- a/V8Binding/v8/src/top.h +++ b/V8Binding/v8/src/top.h @@ -46,6 +46,7 @@ class ThreadLocalTop BASE_EMBEDDED { // The context where the current execution method is created and for variable // lookups. Context* context_; + int thread_id_; Object* pending_exception_; bool has_pending_message_; const char* pending_message_; @@ -118,6 +119,10 @@ class Top { thread_local_.save_context_ = save; } + // Access to current thread id. + static int thread_id() { return thread_local_.thread_id_; } + static void set_thread_id(int id) { thread_local_.thread_id_ = id; } + // Interface to pending exception. static Object* pending_exception() { ASSERT(has_pending_exception()); @@ -152,7 +157,8 @@ class Top { // exceptions. If an exception was thrown and not handled by an external // handler the exception is scheduled to be rethrown when we return to running // JavaScript code. If an exception is scheduled true is returned. - static bool optional_reschedule_exception(bool is_bottom_call); + static bool OptionalRescheduleException(bool is_bottom_call, + bool force_clear_catchable); static bool* external_caught_exception_address() { return &thread_local_.external_caught_exception_; @@ -246,7 +252,8 @@ class Top { static void DoThrow(Object* exception, MessageLocation* location, const char* message); - static bool ShouldReportException(bool* is_caught_externally); + static bool ShouldReturnException(bool* is_caught_externally, + bool catchable_by_javascript); static void ReportUncaughtException(Handle<Object> exception, MessageLocation* location, Handle<String> stack_trace); @@ -260,6 +267,7 @@ class Top { // Out of resource exception helpers. static Failure* StackOverflow(); + static Failure* TerminateExecution(); // Administration static void Initialize(); diff --git a/V8Binding/v8/src/v8-counters.h b/V8Binding/v8/src/v8-counters.h index a62cd74..43cd5e3 100644 --- a/V8Binding/v8/src/v8-counters.h +++ b/V8Binding/v8/src/v8-counters.h @@ -139,6 +139,8 @@ namespace internal { SC(named_store_global_inline_miss, V8.NamedStoreGlobalInlineMiss) \ SC(call_global_inline, V8.CallGlobalInline) \ SC(call_global_inline_miss, V8.CallGlobalInlineMiss) \ + SC(constructed_objects, V8.ConstructedObjects) \ + SC(constructed_objects_runtime, V8.ConstructedObjectsRuntime) \ SC(for_in, V8.ForIn) \ SC(enum_cache_hits, V8.EnumCacheHits) \ SC(enum_cache_misses, V8.EnumCacheMisses) \ diff --git a/V8Binding/v8/src/v8threads.cc b/V8Binding/v8/src/v8threads.cc index c5fc9fa..8e0a8be 100644 --- a/V8Binding/v8/src/v8threads.cc +++ b/V8Binding/v8/src/v8threads.cc @@ -151,6 +151,10 @@ bool ThreadManager::RestoreThread() { from = RegExpStack::RestoreStack(from); from = Bootstrapper::RestoreState(from); Thread::SetThreadLocal(thread_state_key, NULL); + if (state->terminate_on_restore()) { + StackGuard::TerminateExecution(); + state->set_terminate_on_restore(false); + } state->set_id(kInvalidId); state->Unlink(); state->LinkInto(ThreadState::FREE_LIST); @@ -188,6 +192,7 @@ ThreadState* ThreadState::in_use_anchor_ = new ThreadState(); ThreadState::ThreadState() : id_(ThreadManager::kInvalidId), + terminate_on_restore_(false), next_(this), previous_(this) { } @@ -317,7 +322,21 @@ int ThreadManager::CurrentId() { void ThreadManager::AssignId() { if (!Thread::HasThreadLocal(thread_id_key)) { - Thread::SetThreadLocalInt(thread_id_key, next_id_++); + ASSERT(Locker::IsLocked()); + int thread_id = next_id_++; + Thread::SetThreadLocalInt(thread_id_key, thread_id); + Top::set_thread_id(thread_id); + } +} + + +void ThreadManager::TerminateExecution(int thread_id) { + for (ThreadState* state = ThreadState::FirstInUse(); + state != NULL; + state = state->Next()) { + if (thread_id == state->id()) { + state->set_terminate_on_restore(true); + } } } diff --git a/V8Binding/v8/src/v8threads.h b/V8Binding/v8/src/v8threads.h index 83f69f0..3f81f57 100644 --- a/V8Binding/v8/src/v8threads.h +++ b/V8Binding/v8/src/v8threads.h @@ -50,6 +50,12 @@ class ThreadState { void set_id(int id) { id_ = id; } int id() { return id_; } + // Should the thread be terminated when it is restored? + bool terminate_on_restore() { return terminate_on_restore_; } + void set_terminate_on_restore(bool terminate_on_restore) { + terminate_on_restore_ = terminate_on_restore; + } + // Get data area for archiving a thread. char* data() { return data_; } private: @@ -58,6 +64,7 @@ class ThreadState { void AllocateSpace(); int id_; + bool terminate_on_restore_; char* data_; ThreadState* next_; ThreadState* previous_; @@ -88,6 +95,8 @@ class ThreadManager : public AllStatic { static int CurrentId(); static void AssignId(); + static void TerminateExecution(int thread_id); + static const int kInvalidId = -1; private: static void EagerlyArchiveThread(); diff --git a/V8Binding/v8/src/version.cc b/V8Binding/v8/src/version.cc index 791c87c..9609938 100644 --- a/V8Binding/v8/src/version.cc +++ b/V8Binding/v8/src/version.cc @@ -34,7 +34,7 @@ // cannot be changed without changing the SCons build script. #define MAJOR_VERSION 1 #define MINOR_VERSION 3 -#define BUILD_NUMBER 5 +#define BUILD_NUMBER 6 #define PATCH_LEVEL 0 #define CANDIDATE_VERSION true diff --git a/V8Binding/v8/src/x64/assembler-x64-inl.h b/V8Binding/v8/src/x64/assembler-x64-inl.h index 196f2ee..f51a3ea 100644 --- a/V8Binding/v8/src/x64/assembler-x64-inl.h +++ b/V8Binding/v8/src/x64/assembler-x64-inl.h @@ -228,43 +228,47 @@ void RelocInfo::set_target_object(Object* target) { bool RelocInfo::IsCallInstruction() { - UNIMPLEMENTED(); // IA32 code below. - return *pc_ == 0xE8; + // The recognized call sequence is: + // movq(kScratchRegister, immediate64); call(kScratchRegister); + // It only needs to be distinguished from a return sequence + // movq(rsp, rbp); pop(rbp); ret(n); int3 *6 + // The 11th byte is int3 (0xCC) in the return sequence and + // REX.WB (0x48+register bit) for the call sequence. + return pc_[10] != 0xCC; } Address RelocInfo::call_address() { - UNIMPLEMENTED(); // IA32 code below. ASSERT(IsCallInstruction()); - return Assembler::target_address_at(pc_ + 1); + return Assembler::target_address_at( + pc_ + Assembler::kPatchReturnSequenceAddressOffset); } void RelocInfo::set_call_address(Address target) { - UNIMPLEMENTED(); // IA32 code below. ASSERT(IsCallInstruction()); - Assembler::set_target_address_at(pc_ + 1, target); + Assembler::set_target_address_at( + pc_ + Assembler::kPatchReturnSequenceAddressOffset, + target); } Object* RelocInfo::call_object() { - UNIMPLEMENTED(); // IA32 code below. ASSERT(IsCallInstruction()); return *call_object_address(); } void RelocInfo::set_call_object(Object* target) { - UNIMPLEMENTED(); // IA32 code below. ASSERT(IsCallInstruction()); *call_object_address() = target; } Object** RelocInfo::call_object_address() { - UNIMPLEMENTED(); // IA32 code below. ASSERT(IsCallInstruction()); - return reinterpret_cast<Object**>(pc_ + 1); + return reinterpret_cast<Object**>( + pc_ + Assembler::kPatchReturnSequenceAddressOffset); } // ----------------------------------------------------------------------------- diff --git a/V8Binding/v8/src/x64/assembler-x64.cc b/V8Binding/v8/src/x64/assembler-x64.cc index 2607ecc..a02557e 100644 --- a/V8Binding/v8/src/x64/assembler-x64.cc +++ b/V8Binding/v8/src/x64/assembler-x64.cc @@ -178,6 +178,13 @@ void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) { } +void RelocInfo::PatchCode(byte* instructions, int instruction_count) { + // Patch the code at the current address with the supplied instructions. + for (int i = 0; i < instruction_count; i++) { + *(pc_ + i) = *(instructions + i); + } +} + // ----------------------------------------------------------------------------- // Implementation of Operand @@ -1071,6 +1078,16 @@ void Assembler::jmp(Register target) { } +void Assembler::jmp(const Operand& src) { + EnsureSpace ensure_space(this); + last_pc_ = pc_; + // Opcode FF/4 m64 + emit_optional_rex_32(src); + emit(0xFF); + emit_operand(0x4, src); +} + + void Assembler::lea(Register dst, const Operand& src) { EnsureSpace ensure_space(this); last_pc_ = pc_; diff --git a/V8Binding/v8/src/x64/assembler-x64.h b/V8Binding/v8/src/x64/assembler-x64.h index 2130fb0..9d602b9 100644 --- a/V8Binding/v8/src/x64/assembler-x64.h +++ b/V8Binding/v8/src/x64/assembler-x64.h @@ -442,8 +442,10 @@ class Assembler : public Malloced { // Distance between the address of the code target in the call instruction // and the return address. Checked in the debug build. - static const int kTargetAddrToReturnAddrDist = 3 + kPointerSize; - + static const int kPatchReturnSequenceLength = 3 + kPointerSize; + // Distance between start of patched return sequence and the emitted address + // to jump to (movq = REX.W 0xB8+r.). + static const int kPatchReturnSequenceAddressOffset = 2; // --------------------------------------------------------------------------- // Code generation @@ -917,6 +919,9 @@ class Assembler : public Malloced { // Jump near absolute indirect (r64) void jmp(Register adr); + // Jump near absolute indirect (m64) + void jmp(const Operand& src); + // Conditional jumps void j(Condition cc, Label* L); diff --git a/V8Binding/v8/src/x64/builtins-x64.cc b/V8Binding/v8/src/x64/builtins-x64.cc index 087aaff..6988d72 100644 --- a/V8Binding/v8/src/x64/builtins-x64.cc +++ b/V8Binding/v8/src/x64/builtins-x64.cc @@ -35,7 +35,7 @@ namespace internal { #define __ ACCESS_MASM(masm) void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) { - // TODO(1238487): Don't pass the function in a static variable. + // TODO(428): Don't pass the function in a static variable. ExternalReference passed = ExternalReference::builtin_passed_function(); __ movq(kScratchRegister, passed.address(), RelocInfo::EXTERNAL_REFERENCE); __ movq(Operand(kScratchRegister, 0), rdi); @@ -505,7 +505,14 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { Label rt_call, allocated; if (FLAG_inline_new) { Label undo_allocation; - // TODO(X64): Enable debugger support, using debug_step_in_fp. + +#ifdef ENABLE_DEBUGGER_SUPPORT + ExternalReference debug_step_in_fp = + ExternalReference::debug_step_in_fp_address(); + __ movq(kScratchRegister, debug_step_in_fp); + __ cmpq(Operand(kScratchRegister, 0), Immediate(0)); + __ j(not_equal, &rt_call); +#endif // Verified that the constructor is a JSFunction. // Load the initial map and verify that it is in fact a map. @@ -585,12 +592,16 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { // rax: initial map // rbx: JSObject // rdi: start of next object + // Calculate total properties described map. __ movzxbq(rdx, FieldOperand(rax, Map::kUnusedPropertyFieldsOffset)); - __ movzxbq(rcx, FieldOperand(rax, Map::kInObjectPropertiesOffset)); + __ movzxbq(rcx, FieldOperand(rax, Map::kPreAllocatedPropertyFieldsOffset)); + __ addq(rdx, rcx); // Calculate unused properties past the end of the in-object properties. + __ movzxbq(rcx, FieldOperand(rax, Map::kInObjectPropertiesOffset)); __ subq(rdx, rcx); // Done if no extra properties are to be allocated. __ j(zero, &allocated); + __ Assert(positive, "Property allocation count failed."); // Scale the number of elements by pointer size and add the header for // FixedArrays to the start of the next object calculation from above. @@ -726,6 +737,7 @@ void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) { __ pop(rcx); __ lea(rsp, Operand(rsp, rbx, times_4, 1 * kPointerSize)); // 1 ~ receiver __ push(rcx); + __ IncrementCounter(&Counters::constructed_objects, 1); __ ret(0); } @@ -823,10 +835,8 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, // Invoke the code. if (is_construct) { // Expects rdi to hold function pointer. - __ movq(kScratchRegister, - Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)), + __ Call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)), RelocInfo::CODE_TARGET); - __ call(kScratchRegister); } else { ParameterCount actual(rax); // Function must be in rdi. diff --git a/V8Binding/v8/src/x64/cfg-x64.cc b/V8Binding/v8/src/x64/cfg-x64.cc index 8d01ed2..34ddbbf 100644 --- a/V8Binding/v8/src/x64/cfg-x64.cc +++ b/V8Binding/v8/src/x64/cfg-x64.cc @@ -114,8 +114,8 @@ void ExitNode::Compile(MacroAssembler* masm) { int count = CfgGlobals::current()->fun()->scope()->num_parameters(); __ ret((count + 1) * kPointerSize); // Add padding that will be overwritten by a debugger breakpoint. - // "movq rsp, rbp; pop rbp" has length 5. "ret k" has length 2. - const int kPadding = Debug::kX64JSReturnSequenceLength - 5 - 2; + // "movq rsp, rbp; pop rbp" has length 4. "ret k" has length 3. + const int kPadding = Debug::kX64JSReturnSequenceLength - 4 - 3; for (int i = 0; i < kPadding; ++i) { __ int3(); } diff --git a/V8Binding/v8/src/x64/codegen-x64.cc b/V8Binding/v8/src/x64/codegen-x64.cc index 4f332ca..462b960 100644 --- a/V8Binding/v8/src/x64/codegen-x64.cc +++ b/V8Binding/v8/src/x64/codegen-x64.cc @@ -500,17 +500,19 @@ void CodeGenerator::GenerateReturnSequence(Result* return_value) { return_value->ToRegister(rax); // Add a label for checking the size of the code used for returning. +#ifdef DEBUG Label check_exit_codesize; masm_->bind(&check_exit_codesize); +#endif // Leave the frame and return popping the arguments and the // receiver. frame_->Exit(); masm_->ret((scope_->num_parameters() + 1) * kPointerSize); // Add padding that will be overwritten by a debugger breakpoint. - // frame_->Exit() generates "movq rsp, rbp; pop rbp" length 5. - // "ret k" has length 2. - const int kPadding = Debug::kX64JSReturnSequenceLength - 5 - 2; + // frame_->Exit() generates "movq rsp, rbp; pop rbp; ret k" + // with length 7 (3 + 1 + 3). + const int kPadding = Debug::kX64JSReturnSequenceLength - 7; for (int i = 0; i < kPadding; ++i) { masm_->int3(); } @@ -5731,6 +5733,13 @@ void Reference::GetValue(TypeofState typeof_state) { ASSERT(cgen_->HasValidEntryRegisters()); ASSERT(!is_illegal()); MacroAssembler* masm = cgen_->masm(); + + // Record the source position for the property load. + Property* property = expression_->AsProperty(); + if (property != NULL) { + cgen_->CodeForSourcePosition(property->position()); + } + switch (type_) { case SLOT: { Comment cmnt(masm, "[ Load from Slot"); @@ -6738,6 +6747,7 @@ void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) { void CEntryStub::GenerateCore(MacroAssembler* masm, Label* throw_normal_exception, + Label* throw_termination_exception, Label* throw_out_of_memory_exception, StackFrame::Type frame_type, bool do_gc, @@ -6810,11 +6820,10 @@ void CEntryStub::GenerateCore(MacroAssembler* masm, __ testl(rax, Immediate(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize)); __ j(zero, &retry); - Label continue_exception; - // If the returned failure is EXCEPTION then promote Top::pending_exception(). - __ movq(kScratchRegister, Failure::Exception(), RelocInfo::NONE); + // Special handling of out of memory exceptions. + __ movq(kScratchRegister, Failure::OutOfMemoryException(), RelocInfo::NONE); __ cmpq(rax, kScratchRegister); - __ j(not_equal, &continue_exception); + __ j(equal, throw_out_of_memory_exception); // Retrieve the pending exception and clear the variable. ExternalReference pending_exception_address(Top::k_pending_exception_address); @@ -6824,11 +6833,10 @@ void CEntryStub::GenerateCore(MacroAssembler* masm, __ movq(rdx, Operand(rdx, 0)); __ movq(Operand(kScratchRegister, 0), rdx); - __ bind(&continue_exception); - // Special handling of out of memory exception. - __ movq(kScratchRegister, Failure::OutOfMemoryException(), RelocInfo::NONE); - __ cmpq(rax, kScratchRegister); - __ j(equal, throw_out_of_memory_exception); + // Special handling of termination exceptions which are uncatchable + // by javascript code. + __ Cmp(rax, Factory::termination_exception()); + __ j(equal, throw_termination_exception); // Handle normal exception. __ jmp(throw_normal_exception); @@ -6838,7 +6846,8 @@ void CEntryStub::GenerateCore(MacroAssembler* masm, } -void CEntryStub::GenerateThrowOutOfMemory(MacroAssembler* masm) { +void CEntryStub::GenerateThrowUncatchable(MacroAssembler* masm, + UncatchableExceptionType type) { // Fetch top stack handler. ExternalReference handler_address(Top::k_handler_address); __ movq(kScratchRegister, handler_address); @@ -6848,30 +6857,32 @@ void CEntryStub::GenerateThrowOutOfMemory(MacroAssembler* masm) { Label loop, done; __ bind(&loop); // Load the type of the current stack handler. - __ cmpq(Operand(rsp, StackHandlerConstants::kStateOffset), - Immediate(StackHandler::ENTRY)); + const int kStateOffset = StackHandlerConstants::kStateOffset; + __ cmpq(Operand(rsp, kStateOffset), Immediate(StackHandler::ENTRY)); __ j(equal, &done); // Fetch the next handler in the list. - ASSERT(StackHandlerConstants::kNextOffset == 0); - __ pop(rsp); + const int kNextOffset = StackHandlerConstants::kNextOffset; + __ movq(rsp, Operand(rsp, kNextOffset)); __ jmp(&loop); __ bind(&done); // Set the top handler address to next handler past the current ENTRY handler. - __ pop(rax); - __ store_rax(handler_address); + __ movq(kScratchRegister, handler_address); + __ pop(Operand(kScratchRegister, 0)); - // Set external caught exception to false. - __ movq(rax, Immediate(false)); - ExternalReference external_caught(Top::k_external_caught_exception_address); - __ store_rax(external_caught); + if (type == OUT_OF_MEMORY) { + // Set external caught exception to false. + ExternalReference external_caught(Top::k_external_caught_exception_address); + __ movq(rax, Immediate(false)); + __ store_rax(external_caught); - // Set pending exception and rax to out of memory exception. - __ movq(rax, Failure::OutOfMemoryException(), RelocInfo::NONE); - ExternalReference pending_exception(Top::k_pending_exception_address); - __ store_rax(pending_exception); + // Set pending exception and rax to out of memory exception. + ExternalReference pending_exception(Top::k_pending_exception_address); + __ movq(rax, Failure::OutOfMemoryException(), RelocInfo::NONE); + __ store_rax(pending_exception); + } - // Clear the context pointer; + // Clear the context pointer. __ xor_(rsi, rsi); // Restore registers from handler. @@ -6947,25 +6958,23 @@ void CEntryStub::GenerateBody(MacroAssembler* masm, bool is_debug_break) { // r14: number of arguments including receiver (C callee-saved). // r15: argv pointer (C callee-saved). - Label throw_out_of_memory_exception; Label throw_normal_exception; + Label throw_termination_exception; + Label throw_out_of_memory_exception; - // Call into the runtime system. Collect garbage before the call if - // running with --gc-greedy set. - if (FLAG_gc_greedy) { - Failure* failure = Failure::RetryAfterGC(0); - __ movq(rax, failure, RelocInfo::NONE); - } + // Call into the runtime system. GenerateCore(masm, &throw_normal_exception, + &throw_termination_exception, &throw_out_of_memory_exception, frame_type, - FLAG_gc_greedy, + false, false); // Do space-specific GC and retry runtime call. GenerateCore(masm, &throw_normal_exception, + &throw_termination_exception, &throw_out_of_memory_exception, frame_type, true, @@ -6976,14 +6985,17 @@ void CEntryStub::GenerateBody(MacroAssembler* masm, bool is_debug_break) { __ movq(rax, failure, RelocInfo::NONE); GenerateCore(masm, &throw_normal_exception, + &throw_termination_exception, &throw_out_of_memory_exception, frame_type, true, true); __ bind(&throw_out_of_memory_exception); - GenerateThrowOutOfMemory(masm); - // control flow for generated will not return. + GenerateThrowUncatchable(masm, OUT_OF_MEMORY); + + __ bind(&throw_termination_exception); + GenerateThrowUncatchable(masm, TERMINATION); __ bind(&throw_normal_exception); GenerateThrowTOS(masm); @@ -7529,11 +7541,10 @@ void GenericBinaryOpStub::Generate(MacroAssembler* masm) { // Reserve space for converted numbers. __ subq(rsp, Immediate(2 * kPointerSize)); - bool use_sse3 = CpuFeatures::IsSupported(CpuFeatures::SSE3); - if (use_sse3) { + if (use_sse3_) { // Truncate the operands to 32-bit integers and check for // exceptions in doing so. - CpuFeatures::Scope scope(CpuFeatures::SSE3); + CpuFeatures::Scope scope(CpuFeatures::SSE3); __ fisttp_s(Operand(rsp, 0 * kPointerSize)); __ fisttp_s(Operand(rsp, 1 * kPointerSize)); __ fnstsw_ax(); @@ -7618,7 +7629,7 @@ void GenericBinaryOpStub::Generate(MacroAssembler* masm) { // the runtime system. __ bind(&operand_conversion_failure); __ addq(rsp, Immediate(2 * kPointerSize)); - if (use_sse3) { + if (use_sse3_) { // If we've used the SSE3 instructions for truncating the // floating point values to integers and it failed, we have a // pending #IA exception. Clear it. diff --git a/V8Binding/v8/src/x64/codegen-x64.h b/V8Binding/v8/src/x64/codegen-x64.h index d78be49..bfdff56 100644 --- a/V8Binding/v8/src/x64/codegen-x64.h +++ b/V8Binding/v8/src/x64/codegen-x64.h @@ -619,6 +619,7 @@ class GenericBinaryOpStub: public CodeStub { OverwriteMode mode, GenericBinaryFlags flags) : op_(op), mode_(mode), flags_(flags) { + use_sse3_ = CpuFeatures::IsSupported(CpuFeatures::SSE3); ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); } @@ -628,6 +629,7 @@ class GenericBinaryOpStub: public CodeStub { Token::Value op_; OverwriteMode mode_; GenericBinaryFlags flags_; + bool use_sse3_; const char* GetName(); @@ -640,17 +642,19 @@ class GenericBinaryOpStub: public CodeStub { } #endif - // Minor key encoding in 16 bits FOOOOOOOOOOOOOMM. + // Minor key encoding in 16 bits FSOOOOOOOOOOOOMM. class ModeBits: public BitField<OverwriteMode, 0, 2> {}; - class OpBits: public BitField<Token::Value, 2, 13> {}; + class OpBits: public BitField<Token::Value, 2, 12> {}; + class SSE3Bits: public BitField<bool, 14, 1> {}; class FlagBits: public BitField<GenericBinaryFlags, 15, 1> {}; Major MajorKey() { return GenericBinaryOp; } int MinorKey() { // Encode the parameters in a unique 16 bit value. return OpBits::encode(op_) - | ModeBits::encode(mode_) - | FlagBits::encode(flags_); + | ModeBits::encode(mode_) + | FlagBits::encode(flags_) + | SSE3Bits::encode(use_sse3_); } void Generate(MacroAssembler* masm); }; diff --git a/V8Binding/v8/src/x64/debug-x64.cc b/V8Binding/v8/src/x64/debug-x64.cc index 177eb90..f2bb62b 100644 --- a/V8Binding/v8/src/x64/debug-x64.cc +++ b/V8Binding/v8/src/x64/debug-x64.cc @@ -39,60 +39,176 @@ namespace internal { bool Debug::IsDebugBreakAtReturn(v8::internal::RelocInfo* rinfo) { ASSERT(RelocInfo::IsJSReturn(rinfo->rmode())); - // 11th byte of patch is 0x49, 11th byte of JS return is 0xCC (int3). + // 11th byte of patch is 0x49 (REX.WB byte of computed jump/call to r10), + // 11th byte of JS return is 0xCC (int3). ASSERT(*(rinfo->pc() + 10) == 0x49 || *(rinfo->pc() + 10) == 0xCC); - return (*(rinfo->pc() + 10) == 0x49); + return (*(rinfo->pc() + 10) != 0xCC); } +#define __ ACCESS_MASM(masm) + +static void Generate_DebugBreakCallHelper(MacroAssembler* masm, + RegList pointer_regs, + bool convert_call_to_jmp) { + // Save the content of all general purpose registers in memory. This copy in + // memory is later pushed onto the JS expression stack for the fake JS frame + // generated and also to the C frame generated on top of that. In the JS + // frame ONLY the registers containing pointers will be pushed on the + // expression stack. This causes the GC to update these pointers so that + // they will have the correct value when returning from the debugger. + __ SaveRegistersToMemory(kJSCallerSaved); + + // Enter an internal frame. + __ EnterInternalFrame(); + + // Store the registers containing object pointers on the expression stack to + // make sure that these are correctly updated during GC. + __ PushRegistersFromMemory(pointer_regs); + +#ifdef DEBUG + __ RecordComment("// Calling from debug break to runtime - come in - over"); +#endif + __ xor_(rax, rax); // No arguments (argc == 0). + __ movq(rbx, ExternalReference::debug_break()); + + CEntryDebugBreakStub ceb; + __ CallStub(&ceb); + + // Restore the register values containing object pointers from the expression + // stack in the reverse order as they where pushed. + __ PopRegistersToMemory(pointer_regs); + + // Get rid of the internal frame. + __ LeaveInternalFrame(); + + // If this call did not replace a call but patched other code then there will + // be an unwanted return address left on the stack. Here we get rid of that. + if (convert_call_to_jmp) { + __ pop(rax); + } + + // Finally restore all registers. + __ RestoreRegistersFromMemory(kJSCallerSaved); + + // Now that the break point has been handled, resume normal execution by + // jumping to the target address intended by the caller and that was + // overwritten by the address of DebugBreakXXX. + ExternalReference after_break_target = + ExternalReference(Debug_Address::AfterBreakTarget()); + __ movq(kScratchRegister, after_break_target); + __ jmp(Operand(kScratchRegister, 0)); +} + + void Debug::GenerateCallICDebugBreak(MacroAssembler* masm) { - masm->int3(); // UNIMPLEMENTED + // Register state for keyed IC call call (from ic-x64.cc) + // ----------- S t a t e ------------- + // -- rax: number of arguments + // ----------------------------------- + // The number of arguments in rax is not smi encoded. + Generate_DebugBreakCallHelper(masm, 0, false); } + void Debug::GenerateConstructCallDebugBreak(MacroAssembler* masm) { - masm->int3(); // UNIMPLEMENTED + // Register state just before return from JS function (from codegen-x64.cc). + // rax is the actual number of arguments not encoded as a smi, see comment + // above IC call. + // ----------- S t a t e ------------- + // -- rax: number of arguments + // ----------------------------------- + // The number of arguments in rax is not smi encoded. + Generate_DebugBreakCallHelper(masm, 0, false); } + void Debug::GenerateKeyedLoadICDebugBreak(MacroAssembler* masm) { - masm->int3(); // UNIMPLEMENTED + // Register state for keyed IC load call (from ic-x64.cc). + // ----------- S t a t e ------------- + // No registers used on entry. + // ----------------------------------- + Generate_DebugBreakCallHelper(masm, 0, false); } + void Debug::GenerateKeyedStoreICDebugBreak(MacroAssembler* masm) { - masm->int3(); // UNIMPLEMENTED + // Register state for keyed IC load call (from ic-x64.cc). + // ----------- S t a t e ------------- + // -- rax : value + // ----------------------------------- + // Register rax contains an object that needs to be pushed on the + // expression stack of the fake JS frame. + Generate_DebugBreakCallHelper(masm, rax.bit(), false); } + void Debug::GenerateLoadICDebugBreak(MacroAssembler* masm) { - masm->int3(); // UNIMPLEMENTED + // Register state for IC load call (from ic-x64.cc). + // ----------- S t a t e ------------- + // -- rcx : name + // ----------------------------------- + Generate_DebugBreakCallHelper(masm, rcx.bit(), false); } + void Debug::GenerateReturnDebugBreak(MacroAssembler* masm) { - masm->int3(); // UNIMPLEMENTED + // Register state just before return from JS function (from codegen-x64.cc). + // ----------- S t a t e ------------- + // -- rax: return value + // ----------------------------------- + Generate_DebugBreakCallHelper(masm, rax.bit(), true); } + void Debug::GenerateReturnDebugBreakEntry(MacroAssembler* masm) { - masm->int3(); // UNIMPLEMENTED + // OK to clobber rbx as we are returning from a JS function through the code + // generated by CodeGenerator::GenerateReturnSequence() + ExternalReference debug_break_return = + ExternalReference(Debug_Address::DebugBreakReturn()); + __ movq(rbx, debug_break_return); + __ movq(rbx, Operand(rbx, 0)); + __ addq(rbx, Immediate(Code::kHeaderSize - kHeapObjectTag)); + __ jmp(rbx); } + void Debug::GenerateStoreICDebugBreak(MacroAssembler* masm) { - masm->int3(); // UNIMPLEMENTED + // REgister state for IC store call (from ic-x64.cc). + // ----------- S t a t e ------------- + // -- rax : value + // -- rcx : name + // ----------------------------------- + Generate_DebugBreakCallHelper(masm, rax.bit() | rcx.bit(), false); } + void Debug::GenerateStubNoRegistersDebugBreak(MacroAssembler* masm) { - masm->int3(); // UNIMPLEMENTED + // Register state for stub CallFunction (from CallFunctionStub in ic-x64.cc). + // ----------- S t a t e ------------- + // No registers used on entry. + // ----------------------------------- + Generate_DebugBreakCallHelper(masm, 0, false); } + +#undef __ + + void BreakLocationIterator::ClearDebugBreakAtReturn() { - // TODO(X64): Implement this when we start setting Debug breaks. - UNIMPLEMENTED(); + rinfo()->PatchCode(original_rinfo()->pc(), + Debug::kX64JSReturnSequenceLength); } + bool BreakLocationIterator::IsDebugBreakAtReturn() { - // TODO(X64): Implement this when we start setting Debug breaks. - UNIMPLEMENTED(); - return false; + return Debug::IsDebugBreakAtReturn(rinfo()); } + void BreakLocationIterator::SetDebugBreakAtReturn() { - UNIMPLEMENTED(); + ASSERT(Debug::kX64JSReturnSequenceLength >= Debug::kX64CallInstructionLength); + rinfo()->PatchCodeWithCall(Debug::debug_break_return_entry()->entry(), + Debug::kX64JSReturnSequenceLength - Debug::kX64CallInstructionLength); } #endif // ENABLE_DEBUGGER_SUPPORT diff --git a/V8Binding/v8/src/x64/ic-x64.cc b/V8Binding/v8/src/x64/ic-x64.cc index 86008eb..1c74a44 100644 --- a/V8Binding/v8/src/x64/ic-x64.cc +++ b/V8Binding/v8/src/x64/ic-x64.cc @@ -167,7 +167,7 @@ static bool PatchInlinedMapCheck(Address address, Object* map) { // Arguments are address of start of call sequence that called // the IC, Address test_instruction_address = - address + Assembler::kTargetAddrToReturnAddrDist; + address + Assembler::kPatchReturnSequenceLength; // The keyed load has a fast inlined case if the IC call instruction // is immediately followed by a test instruction. if (*test_instruction_address != kTestEaxByte) return false; @@ -845,7 +845,7 @@ void LoadIC::GenerateStringLength(MacroAssembler* masm) { bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { // The address of the instruction following the call. Address test_instruction_address = - address + Assembler::kTargetAddrToReturnAddrDist; + address + Assembler::kPatchReturnSequenceLength; // If the instruction following the call is not a test eax, nothing // was inlined. if (*test_instruction_address != kTestEaxByte) return false; diff --git a/V8Binding/v8/src/x64/macro-assembler-x64.cc b/V8Binding/v8/src/x64/macro-assembler-x64.cc index 2219a5a..8f8398d 100644 --- a/V8Binding/v8/src/x64/macro-assembler-x64.cc +++ b/V8Binding/v8/src/x64/macro-assembler-x64.cc @@ -262,8 +262,7 @@ void MacroAssembler::Abort(const char* msg) { void MacroAssembler::CallStub(CodeStub* stub) { ASSERT(allow_stub_calls()); // calls are not allowed in some stubs - movq(kScratchRegister, stub->GetCode(), RelocInfo::CODE_TARGET); - call(kScratchRegister); + Call(stub->GetCode(), RelocInfo::CODE_TARGET); } @@ -495,7 +494,6 @@ void MacroAssembler::Jump(Address destination, RelocInfo::Mode rmode) { void MacroAssembler::Jump(Handle<Code> code_object, RelocInfo::Mode rmode) { - WriteRecordedPositions(); ASSERT(RelocInfo::IsCodeTarget(rmode)); movq(kScratchRegister, code_object, rmode); #ifdef DEBUG @@ -504,7 +502,7 @@ void MacroAssembler::Jump(Handle<Code> code_object, RelocInfo::Mode rmode) { #endif jmp(kScratchRegister); #ifdef DEBUG - ASSERT_EQ(kTargetAddrToReturnAddrDist, + ASSERT_EQ(kPatchReturnSequenceLength, SizeOfCodeGeneratedSince(&target) + kPointerSize); #endif } @@ -523,8 +521,8 @@ void MacroAssembler::Call(Address destination, RelocInfo::Mode rmode) { void MacroAssembler::Call(Handle<Code> code_object, RelocInfo::Mode rmode) { - WriteRecordedPositions(); ASSERT(RelocInfo::IsCodeTarget(rmode)); + WriteRecordedPositions(); movq(kScratchRegister, code_object, rmode); #ifdef DEBUG // Patch target is kPointer size bytes *before* target label. @@ -533,7 +531,7 @@ void MacroAssembler::Call(Handle<Code> code_object, RelocInfo::Mode rmode) { #endif call(kScratchRegister); #ifdef DEBUG - ASSERT_EQ(kTargetAddrToReturnAddrDist, + ASSERT_EQ(kPatchReturnSequenceLength, SizeOfCodeGeneratedSince(&target) + kPointerSize); #endif } @@ -799,7 +797,7 @@ void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag) { Bootstrapper::FixupFlagsIsPCRelative::encode(false) | Bootstrapper::FixupFlagsUseCodeObject::encode(false); Unresolved entry = - { pc_offset() - kTargetAddrToReturnAddrDist, flags, name }; + { pc_offset() - kPatchReturnSequenceLength, flags, name }; unresolved_.Add(entry); } } @@ -859,12 +857,11 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected, movq(rdx, code_register); } - movq(kScratchRegister, adaptor, RelocInfo::CODE_TARGET); if (flag == CALL_FUNCTION) { - call(kScratchRegister); + Call(adaptor, RelocInfo::CODE_TARGET); jmp(done); } else { - jmp(kScratchRegister); + Jump(adaptor, RelocInfo::CODE_TARGET); } bind(&invoke); } diff --git a/V8Binding/v8/test/cctest/SConscript b/V8Binding/v8/test/cctest/SConscript index 112ecd6..fc4e01a 100644 --- a/V8Binding/v8/test/cctest/SConscript +++ b/V8Binding/v8/test/cctest/SConscript @@ -56,6 +56,7 @@ SOURCES = { 'test-spaces.cc', 'test-strings.cc', 'test-threads.cc', + 'test-thread-termination.cc', 'test-utils.cc', 'test-version.cc' ], diff --git a/V8Binding/v8/test/cctest/cctest.status b/V8Binding/v8/test/cctest/cctest.status index 6c0a9df..68aabb5 100644 --- a/V8Binding/v8/test/cctest/cctest.status +++ b/V8Binding/v8/test/cctest/cctest.status @@ -60,62 +60,3 @@ test-log/ProfLazyMode: SKIP # the JavaScript stacks are separate. test-api/ExceptionOrder: FAIL test-api/TryCatchInTryFinally: FAIL - - -[ $arch == x64 ] -test-decls/Present: CRASH || FAIL -test-decls/Unknown: CRASH || FAIL -test-decls/Appearing: CRASH || FAIL -test-decls/Absent: CRASH || FAIL -test-debug/DebugStub: CRASH || FAIL -test-decls/AbsentInPrototype: CRASH || FAIL -test-decls/Reappearing: CRASH || FAIL -test-debug/DebugInfo: CRASH || FAIL -test-decls/ExistsInPrototype: CRASH || FAIL -test-debug/BreakPointICStore: CRASH || FAIL -test-debug/BreakPointICLoad: CRASH || FAIL -test-debug/BreakPointICCall: CRASH || FAIL -test-debug/BreakPointReturn: CRASH || FAIL -test-debug/GCDuringBreakPointProcessing: CRASH || FAIL -test-debug/BreakPointSurviveGC: CRASH || FAIL -test-debug/BreakPointThroughJavaScript: CRASH || FAIL -test-debug/ScriptBreakPointByNameThroughJavaScript: CRASH || FAIL -test-debug/ScriptBreakPointByIdThroughJavaScript: CRASH || FAIL -test-debug/EnableDisableScriptBreakPoint: CRASH || FAIL -test-debug/ConditionalScriptBreakPoint: CRASH || FAIL -test-debug/ScriptBreakPointIgnoreCount: CRASH || FAIL -test-debug/ScriptBreakPointReload: CRASH || FAIL -test-debug/ScriptBreakPointMultiple: CRASH || FAIL -test-debug/RemoveBreakPointInBreak: CRASH || FAIL -test-debug/DebugEvaluate: CRASH || FAIL -test-debug/ScriptBreakPointLine: CRASH || FAIL -test-debug/ScriptBreakPointLineOffset: CRASH || FAIL -test-debug/DebugStepLinear: CRASH || FAIL -test-debug/DebugStepKeyedLoadLoop: CRASH || FAIL -test-debug/DebugStepKeyedStoreLoop: CRASH || FAIL -test-debug/DebugStepLinearMixedICs: CRASH || FAIL -test-debug/DebugStepFor: CRASH || FAIL -test-debug/DebugStepIf: CRASH || FAIL -test-debug/DebugStepSwitch: CRASH || FAIL -test-debug/StepInOutSimple: CRASH || FAIL -test-debug/StepInOutBranch: CRASH || FAIL -test-debug/StepInOutTree: CRASH || FAIL -test-debug/DebugStepNatives: CRASH || FAIL -test-debug/DebugStepFunctionApply: CRASH || FAIL -test-debug/DebugStepFunctionCall: CRASH || FAIL -test-debug/StepWithException: CRASH || FAIL -test-debug/DebugBreak: CRASH || FAIL -test-debug/DisableBreak: CRASH || FAIL -test-debug/MessageQueues: CRASH || FAIL -test-debug/CallFunctionInDebugger: SKIP -test-debug/RecursiveBreakpoints: CRASH || FAIL -test-debug/DebuggerUnload: CRASH || FAIL -test-debug/DebuggerHostDispatch: CRASH || FAIL -test-debug/DebugBreakInMessageHandler: CRASH || FAIL -test-debug/NoDebugBreakInAfterCompileMessageHandler: CRASH || FAIL -test-debug/RegExpDebugBreak: FAIL -test-api/Threading: CRASH || FAIL -test-api/Threading2: PASS || TIMEOUT -test-api/TryCatchSourceInfo: CRASH || FAIL -test-api/RegExpInterruption: PASS || TIMEOUT -test-api/RegExpStringModification: PASS || TIMEOUT diff --git a/V8Binding/v8/test/cctest/test-api.cc b/V8Binding/v8/test/cctest/test-api.cc index e1caba3..48ee6e5 100644 --- a/V8Binding/v8/test/cctest/test-api.cc +++ b/V8Binding/v8/test/cctest/test-api.cc @@ -6217,6 +6217,35 @@ TEST(DontLeakGlobalObjects) { } +v8::Persistent<v8::Object> some_object; +v8::Persistent<v8::Object> bad_handle; + +void NewPersistentHandleCallback(v8::Persistent<v8::Value>, void*) { + v8::HandleScope scope; + bad_handle = v8::Persistent<v8::Object>::New(some_object); +} + + +THREADED_TEST(NewPersistentHandleFromWeakCallback) { + LocalContext context; + + v8::Persistent<v8::Object> handle1, handle2; + { + v8::HandleScope scope; + some_object = v8::Persistent<v8::Object>::New(v8::Object::New()); + handle1 = v8::Persistent<v8::Object>::New(v8::Object::New()); + handle2 = v8::Persistent<v8::Object>::New(v8::Object::New()); + } + // Note: order is implementation dependent alas: currently + // global handle nodes are processed by PostGarbageCollectionProcessing + // in reverse allocation order, so if second allocated handle is deleted, + // weak callback of the first handle would be able to 'reallocate' it. + handle1.MakeWeak(NULL, NewPersistentHandleCallback); + handle2.Dispose(); + i::Heap::CollectAllGarbage(); +} + + THREADED_TEST(CheckForCrossContextObjectLiterals) { v8::V8::Initialize(); diff --git a/V8Binding/v8/test/cctest/test-debug.cc b/V8Binding/v8/test/cctest/test-debug.cc index a86317a..f5e4f3a 100644 --- a/V8Binding/v8/test/cctest/test-debug.cc +++ b/V8Binding/v8/test/cctest/test-debug.cc @@ -487,9 +487,7 @@ void CheckDebugBreakFunction(DebugLocalContext* env, CHECK_EQ(debug_break, Code::GetCodeFromTargetAddress(it1.it()->rinfo()->target_address())); } else { - // TODO(1240753): Make the test architecture independent or split - // parts of the debugger into architecture dependent files. - CHECK_EQ(0xE8, *(it1.rinfo()->pc())); + CHECK(Debug::IsDebugBreakAtReturn(it1.it()->rinfo())); } // Clear the break point and check that the debug break function is no longer @@ -501,9 +499,7 @@ void CheckDebugBreakFunction(DebugLocalContext* env, it2.FindBreakLocationFromPosition(position); CHECK_EQ(mode, it2.it()->rinfo()->rmode()); if (mode == v8::internal::RelocInfo::JS_RETURN) { - // TODO(1240753): Make the test architecture independent or split - // parts of the debugger into architecture dependent files. - CHECK_NE(0xE8, *(it2.rinfo()->pc())); + CHECK(!Debug::IsDebugBreakAtReturn(it2.it()->rinfo())); } } diff --git a/V8Binding/v8/test/cctest/test-decls.cc b/V8Binding/v8/test/cctest/test-decls.cc index 6c48f64..f083027 100644 --- a/V8Binding/v8/test/cctest/test-decls.cc +++ b/V8Binding/v8/test/cctest/test-decls.cc @@ -111,7 +111,7 @@ void DeclarationContext::InitializeIfNeeded() { if (is_initialized_) return; HandleScope scope; Local<FunctionTemplate> function = FunctionTemplate::New(); - Local<Value> data = Integer::New(reinterpret_cast<intptr_t>(this)); + Local<Value> data = External::New(this); GetHolder(function)->SetNamedPropertyHandler(&HandleGet, &HandleSet, &HandleHas, @@ -179,8 +179,7 @@ v8::Handle<Boolean> DeclarationContext::HandleHas(Local<String> key, DeclarationContext* DeclarationContext::GetInstance(const AccessorInfo& info) { - Local<Value> data = info.Data(); - return reinterpret_cast<DeclarationContext*>(Int32::Cast(*data)->Value()); + return static_cast<DeclarationContext*>(External::Unwrap(info.Data())); } diff --git a/V8Binding/v8/test/cctest/test-heap.cc b/V8Binding/v8/test/cctest/test-heap.cc index 6b5907c..37dbdd7 100644 --- a/V8Binding/v8/test/cctest/test-heap.cc +++ b/V8Binding/v8/test/cctest/test-heap.cc @@ -44,35 +44,26 @@ TEST(HeapMaps) { static void CheckOddball(Object* obj, const char* string) { CHECK(obj->IsOddball()); -#ifndef V8_HOST_ARCH_64_BIT -// TODO(X64): Reenable when native builtins work. bool exc; Object* print_string = *Execution::ToString(Handle<Object>(obj), &exc); CHECK(String::cast(print_string)->IsEqualTo(CStrVector(string))); -#endif // V8_HOST_ARCH_64_BIT } static void CheckSmi(int value, const char* string) { -#ifndef V8_HOST_ARCH_64_BIT -// TODO(X64): Reenable when native builtins work. bool exc; Object* print_string = *Execution::ToString(Handle<Object>(Smi::FromInt(value)), &exc); CHECK(String::cast(print_string)->IsEqualTo(CStrVector(string))); -#endif // V8_HOST_ARCH_64_BIT } static void CheckNumber(double value, const char* string) { Object* obj = Heap::NumberFromDouble(value); CHECK(obj->IsNumber()); -#ifndef V8_HOST_ARCH_64_BIT -// TODO(X64): Reenable when native builtins work. bool exc; Object* print_string = *Execution::ToString(Handle<Object>(obj), &exc); CHECK(String::cast(print_string)->IsEqualTo(CStrVector(string))); -#endif // V8_HOST_ARCH_64_BIT } @@ -492,8 +483,11 @@ static const char* not_so_random_string_table[] = { static void CheckSymbols(const char** strings) { for (const char* string = *strings; *strings != 0; string = *strings++) { Object* a = Heap::LookupAsciiSymbol(string); + // LookupAsciiSymbol may return a failure if a GC is needed. + if (a->IsFailure()) continue; CHECK(a->IsSymbol()); Object* b = Heap::LookupAsciiSymbol(string); + if (b->IsFailure()) continue; CHECK_EQ(b, a); CHECK(String::cast(b)->IsEqualTo(CStrVector(string))); } diff --git a/V8Binding/v8/test/cctest/test-thread-termination.cc b/V8Binding/v8/test/cctest/test-thread-termination.cc new file mode 100644 index 0000000..323be1d --- /dev/null +++ b/V8Binding/v8/test/cctest/test-thread-termination.cc @@ -0,0 +1,195 @@ +// Copyright 2009 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. + +#include "v8.h" +#include "platform.h" +#include "cctest.h" + + +v8::internal::Semaphore* semaphore = NULL; + + +v8::Handle<v8::Value> Signal(const v8::Arguments& args) { + semaphore->Signal(); + return v8::Undefined(); +} + + +v8::Handle<v8::Value> TerminateCurrentThread(const v8::Arguments& args) { + v8::V8::TerminateExecution(); + return v8::Undefined(); +} + + +v8::Handle<v8::Value> Fail(const v8::Arguments& args) { + CHECK(false); + return v8::Undefined(); +} + + +v8::Handle<v8::Value> Loop(const v8::Arguments& args) { + v8::Handle<v8::String> source = + v8::String::New("try { doloop(); fail(); } catch(e) { fail(); }"); + v8::Script::Compile(source)->Run(); + return v8::Undefined(); +} + + +v8::Handle<v8::Value> DoLoop(const v8::Arguments& args) { + v8::TryCatch try_catch; + v8::Script::Compile(v8::String::New("function f() {" + " var term = true;" + " try {" + " while(true) {" + " if (term) terminate();" + " term = false;" + " }" + " fail();" + " } catch(e) {" + " fail();" + " }" + "}" + "f()"))->Run(); + CHECK(try_catch.HasCaught()); + CHECK(try_catch.Exception()->IsNull()); + CHECK(try_catch.Message().IsEmpty()); + CHECK(!try_catch.CanContinue()); + return v8::Undefined(); +} + + +v8::Handle<v8::ObjectTemplate> CreateGlobalTemplate( + v8::InvocationCallback terminate) { + v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); + global->Set(v8::String::New("terminate"), + v8::FunctionTemplate::New(terminate)); + global->Set(v8::String::New("fail"), v8::FunctionTemplate::New(Fail)); + global->Set(v8::String::New("loop"), v8::FunctionTemplate::New(Loop)); + global->Set(v8::String::New("doloop"), v8::FunctionTemplate::New(DoLoop)); + return global; +} + + +// Test that a single thread of JavaScript execution can terminate +// itself. +TEST(TerminateOnlyV8ThreadFromThreadItself) { + v8::HandleScope scope; + v8::Handle<v8::ObjectTemplate> global = + CreateGlobalTemplate(TerminateCurrentThread); + v8::Persistent<v8::Context> context = v8::Context::New(NULL, global); + v8::Context::Scope context_scope(context); + // Run a loop that will be infinite if thread termination does not work. + v8::Handle<v8::String> source = + v8::String::New("try { loop(); fail(); } catch(e) { fail(); }"); + v8::Script::Compile(source)->Run(); + // Test that we can run the code again after thread termination. + v8::Script::Compile(source)->Run(); + context.Dispose(); +} + + +class TerminatorThread : public v8::internal::Thread { + void Run() { + semaphore->Wait(); + v8::V8::TerminateExecution(); + } +}; + + +// Test that a single thread of JavaScript execution can be terminated +// from the side by another thread. +TEST(TerminateOnlyV8ThreadFromOtherThread) { + semaphore = v8::internal::OS::CreateSemaphore(0); + TerminatorThread thread; + thread.Start(); + + v8::HandleScope scope; + v8::Handle<v8::ObjectTemplate> global = CreateGlobalTemplate(Signal); + v8::Persistent<v8::Context> context = v8::Context::New(NULL, global); + v8::Context::Scope context_scope(context); + // Run a loop that will be infinite if thread termination does not work. + v8::Handle<v8::String> source = + v8::String::New("try { loop(); fail(); } catch(e) { fail(); }"); + v8::Script::Compile(source)->Run(); + + thread.Join(); + delete semaphore; + semaphore = NULL; + context.Dispose(); +} + + +class LoopingThread : public v8::internal::Thread { + public: + void Run() { + v8::Locker locker; + v8::HandleScope scope; + v8_thread_id_ = v8::V8::GetCurrentThreadId(); + v8::Handle<v8::ObjectTemplate> global = CreateGlobalTemplate(Signal); + v8::Persistent<v8::Context> context = v8::Context::New(NULL, global); + v8::Context::Scope context_scope(context); + // Run a loop that will be infinite if thread termination does not work. + v8::Handle<v8::String> source = + v8::String::New("try { loop(); fail(); } catch(e) { fail(); }"); + v8::Script::Compile(source)->Run(); + context.Dispose(); + } + + int GetV8ThreadId() { return v8_thread_id_; } + + private: + int v8_thread_id_; +}; + + +// Test that multiple threads using V8 can be terminated from another +// thread when using Lockers and preemption. +TEST(TerminateMultipleV8Threads) { + { + v8::Locker locker; + v8::V8::Initialize(); + v8::Locker::StartPreemption(1); + semaphore = v8::internal::OS::CreateSemaphore(0); + } + LoopingThread thread1; + thread1.Start(); + LoopingThread thread2; + thread2.Start(); + // Wait until both threads have signaled the semaphore. + semaphore->Wait(); + semaphore->Wait(); + { + v8::Locker locker; + v8::V8::TerminateExecution(thread1.GetV8ThreadId()); + v8::V8::TerminateExecution(thread2.GetV8ThreadId()); + } + thread1.Join(); + thread2.Join(); + + delete semaphore; + semaphore = NULL; +} diff --git a/V8Binding/v8/test/cctest/test-threads.cc b/V8Binding/v8/test/cctest/test-threads.cc index c0d55f2..f70c4e8 100644 --- a/V8Binding/v8/test/cctest/test-threads.cc +++ b/V8Binding/v8/test/cctest/test-threads.cc @@ -50,5 +50,3 @@ TEST(Preemption) { script->Run(); } - - diff --git a/V8Binding/v8/test/message/message.status b/V8Binding/v8/test/message/message.status index 9afaa0f..fc2896b 100644 --- a/V8Binding/v8/test/message/message.status +++ b/V8Binding/v8/test/message/message.status @@ -29,16 +29,3 @@ prefix message # All tests in the bug directory are expected to fail. bugs: FAIL - -[ $arch == x64 ] - -simple-throw: FAIL -try-catch-finally-throw-in-catch-and-finally: FAIL -try-catch-finally-throw-in-catch: FAIL -try-catch-finally-throw-in-finally: FAIL -try-finally-throw-in-finally: FAIL -try-finally-throw-in-try-and-finally: FAIL -try-finally-throw-in-try: FAIL -overwritten-builtins: FAIL -regress/regress-73: FAIL -regress/regress-75: FAIL diff --git a/V8Binding/v8/test/mjsunit/div-mod.js b/V8Binding/v8/test/mjsunit/div-mod.js index 39fab27..a8a19b3 100644 --- a/V8Binding/v8/test/mjsunit/div-mod.js +++ b/V8Binding/v8/test/mjsunit/div-mod.js @@ -48,7 +48,7 @@ function run_tests_for(divisor) { divmod(div_func, mod_func, 0, divisor); divmod(div_func, mod_func, 1 / 0, divisor); // Floating point number test. - for (exp = -1024; exp <= 1024; exp += 4) { + for (exp = -1024; exp <= 1024; exp += 8) { divmod(div_func, mod_func, Math.pow(2, exp), divisor); divmod(div_func, mod_func, 0.9999999 * Math.pow(2, exp), divisor); divmod(div_func, mod_func, 1.0000001 * Math.pow(2, exp), divisor); @@ -76,13 +76,7 @@ var divisors = [ 8, 9, 10, - // These ones in the middle don't add much apart from slowness to the test. 0x1000000, - 0x2000000, - 0x4000000, - 0x8000000, - 0x10000000, - 0x20000000, 0x40000000, 12, 60, @@ -92,4 +86,3 @@ var divisors = [ for (var i = 0; i < divisors.length; i++) { run_tests_for(divisors[i]); } - diff --git a/V8Binding/v8/test/mjsunit/mjsunit.status b/V8Binding/v8/test/mjsunit/mjsunit.status index 6853cdc..4bf67e8 100644 --- a/V8Binding/v8/test/mjsunit/mjsunit.status +++ b/V8Binding/v8/test/mjsunit/mjsunit.status @@ -73,33 +73,3 @@ string-compare-alignment: PASS || FAIL # Times out often in release mode on ARM. array-splice: PASS || TIMEOUT - -[ $arch == x64 ] - -debug-backtrace: CRASH || FAIL -debug-backtrace-text: CRASH || FAIL -debug-multiple-breakpoints: CRASH || FAIL -debug-breakpoints: CRASH || FAIL -debug-changebreakpoint: CRASH || FAIL -debug-clearbreakpoint: CRASH || FAIL -debug-conditional-breakpoints: CRASH || FAIL -debug-constructor: CRASH || FAIL -debug-continue: CRASH || FAIL -debug-enable-disable-breakpoints: CRASH || FAIL -debug-evaluate-recursive: CRASH || FAIL -debug-event-listener: CRASH || FAIL -debug-evaluate: CRASH || FAIL -debug-ignore-breakpoints: CRASH || FAIL -debug-setbreakpoint: CRASH || FAIL -debug-step-stub-callfunction: CRASH || FAIL -debug-step: CRASH || FAIL -debug-stepin-builtin: CRASH || FAIL -debug-stepin-constructor: CRASH || FAIL -debug-stepin-function-call: CRASH || FAIL -debug-stepin-accessor: CRASH || FAIL -fuzz-natives: PASS || TIMEOUT -debug-handle: CRASH || FAIL -debug-clearbreakpointgroup: CRASH || FAIL -regress/regress-269: CRASH || FAIL -regress/regress-998565: CRASH || FAIL -tools/tickprocessor: PASS || CRASH || FAIL diff --git a/V8Binding/v8/test/mjsunit/simple-constructor.js b/V8Binding/v8/test/mjsunit/simple-constructor.js new file mode 100755 index 0000000..b26d651 --- /dev/null +++ b/V8Binding/v8/test/mjsunit/simple-constructor.js @@ -0,0 +1,78 @@ +// Copyright 2008 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. + +function props(x) { + var array = []; + for (var p in x) array.push(p); + return array.sort(); +} + +function f1() { + this.x = 1; +} + +function f2(x) { + this.x = x; +} + +function f3(x) { + this.x = x; + this.y = 1; + this.z = f1; +} + +function f4(x) { + this.x = x; + this.y = 1; + if (x == 1) return; + this.z = f1; +} + +o1_1 = new f1(); +o1_2 = new f1(); +assertArrayEquals(["x"], props(o1_1)); +assertArrayEquals(["x"], props(o1_2)); + +o2_1 = new f2(0); +o2_2 = new f2(0); +assertArrayEquals(["x"], props(o2_1)); +assertArrayEquals(["x"], props(o2_2)); + +o3_1 = new f3(0); +o3_2 = new f3(0); +assertArrayEquals(["x", "y", "z"], props(o3_1)); +assertArrayEquals(["x", "y", "z"], props(o3_2)); + +o4_0_1 = new f4(0); +o4_0_2 = new f4(0); +assertArrayEquals(["x", "y", "z"], props(o4_0_1)); +assertArrayEquals(["x", "y", "z"], props(o4_0_2)); + +o4_1_1 = new f4(1); +o4_1_2 = new f4(1); +assertArrayEquals(["x", "y"], props(o4_1_1)); +assertArrayEquals(["x", "y"], props(o4_1_2)); diff --git a/V8Binding/v8/tools/visual_studio/common.vsprops b/V8Binding/v8/tools/visual_studio/common.vsprops index f131a4a..d23e4fc 100644 --- a/V8Binding/v8/tools/visual_studio/common.vsprops +++ b/V8Binding/v8/tools/visual_studio/common.vsprops @@ -10,7 +10,7 @@ <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="$(ProjectDir)\..\..\src;$(IntDir)\DerivedSources" - PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;_HAS_EXCEPTIONS=0;ENABLE_LOGGING_AND_PROFILING" + PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_HAS_EXCEPTIONS=0;ENABLE_LOGGING_AND_PROFILING" MinimalRebuild="false" ExceptionHandling="0" RuntimeTypeInfo="false" diff --git a/V8Binding/v8/tools/visual_studio/d8_x64.vcproj b/V8Binding/v8/tools/visual_studio/d8_x64.vcproj new file mode 100644 index 0000000..dd2b83d --- /dev/null +++ b/V8Binding/v8/tools/visual_studio/d8_x64.vcproj @@ -0,0 +1,199 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="d8" + ProjectGUID="{7E4C7D2D-A4B9-40B9-8192-22654E626F6C}" + RootNamespace="d8" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="x64" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|x64" + ConfigurationType="1" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\debug.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="winmm.lib Ws2_32.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|x64" + ConfigurationType="1" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\release.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="winmm.lib Ws2_32.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <File + RelativePath="..\..\src\d8.cc" + > + </File> + <File + RelativePath="..\..\src\d8.h" + > + </File> + <File + RelativePath="..\..\src\d8-debug.cc" + > + </File> + <File + RelativePath="..\..\src\d8-debug.h" + > + </File> + <File + RelativePath="..\..\src\d8-windows.cc" + > + </File> + <File + RelativePath="..\..\src\d8.js" + > + <FileConfiguration + Name="Debug|x64" + > + <Tool + Name="VCCustomBuildTool" + Description="Processing js files..." + CommandLine=".\d8js2c.cmd ..\..\src "$(IntDir)\DerivedSources"" + Outputs="$(IntDir)\DerivedSources\natives.cc;$(IntDir)\DerivedSources\natives-empty.cc" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|x64" + > + <Tool + Name="VCCustomBuildTool" + Description="Processing js files..." + CommandLine=".\d8js2c.cmd ..\..\src "$(IntDir)\DerivedSources"" + Outputs="$(IntDir)\DerivedSources\natives.cc;$(IntDir)\DerivedSources\natives-empty.cc" + /> + </FileConfiguration> + </File> + <Filter + Name="generated files" + > + <File + RelativePath="$(IntDir)\DerivedSources\natives.cc" + > + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/V8Binding/v8/tools/visual_studio/ia32.vsprops b/V8Binding/v8/tools/visual_studio/ia32.vsprops index aff0871..f48e808 100644 --- a/V8Binding/v8/tools/visual_studio/ia32.vsprops +++ b/V8Binding/v8/tools/visual_studio/ia32.vsprops @@ -6,6 +6,6 @@ > <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="V8_TARGET_ARCH_IA32;V8_NATIVE_REGEXP" + PreprocessorDefinitions="_USE_32BIT_TIME_T;V8_TARGET_ARCH_IA32;V8_NATIVE_REGEXP" /> </VisualStudioPropertySheet> diff --git a/V8Binding/v8/tools/visual_studio/v8_base_x64.vcproj b/V8Binding/v8/tools/visual_studio/v8_base_x64.vcproj new file mode 100644 index 0000000..1e27824 --- /dev/null +++ b/V8Binding/v8/tools/visual_studio/v8_base_x64.vcproj @@ -0,0 +1,963 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="v8_base" + ProjectGUID="{EC8B7909-62AF-470D-A75D-E1D89C837142}" + RootNamespace="v8_base" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="x64" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|x64" + ConfigurationType="4" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\debug.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|x64" + ConfigurationType="4" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\release.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="dtoa" + > + <File + RelativePath="..\..\src\dtoa-config.c" + > + <FileConfiguration + Name="Debug|x64" + > + <Tool + Name="VCCLCompilerTool" + DisableSpecificWarnings="4018;4244" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|x64" + > + <Tool + Name="VCCLCompilerTool" + DisableSpecificWarnings="4018;4244" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="src" + > + <File + RelativePath="..\..\src\accessors.cc" + > + </File> + <File + RelativePath="..\..\src\accessors.h" + > + </File> + <File + RelativePath="..\..\src\allocation.cc" + > + </File> + <File + RelativePath="..\..\src\allocation.h" + > + </File> + <File + RelativePath="..\..\src\api.cc" + > + </File> + <File + RelativePath="..\..\src\api.h" + > + </File> + <File + RelativePath="..\..\src\arguments.h" + > + </File> + <File + RelativePath="..\..\src\x64\assembler-x64-inl.h" + > + </File> + <File + RelativePath="..\..\src\x64\assembler-x64.cc" + > + </File> + <File + RelativePath="..\..\src\x64\assembler-x64.h" + > + </File> + <File + RelativePath="..\..\src\regexp-macro-assembler-irregexp-inl.h" + > + </File> + <File + RelativePath="..\..\src\regexp-stack.h" + > + </File> + <File + RelativePath="..\..\src\assembler.cc" + > + </File> + <File + RelativePath="..\..\src\assembler.h" + > + </File> + <File + RelativePath="..\..\src\ast.cc" + > + </File> + <File + RelativePath="..\..\src\ast.h" + > + </File> + <File + RelativePath="..\..\src\bootstrapper.cc" + > + </File> + <File + RelativePath="..\..\src\bootstrapper.h" + > + </File> + <File + RelativePath="..\..\src\x64\builtins-x64.cc" + > + </File> + <File + RelativePath="..\..\src\builtins.cc" + > + </File> + <File + RelativePath="..\..\src\builtins.h" + > + </File> + <File + RelativePath="..\..\src\bytecodes-irregexp.h" + > + </File> + <File + RelativePath="..\..\src\x64\cfg-x64.cc" + > + </File> + <File + RelativePath="..\..\src\cfg.cc" + > + </File> + <File + RelativePath="..\..\src\cfg.h" + > + </File> + <File + RelativePath="..\..\src\char-predicates-inl.h" + > + </File> + <File + RelativePath="..\..\src\char-predicates.h" + > + </File> + <File + RelativePath="..\..\src\checks.cc" + > + </File> + <File + RelativePath="..\..\src\checks.h" + > + </File> + <File + RelativePath="..\..\src\code-stubs.cc" + > + </File> + <File + RelativePath="..\..\src\code-stubs.h" + > + </File> + <File + RelativePath="..\..\src\code.h" + > + </File> + <File + RelativePath="..\..\src\x64\codegen-x64.cc" + > + </File> + <File + RelativePath="..\..\src\x64\codegen-x64.h" + > + </File> + <File + RelativePath="..\..\src\codegen-inl.h" + > + </File> + <File + RelativePath="..\..\src\codegen.cc" + > + </File> + <File + RelativePath="..\..\src\codegen.h" + > + </File> + <File + RelativePath="..\..\src\compilation-cache.cc" + > + </File> + <File + RelativePath="..\..\src\compilation-cache.h" + > + </File> + <File + RelativePath="..\..\src\compiler.cc" + > + </File> + <File + RelativePath="..\..\src\compiler.h" + > + </File> + <File + RelativePath="..\..\src\contexts.cc" + > + </File> + <File + RelativePath="..\..\src\contexts.h" + > + </File> + <File + RelativePath="..\..\src\conversions-inl.h" + > + </File> + <File + RelativePath="..\..\src\conversions.cc" + > + </File> + <File + RelativePath="..\..\src\conversions.h" + > + </File> + <File + RelativePath="..\..\src\counters.cc" + > + </File> + <File + RelativePath="..\..\src\counters.h" + > + </File> + <File + RelativePath="..\..\src\x64\cpu-x64.cc" + > + </File> + <File + RelativePath="..\..\src\cpu.h" + > + </File> + <File + RelativePath="..\..\src\dateparser.cc" + > + </File> + <File + RelativePath="..\..\src\dateparser.h" + > + </File> + <File + RelativePath="..\..\src\debug-agent.cc" + > + </File> + <File + RelativePath="..\..\src\debug-agent.h" + > + </File> + <File + RelativePath="..\..\src\x64\debug-x64.cc" + > + </File> + <File + RelativePath="..\..\src\debug.cc" + > + </File> + <File + RelativePath="..\..\src\debug.h" + > + </File> + <File + RelativePath="..\..\src\disassembler.cc" + > + </File> + <File + RelativePath="..\..\src\disassembler.h" + > + </File> + <File + RelativePath="..\..\src\execution.cc" + > + </File> + <File + RelativePath="..\..\src\execution.h" + > + </File> + <File + RelativePath="..\..\src\factory.cc" + > + </File> + <File + RelativePath="..\..\src\factory.h" + > + </File> + <File + RelativePath="..\..\src\flags.cc" + > + </File> + <File + RelativePath="..\..\src\flags.h" + > + </File> + <File + RelativePath="..\..\src\frame-element.cc" + > + </File> + <File + RelativePath="..\..\src\frame-element.h" + > + </File> + <File + RelativePath="..\..\src\x64\frames-x64.cc" + > + </File> + <File + RelativePath="..\..\src\x64\frames-x64.h" + > + </File> + <File + RelativePath="..\..\src\frames-inl.h" + > + </File> + <File + RelativePath="..\..\src\frames.cc" + > + </File> + <File + RelativePath="..\..\src\frames.h" + > + </File> + <File + RelativePath="..\..\src\func-name-inferrer.cc" + > + </File> + <File + RelativePath="..\..\src\func-name-inferrer.h" + > + </File> + <File + RelativePath="..\..\src\global-handles.cc" + > + </File> + <File + RelativePath="..\..\src\global-handles.h" + > + </File> + <File + RelativePath="..\..\src\globals.h" + > + </File> + <File + RelativePath="..\..\src\handles-inl.h" + > + </File> + <File + RelativePath="..\..\src\handles.cc" + > + </File> + <File + RelativePath="..\..\src\handles.h" + > + </File> + <File + RelativePath="..\..\src\hashmap.cc" + > + </File> + <File + RelativePath="..\..\src\hashmap.h" + > + </File> + <File + RelativePath="..\..\src\heap-inl.h" + > + </File> + <File + RelativePath="..\..\src\heap.cc" + > + </File> + <File + RelativePath="..\..\src\heap.h" + > + </File> + <File + RelativePath="..\..\src\x64\ic-x64.cc" + > + </File> + <File + RelativePath="..\..\src\ic-inl.h" + > + </File> + <File + RelativePath="..\..\src\ic.cc" + > + </File> + <File + RelativePath="..\..\src\ic.h" + > + </File> + <File + RelativePath="..\..\src\interceptors.h" + > + </File> + <File + RelativePath="..\..\src\interpreter-irregexp.cc" + > + </File> + <File + RelativePath="..\..\src\interpreter-irregexp.h" + > + </File> + <File + RelativePath="..\..\src\jump-target.h" + > + </File> + <File + RelativePath="..\..\src\jump-target-inl.h" + > + </File> + <File + RelativePath="..\..\src\jump-target.cc" + > + </File> + <File + RelativePath="..\..\src\x64\jump-target-x64.cc" + > + </File> + <File + RelativePath="..\..\src\jsregexp.cc" + > + </File> + <File + RelativePath="..\..\src\jsregexp.h" + > + </File> + <File + RelativePath="..\..\src\list-inl.h" + > + </File> + <File + RelativePath="..\..\src\list.h" + > + </File> + <File + RelativePath="..\..\src\log.cc" + > + </File> + <File + RelativePath="..\..\src\log-inl.h" + > + </File> + <File + RelativePath="..\..\src\log.h" + > + </File> + <File + RelativePath="..\..\src\log-utils.cc" + > + </File> + <File + RelativePath="..\..\src\log-utils.h" + > + </File> + <File + RelativePath="..\..\src\x64\macro-assembler-x64.cc" + > + </File> + <File + RelativePath="..\..\src\x64\macro-assembler-x64.h" + > + </File> + <File + RelativePath="..\..\src\macro-assembler.h" + > + </File> + <File + RelativePath="..\..\src\mark-compact.cc" + > + </File> + <File + RelativePath="..\..\src\mark-compact.h" + > + </File> + <File + RelativePath="..\..\src\memory.h" + > + </File> + <File + RelativePath="..\..\src\messages.cc" + > + </File> + <File + RelativePath="..\..\src\messages.h" + > + </File> + <File + RelativePath="..\..\src\natives.h" + > + </File> + <File + RelativePath="..\..\src\objects-debug.cc" + > + <FileConfiguration + Name="Release|x64" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\..\src\objects-inl.h" + > + </File> + <File + RelativePath="..\..\src\objects.cc" + > + </File> + <File + RelativePath="..\..\src\objects.h" + > + </File> + <File + RelativePath="..\..\src\oprofile-agent.cc" + > + </File> + <File + RelativePath="..\..\src\oprofile-agent.h" + > + </File> + <File + RelativePath="..\..\src\parser.cc" + > + </File> + <File + RelativePath="..\..\src\parser.h" + > + </File> + <File + RelativePath="..\..\src\platform-win32.cc" + > + </File> + <File + RelativePath="..\..\src\platform.h" + > + </File> + <File + RelativePath="..\..\src\prettyprinter.cc" + > + <FileConfiguration + Name="Release|x64" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\..\src\prettyprinter.h" + > + </File> + <File + RelativePath="..\..\src\property.cc" + > + </File> + <File + RelativePath="..\..\src\property.h" + > + </File> + <File + RelativePath="..\..\src\x64\regexp-macro-assembler-x64.cc" + > + </File> + <File + RelativePath="..\..\src\x64\regexp-macro-assembler-x64.h" + > + </File> + <File + RelativePath="..\..\src\regexp-macro-assembler-irregexp.cc" + > + </File> + <File + RelativePath="..\..\src\regexp-macro-assembler-irregexp.h" + > + </File> + <File + RelativePath="..\..\src\regexp-macro-assembler.cc" + > + </File> + <File + RelativePath="..\..\src\regexp-macro-assembler.h" + > + </File> + <File + RelativePath="..\..\src\regexp-macro-assembler-tracer.cc" + > + </File> + <File + RelativePath="..\..\src\regexp-macro-assembler-tracer.h" + > + </File> + <File + RelativePath="..\..\src\regexp-stack.cc" + > + </File> + <File + RelativePath="..\..\src\register-allocator.h" + > + </File> + <File + RelativePath="..\..\src\register-allocator.cc" + > + </File> + <File + RelativePath="..\..\src\x64\register-allocator-x64.cc" + > + </File> + <File + RelativePath="..\..\src\rewriter.cc" + > + </File> + <File + RelativePath="..\..\src\rewriter.h" + > + </File> + <File + RelativePath="..\..\src\runtime.cc" + > + </File> + <File + RelativePath="..\..\src\runtime.h" + > + </File> + <File + RelativePath="..\..\src\scanner.cc" + > + </File> + <File + RelativePath="..\..\src\scanner.h" + > + </File> + <File + RelativePath="..\..\src\scopeinfo.cc" + > + </File> + <File + RelativePath="..\..\src\scopeinfo.h" + > + </File> + <File + RelativePath="..\..\src\scopes.cc" + > + </File> + <File + RelativePath="..\..\src\scopes.h" + > + </File> + <File + RelativePath="..\..\src\serialize.cc" + > + </File> + <File + RelativePath="..\..\src\serialize.h" + > + </File> + <File + RelativePath="..\..\src\shell.h" + > + </File> + <File + RelativePath="..\..\src\snapshot-common.cc" + > + </File> + <File + RelativePath="..\..\src\snapshot.h" + > + </File> + <File + RelativePath="..\..\src\spaces-inl.h" + > + </File> + <File + RelativePath="..\..\src\spaces.cc" + > + </File> + <File + RelativePath="..\..\src\spaces.h" + > + </File> + <File + RelativePath="..\..\src\string-stream.cc" + > + </File> + <File + RelativePath="..\..\src\string-stream.h" + > + </File> + <File + RelativePath="..\..\src\x64\stub-cache-x64.cc" + > + </File> + <File + RelativePath="..\..\src\stub-cache.cc" + > + </File> + <File + RelativePath="..\..\src\stub-cache.h" + > + </File> + <File + RelativePath="..\..\src\token.cc" + > + </File> + <File + RelativePath="..\..\src\token.h" + > + </File> + <File + RelativePath="..\..\src\top.cc" + > + </File> + <File + RelativePath="..\..\src\top.h" + > + </File> + <File + RelativePath="..\..\src\unicode-inl.h" + > + </File> + <File + RelativePath="..\..\src\unicode.h" + > + </File> + <File + RelativePath="..\..\src\usage-analyzer.cc" + > + </File> + <File + RelativePath="..\..\src\usage-analyzer.h" + > + </File> + <File + RelativePath="..\..\src\utils.cc" + > + </File> + <File + RelativePath="..\..\src\utils.h" + > + </File> + <File + RelativePath="..\..\src\v8-counters.cc" + > + </File> + <File + RelativePath="..\..\src\v8-counters.h" + > + </File> + <File + RelativePath="..\..\src\v8.cc" + > + </File> + <File + RelativePath="..\..\src\v8.h" + > + </File> + <File + RelativePath="..\..\src\v8threads.cc" + > + </File> + <File + RelativePath="..\..\src\v8threads.h" + > + </File> + <File + RelativePath="..\..\src\variables.cc" + > + </File> + <File + RelativePath="..\..\src\variables.h" + > + </File> + <File + RelativePath="..\..\src\version.cc" + > + </File> + <File + RelativePath="..\..\src\version.h" + > + </File> + <File + RelativePath="..\..\src\virtual-frame.h" + > + </File> + <File + RelativePath="..\..\src\x64\virtual-frame-x64.h" + > + </File> + <File + RelativePath="..\..\src\virtual-frame.cc" + > + </File> + <File + RelativePath="..\..\src\x64\virtual-frame-x64.cc" + > + </File> + <File + RelativePath="..\..\src\zone-inl.h" + > + </File> + <File + RelativePath="..\..\src\zone.cc" + > + </File> + <File + RelativePath="..\..\src\zone.h" + > + </File> + <Filter + Name="third party" + > + <File + RelativePath="..\..\src\x64\disasm-x64.cc" + > + </File> + <File + RelativePath="..\..\src\disasm.h" + > + </File> + </Filter> + <Filter + Name="generated files" + > + <File + RelativePath="..\..\src\unicode.cc" + > + </File> + </Filter> + </Filter> + <Filter + Name="include" + > + <File + RelativePath="..\..\include\debug.h" + > + </File> + <File + RelativePath="..\..\include\v8.h" + > + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/V8Binding/v8/tools/visual_studio/v8_cctest_x64.vcproj b/V8Binding/v8/tools/visual_studio/v8_cctest_x64.vcproj new file mode 100644 index 0000000..fc7ac4b --- /dev/null +++ b/V8Binding/v8/tools/visual_studio/v8_cctest_x64.vcproj @@ -0,0 +1,251 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="v8_cctest" + ProjectGUID="{97ECC711-7430-4FC4-90FD-004DA880E72A}" + RootNamespace="v8_cctest" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="x64" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|x64" + ConfigurationType="1" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\debug.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="winmm.lib Ws2_32.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|x64" + ConfigurationType="1" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\release.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="winmm.lib Ws2_32.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <File + RelativePath="..\..\test\cctest\cctest.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-alloc.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-api.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-assembler-x64.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-ast.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-compiler.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-conversions.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-debug.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-decls.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-disasm-x64.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-flags.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-func-name-inference.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-hashmap.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-heap.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-lock.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-log.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-log-utils.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-log-stack-tracer.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-mark-compact.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-platform-win32.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-serialize.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-sockets.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-spaces.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-strings.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-utils.cc" + > + </File> + <File + RelativePath="..\..\test\cctest\test-version.cc" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/V8Binding/v8/tools/visual_studio/v8_mksnapshot_x64.vcproj b/V8Binding/v8/tools/visual_studio/v8_mksnapshot_x64.vcproj new file mode 100644 index 0000000..1c460e4 --- /dev/null +++ b/V8Binding/v8/tools/visual_studio/v8_mksnapshot_x64.vcproj @@ -0,0 +1,151 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="v8_mksnapshot" + ProjectGUID="{865575D0-37E2-405E-8CBA-5F6C485B5A26}" + RootNamespace="v8_mksnapshot" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="x64" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|x64" + ConfigurationType="1" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\debug.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="winmm.lib Ws2_32.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|x64" + ConfigurationType="1" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\release.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="winmm.lib Ws2_32.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <File + RelativePath="..\..\src\mksnapshot.cc" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/V8Binding/v8/tools/visual_studio/v8_process_sample_x64.vcproj b/V8Binding/v8/tools/visual_studio/v8_process_sample_x64.vcproj new file mode 100644 index 0000000..81adbe0 --- /dev/null +++ b/V8Binding/v8/tools/visual_studio/v8_process_sample_x64.vcproj @@ -0,0 +1,151 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="v8_process_sample" + ProjectGUID="{EF019874-D38A-40E3-B17C-DB5923F0A79C}" + RootNamespace="v8_process_sample" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="x64" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|x64" + ConfigurationType="1" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\debug.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="winmm.lib Ws2_32.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|x64" + ConfigurationType="1" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\release.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="winmm.lib Ws2_32.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <File + RelativePath="..\..\samples\process.cc" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/V8Binding/v8/tools/visual_studio/v8_shell_sample_x64.vcproj b/V8Binding/v8/tools/visual_studio/v8_shell_sample_x64.vcproj new file mode 100644 index 0000000..ab276f4 --- /dev/null +++ b/V8Binding/v8/tools/visual_studio/v8_shell_sample_x64.vcproj @@ -0,0 +1,151 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="v8_shell_sample" + ProjectGUID="{2DE20FFA-6F5E-48D9-84D8-09B044A5B119}" + RootNamespace="v8_shell_sample" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="x64" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|x64" + ConfigurationType="1" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\debug.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="winmm.lib Ws2_32.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|x64" + ConfigurationType="1" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\release.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="winmm.lib Ws2_32.lib" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <File + RelativePath="..\..\samples\shell.cc" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/V8Binding/v8/tools/visual_studio/v8_snapshot_cc_x64.vcproj b/V8Binding/v8/tools/visual_studio/v8_snapshot_cc_x64.vcproj new file mode 100644 index 0000000..9c6f9d2 --- /dev/null +++ b/V8Binding/v8/tools/visual_studio/v8_snapshot_cc_x64.vcproj @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="v8_snapshot_cc" + ProjectGUID="{0DDBDA8B-A49F-4CC7-A1D5-5BB8297C8A3F}" + RootNamespace="v8_snapshot_cc" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="x64" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|x64" + ConfigurationType="10" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\debug.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|x64" + ConfigurationType="10" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\release.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="generated files" + SourceControlFiles="false" + > + <File + RelativePath="$(OutDir)\v8_mksnapshot.exe" + > + <FileConfiguration + Name="Debug|x64" + > + <Tool + Name="VCCustomBuildTool" + Description="Building snapshot..." + CommandLine=""$(OutDir)\v8_mksnapshot.exe" "$(IntDir)\DerivedSources\snapshot.cc"
" + AdditionalDependencies="$(OutDir)\v8_mksnapshot.exe" + Outputs="$(IntDir)\DerivedSources\snapshot.cc" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|x64" + > + <Tool + Name="VCCustomBuildTool" + Description="Building snapshot..." + CommandLine=""$(OutDir)\v8_mksnapshot.exe" "$(IntDir)\DerivedSources\snapshot.cc"
" + AdditionalDependencies="$(OutDir)\v8_mksnapshot.exe" + Outputs="$(IntDir)\DerivedSources\snapshot.cc" + /> + </FileConfiguration> + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/V8Binding/v8/tools/visual_studio/v8_snapshot_x64.vcproj b/V8Binding/v8/tools/visual_studio/v8_snapshot_x64.vcproj new file mode 100644 index 0000000..0f6c70f --- /dev/null +++ b/V8Binding/v8/tools/visual_studio/v8_snapshot_x64.vcproj @@ -0,0 +1,142 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="v8_snapshot" + ProjectGUID="{C0334F9A-1168-4101-9DD8-C30FB252D435}" + RootNamespace="v8_snapshot" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="x64" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|x64" + ConfigurationType="4" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\debug.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + LinkLibraryDependencies="true" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|x64" + ConfigurationType="4" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\release.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + LinkLibraryDependencies="true" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="generated files" + SourceControlFiles="false" + > + <File + RelativePath="$(IntDir)\..\v8\DerivedSources\natives-empty.cc" + > + </File> + <File + RelativePath="$(IntDir)\..\v8_snapshot_cc\DerivedSources\snapshot.cc" + > + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/V8Binding/v8/tools/visual_studio/v8_x64.sln b/V8Binding/v8/tools/visual_studio/v8_x64.sln new file mode 100644 index 0000000..1fa2f16 --- /dev/null +++ b/V8Binding/v8/tools/visual_studio/v8_x64.sln @@ -0,0 +1,101 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "v8_base", "v8_base_x64.vcproj", "{EC8B7909-62AF-470D-A75D-E1D89C837142}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "v8", "v8_x64.vcproj", "{21E22961-22BF-4493-BD3A-868F93DA5179}" + ProjectSection(ProjectDependencies) = postProject + {EC8B7909-62AF-470D-A75D-E1D89C837142} = {EC8B7909-62AF-470D-A75D-E1D89C837142} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "v8_mksnapshot", "v8_mksnapshot_x64.vcproj", "{865575D0-37E2-405E-8CBA-5F6C485B5A26}" + ProjectSection(ProjectDependencies) = postProject + {21E22961-22BF-4493-BD3A-868F93DA5179} = {21E22961-22BF-4493-BD3A-868F93DA5179} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "v8_snapshot", "v8_snapshot_x64.vcproj", "{C0334F9A-1168-4101-9DD8-C30FB252D435}" + ProjectSection(ProjectDependencies) = postProject + {0DDBDA8B-A49F-4CC7-A1D5-5BB8297C8A3F} = {0DDBDA8B-A49F-4CC7-A1D5-5BB8297C8A3F} + {EC8B7909-62AF-470D-A75D-E1D89C837142} = {EC8B7909-62AF-470D-A75D-E1D89C837142} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "v8_shell_sample", "v8_shell_sample_x64.vcproj", "{2DE20FFA-6F5E-48D9-84D8-09B044A5B119}" + ProjectSection(ProjectDependencies) = postProject + {C0334F9A-1168-4101-9DD8-C30FB252D435} = {C0334F9A-1168-4101-9DD8-C30FB252D435} + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{E131F77D-B713-48F3-B86D-097ECDCC4C3A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "v8_process_sample", "v8_process_sample_x64.vcproj", "{EF019874-D38A-40E3-B17C-DB5923F0A79C}" + ProjectSection(ProjectDependencies) = postProject + {C0334F9A-1168-4101-9DD8-C30FB252D435} = {C0334F9A-1168-4101-9DD8-C30FB252D435} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "v8_cctest", "v8_cctest_x64.vcproj", "{97ECC711-7430-4FC4-90FD-004DA880E72A}" + ProjectSection(ProjectDependencies) = postProject + {C0334F9A-1168-4101-9DD8-C30FB252D435} = {C0334F9A-1168-4101-9DD8-C30FB252D435} + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{AD933CE2-1303-448E-89C8-60B1FDD18EC3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "d8", "d8_x64.vcproj", "{7E4C7D2D-A4B9-40B9-8192-22654E626F6C}" + ProjectSection(ProjectDependencies) = postProject + {C0334F9A-1168-4101-9DD8-C30FB252D435} = {C0334F9A-1168-4101-9DD8-C30FB252D435} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "v8_snapshot_cc", "v8_snapshot_cc_x64.vcproj", "{0DDBDA8B-A49F-4CC7-A1D5-5BB8297C8A3F}" + ProjectSection(ProjectDependencies) = postProject + {865575D0-37E2-405E-8CBA-5F6C485B5A26} = {865575D0-37E2-405E-8CBA-5F6C485B5A26} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0DDBDA8B-A49F-4CC7-A1D5-5BB8297C8A3F}.Debug|x64.ActiveCfg = Debug|x64 + {0DDBDA8B-A49F-4CC7-A1D5-5BB8297C8A3F}.Debug|x64.Build.0 = Debug|x64 + {0DDBDA8B-A49F-4CC7-A1D5-5BB8297C8A3F}.Release|x64.ActiveCfg = Release|x64 + {0DDBDA8B-A49F-4CC7-A1D5-5BB8297C8A3F}.Release|x64.Build.0 = Release|x64 + {21E22961-22BF-4493-BD3A-868F93DA5179}.Debug|x64.ActiveCfg = Debug|x64 + {21E22961-22BF-4493-BD3A-868F93DA5179}.Debug|x64.Build.0 = Debug|x64 + {21E22961-22BF-4493-BD3A-868F93DA5179}.Release|x64.ActiveCfg = Release|x64 + {21E22961-22BF-4493-BD3A-868F93DA5179}.Release|x64.Build.0 = Release|x64 + {2DE20FFA-6F5E-48D9-84D8-09B044A5B119}.Debug|x64.ActiveCfg = Debug|x64 + {2DE20FFA-6F5E-48D9-84D8-09B044A5B119}.Debug|x64.Build.0 = Debug|x64 + {2DE20FFA-6F5E-48D9-84D8-09B044A5B119}.Release|x64.ActiveCfg = Release|x64 + {2DE20FFA-6F5E-48D9-84D8-09B044A5B119}.Release|x64.Build.0 = Release|x64 + {7E4C7D2D-A4B9-40B9-8192-22654E626F6C}.Debug|x64.ActiveCfg = Debug|x64 + {7E4C7D2D-A4B9-40B9-8192-22654E626F6C}.Debug|x64.Build.0 = Debug|x64 + {7E4C7D2D-A4B9-40B9-8192-22654E626F6C}.Release|x64.ActiveCfg = Release|x64 + {7E4C7D2D-A4B9-40B9-8192-22654E626F6C}.Release|x64.Build.0 = Release|x64 + {865575D0-37E2-405E-8CBA-5F6C485B5A26}.Debug|x64.ActiveCfg = Debug|x64 + {865575D0-37E2-405E-8CBA-5F6C485B5A26}.Debug|x64.Build.0 = Debug|x64 + {865575D0-37E2-405E-8CBA-5F6C485B5A26}.Release|x64.ActiveCfg = Release|x64 + {865575D0-37E2-405E-8CBA-5F6C485B5A26}.Release|x64.Build.0 = Release|x64 + {97ECC711-7430-4FC4-90FD-004DA880E72A}.Debug|x64.ActiveCfg = Debug|x64 + {97ECC711-7430-4FC4-90FD-004DA880E72A}.Debug|x64.Build.0 = Debug|x64 + {97ECC711-7430-4FC4-90FD-004DA880E72A}.Release|x64.ActiveCfg = Release|x64 + {97ECC711-7430-4FC4-90FD-004DA880E72A}.Release|x64.Build.0 = Release|x64 + {C0334F9A-1168-4101-9DD8-C30FB252D435}.Debug|x64.ActiveCfg = Debug|x64 + {C0334F9A-1168-4101-9DD8-C30FB252D435}.Debug|x64.Build.0 = Debug|x64 + {C0334F9A-1168-4101-9DD8-C30FB252D435}.Release|x64.ActiveCfg = Release|x64 + {C0334F9A-1168-4101-9DD8-C30FB252D435}.Release|x64.Build.0 = Release|x64 + {EC8B7909-62AF-470D-A75D-E1D89C837142}.Debug|x64.ActiveCfg = Debug|x64 + {EC8B7909-62AF-470D-A75D-E1D89C837142}.Debug|x64.Build.0 = Debug|x64 + {EC8B7909-62AF-470D-A75D-E1D89C837142}.Release|x64.ActiveCfg = Release|x64 + {EC8B7909-62AF-470D-A75D-E1D89C837142}.Release|x64.Build.0 = Release|x64 + {EF019874-D38A-40E3-B17C-DB5923F0A79C}.Debug|x64.ActiveCfg = Debug|x64 + {EF019874-D38A-40E3-B17C-DB5923F0A79C}.Debug|x64.Build.0 = Debug|x64 + {EF019874-D38A-40E3-B17C-DB5923F0A79C}.Release|x64.ActiveCfg = Release|x64 + {EF019874-D38A-40E3-B17C-DB5923F0A79C}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {2DE20FFA-6F5E-48D9-84D8-09B044A5B119} = {E131F77D-B713-48F3-B86D-097ECDCC4C3A} + {97ECC711-7430-4FC4-90FD-004DA880E72A} = {AD933CE2-1303-448E-89C8-60B1FDD18EC3} + {EF019874-D38A-40E3-B17C-DB5923F0A79C} = {E131F77D-B713-48F3-B86D-097ECDCC4C3A} + EndGlobalSection +EndGlobal diff --git a/V8Binding/v8/tools/visual_studio/v8_x64.vcproj b/V8Binding/v8/tools/visual_studio/v8_x64.vcproj new file mode 100644 index 0000000..cbf88c9 --- /dev/null +++ b/V8Binding/v8/tools/visual_studio/v8_x64.vcproj @@ -0,0 +1,223 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="v8" + ProjectGUID="{21E22961-22BF-4493-BD3A-868F93DA5179}" + RootNamespace="v8" + Keyword="Win32Proj" + > + <Platforms> + <Platform + Name="x64" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|x64" + ConfigurationType="4" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\debug.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + LinkLibraryDependencies="true" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|x64" + ConfigurationType="4" + InheritedPropertySheets=".\common.vsprops;.\x64.vsprops;.\release.vsprops" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLibrarianTool" + LinkLibraryDependencies="true" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="js" + > + <File + RelativePath="..\..\src\apinatives.js" + > + </File> + <File + RelativePath="..\..\src\array.js" + > + </File> + <File + RelativePath="..\..\src\date-delay.js" + > + </File> + <File + RelativePath="..\..\src\debug-delay.js" + > + </File> + <File + RelativePath="..\..\src\macros.py" + > + </File> + <File + RelativePath="..\..\src\math.js" + > + </File> + <File + RelativePath="..\..\src\messages.js" + > + </File> + <File + RelativePath="..\..\src\mirror-delay.js" + > + </File> + <File + RelativePath="..\..\src\regexp-delay.js" + > + </File> + <File + RelativePath="..\..\src\json-delay.js" + > + </File> + <File + RelativePath="..\..\src\runtime.js" + > + </File> + <File + RelativePath="..\..\src\string.js" + > + </File> + <File + RelativePath="..\..\src\uri.js" + > + </File> + <File + RelativePath="..\..\src\v8natives.js" + > + <FileConfiguration + Name="Debug|x64" + > + <Tool + Name="VCCustomBuildTool" + Description="Processing js files..." + CommandLine=".\js2c.cmd ..\..\src "$(IntDir)\DerivedSources"" + AdditionalDependencies="..\..\src\macros.py;..\..\src\runtime.js;..\..\src\v8natives.js;..\..\src\array.js;..\..\src\string.js;..\..\src\uri.js;..\..\src\math.js;..\..\src\messages.js;..\..\src\apinatives.js;..\..\src\debug-delay.js;..\..\src\mirror-delay.js;..\..\src\date-delay.js;..\..\src\regexp-delay.js;..\..\src\json-delay.js" + Outputs="$(IntDir)\DerivedSources\natives.cc;$(IntDir)\DerivedSources\natives-empty.cc" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|x64" + > + <Tool + Name="VCCustomBuildTool" + Description="Processing js files..." + CommandLine=".\js2c.cmd ..\..\src "$(IntDir)\DerivedSources"" + AdditionalDependencies="..\..\src\macros.py;..\..\src\runtime.js;..\..\src\v8natives.js;..\..\src\array.js;..\..\src\string.js;..\..\src\uri.js;..\..\src\math.js;..\..\src\messages.js;..\..\src\apinatives.js;..\..\src\debug-delay.js;..\..\src\mirror-delay.js;..\..\src\date-delay.js;..\..\src\regexp-delay.js;..\..\src\json-delay.js" + Outputs="$(IntDir)\DerivedSources\natives.cc;$(IntDir)\DerivedSources\natives-empty.cc" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="generated files" + > + <File + RelativePath="$(IntDir)\DerivedSources\natives.cc" + > + </File> + </Filter> + <File + RelativePath="..\..\src\snapshot-empty.cc" + > + </File> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/V8Binding/v8/tools/visual_studio/x64.vsprops b/V8Binding/v8/tools/visual_studio/x64.vsprops new file mode 100644 index 0000000..af0e47c --- /dev/null +++ b/V8Binding/v8/tools/visual_studio/x64.vsprops @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioPropertySheet + ProjectType="Visual C++" + Version="8.00" + Name="x64" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="V8_TARGET_ARCH_X64;V8_NATIVE_REGEXP" + /> +</VisualStudioPropertySheet> diff --git a/WEBKIT_MERGE_REVISION b/WEBKIT_MERGE_REVISION index 922fe2e..27dc5b3 100644 --- a/WEBKIT_MERGE_REVISION +++ b/WEBKIT_MERGE_REVISION @@ -2,4 +2,4 @@ We sync with Chromium release revision, which has both webkit revision and V8 re http://src.chromium.org/svn/branches/187/src@18043 http://svn.webkit.org/repository/webkit/trunk@47029 - http://v8.googlecode.com/svn/branches/bleeding_edge@2703 + http://v8.googlecode.com/svn/branches/bleeding_edge@2727 |