Revert "Revert "Upgrade to 5.0.71.48"" DO NOT MERGE
This reverts commit f2e3994fa5148cc3d9946666f0b0596290192b0e,
and updates the x64 makefile properly so it doesn't break that
build.
FPIIM-449
Change-Id: Ib83e35bfbae6af627451c926a9650ec57c045605
(cherry picked from commit 109988c7ccb6f3fd1a58574fa3dfb88beaef6632)
diff --git a/src/ic/ppc/handler-compiler-ppc.cc b/src/ic/ppc/handler-compiler-ppc.cc
index 8b48755..6e7d78a 100644
--- a/src/ic/ppc/handler-compiler-ppc.cc
+++ b/src/ic/ppc/handler-compiler-ppc.cc
@@ -4,8 +4,10 @@
#if V8_TARGET_ARCH_PPC
-#include "src/ic/call-optimization.h"
#include "src/ic/handler-compiler.h"
+
+#include "src/field-type.h"
+#include "src/ic/call-optimization.h"
#include "src/ic/ic.h"
#include "src/isolate-inl.h"
@@ -284,12 +286,17 @@
call_data_undefined = true;
__ LoadRoot(data, Heap::kUndefinedValueRootIndex);
} else {
- __ LoadP(data,
- FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset));
- __ LoadP(data,
- FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset));
- __ LoadP(data,
- FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset));
+ if (optimization.is_constant_call()) {
+ __ LoadP(data,
+ FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset));
+ __ LoadP(data,
+ FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset));
+ __ LoadP(data,
+ FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset));
+ } else {
+ __ LoadP(data,
+ FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset));
+ }
__ LoadP(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset));
}
@@ -308,7 +315,8 @@
__ mov(api_function_address, Operand(ref));
// Jump to stub.
- CallApiAccessorStub stub(isolate, is_store, call_data_undefined);
+ CallApiAccessorStub stub(isolate, is_store, call_data_undefined,
+ !optimization.is_constant_call());
__ TailCallStub(&stub);
}
@@ -393,8 +401,7 @@
__ bne(miss_label);
}
-
-void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type,
+void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type,
Register value_reg,
Label* miss_label) {
Register map_reg = scratch1();
@@ -402,20 +409,11 @@
DCHECK(!value_reg.is(map_reg));
DCHECK(!value_reg.is(scratch));
__ JumpIfSmi(value_reg, miss_label);
- HeapType::Iterator<Map> it = field_type->Classes();
- if (!it.Done()) {
+ if (field_type->IsClass()) {
__ LoadP(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset));
- Label do_store;
- while (true) {
- __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch);
- it.Advance();
- if (it.Done()) {
- __ bne(miss_label);
- break;
- }
- __ beq(&do_store);
- }
- __ bind(&do_store);
+ __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()),
+ scratch);
+ __ bne(miss_label);
}
}
@@ -592,38 +590,40 @@
void NamedLoadHandlerCompiler::GenerateLoadCallback(
- Register reg, Handle<ExecutableAccessorInfo> callback) {
- // Build AccessorInfo::args_ list on the stack and push property name below
- // the exit frame to make GC aware of them and store pointers to them.
- STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 0);
- STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 1);
- STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 2);
- STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 3);
- STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 4);
- STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 5);
- STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 6);
- DCHECK(!scratch2().is(reg));
- DCHECK(!scratch3().is(reg));
- DCHECK(!scratch4().is(reg));
+ Register reg, Handle<AccessorInfo> callback) {
+ DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), receiver()));
+ DCHECK(!AreAliased(scratch2(), scratch3(), scratch4(), reg));
+
+ // Build v8::PropertyCallbackInfo::args_ array on the stack and push property
+ // name below the exit frame to make GC aware of them.
+ STATIC_ASSERT(PropertyCallbackArguments::kShouldThrowOnErrorIndex == 0);
+ STATIC_ASSERT(PropertyCallbackArguments::kHolderIndex == 1);
+ STATIC_ASSERT(PropertyCallbackArguments::kIsolateIndex == 2);
+ STATIC_ASSERT(PropertyCallbackArguments::kReturnValueDefaultValueIndex == 3);
+ STATIC_ASSERT(PropertyCallbackArguments::kReturnValueOffset == 4);
+ STATIC_ASSERT(PropertyCallbackArguments::kDataIndex == 5);
+ STATIC_ASSERT(PropertyCallbackArguments::kThisIndex == 6);
+ STATIC_ASSERT(PropertyCallbackArguments::kArgsLength == 7);
+
__ push(receiver());
- // Push data from ExecutableAccessorInfo.
+ // Push data from AccessorInfo.
Handle<Object> data(callback->data(), isolate());
if (data->IsUndefined() || data->IsSmi()) {
- __ Move(scratch3(), data);
+ __ Move(scratch2(), data);
} else {
Handle<WeakCell> cell =
isolate()->factory()->NewWeakCell(Handle<HeapObject>::cast(data));
// The callback is alive if this instruction is executed,
// so the weak cell is not cleared and points to data.
- __ GetWeakValue(scratch3(), cell);
+ __ GetWeakValue(scratch2(), cell);
}
- __ push(scratch3());
- __ LoadRoot(scratch3(), Heap::kUndefinedValueRootIndex);
- __ mr(scratch4(), scratch3());
- __ Push(scratch3(), scratch4());
- __ mov(scratch4(), Operand(ExternalReference::isolate_address(isolate())));
- __ Push(scratch4(), reg);
- __ push(name());
+ __ push(scratch2());
+ __ LoadRoot(scratch2(), Heap::kUndefinedValueRootIndex);
+ __ Push(scratch2(), scratch2());
+ __ mov(scratch2(), Operand(ExternalReference::isolate_address(isolate())));
+ // should_throw_on_error -> false
+ __ mov(scratch3(), Operand(Smi::FromInt(0)));
+ __ Push(scratch2(), reg, scratch3(), name());
// Abi for CallApiGetter
Register getter_address_reg = ApiGetterDescriptor::function_address();
@@ -711,8 +711,8 @@
Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback(
- Handle<JSObject> object, Handle<Name> name,
- Handle<ExecutableAccessorInfo> callback) {
+ Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback,
+ LanguageMode language_mode) {
Register holder_reg = Frontend(name);
__ Push(receiver(), holder_reg); // receiver
@@ -728,6 +728,7 @@
__ push(ip);
__ mov(ip, Operand(name));
__ Push(ip, value());
+ __ Push(Smi::FromInt(language_mode));
// Do tail-call to the runtime system.
__ TailCallRuntime(Runtime::kStoreCallbackProperty);
@@ -776,7 +777,7 @@
}
Counters* counters = isolate()->counters();
- __ IncrementCounter(counters->named_load_global_stub(), 1, r4, r6);
+ __ IncrementCounter(counters->ic_named_load_global_stub(), 1, r4, r6);
if (IC::ICUseVector(kind())) {
DiscardVectorAndSlot();
}