| Index: src/x64/builtins-x64.cc
|
| ===================================================================
|
| --- src/x64/builtins-x64.cc (revision 7267)
|
| +++ src/x64/builtins-x64.cc (working copy)
|
| @@ -98,8 +98,8 @@
|
| // Set expected number of arguments to zero (not changing rax).
|
| __ movq(rbx, Immediate(0));
|
| __ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
|
| - __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
|
| - RelocInfo::CODE_TARGET);
|
| + __ Jump(Handle<Code>(Isolate::Current()->builtins()->builtin(
|
| + ArgumentsAdaptorTrampoline)), RelocInfo::CODE_TARGET);
|
| }
|
|
|
|
|
| @@ -339,8 +339,8 @@
|
| // Call the function.
|
| if (is_api_function) {
|
| __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
|
| - Handle<Code> code = Handle<Code>(
|
| - Builtins::builtin(Builtins::HandleApiCallConstruct));
|
| + Handle<Code> code = Handle<Code>(Isolate::Current()->builtins()->builtin(
|
| + Builtins::HandleApiCallConstruct));
|
| ParameterCount expected(0);
|
| __ InvokeCode(code, expected, expected,
|
| RelocInfo::CODE_TARGET, CALL_FUNCTION);
|
| @@ -379,7 +379,7 @@
|
| SmiIndex index = masm->SmiToIndex(rbx, rbx, kPointerSizeLog2);
|
| __ lea(rsp, Operand(rsp, index.reg, index.scale, 1 * kPointerSize));
|
| __ push(rcx);
|
| - __ IncrementCounter(&Counters::constructed_objects, 1);
|
| + __ IncrementCounter(COUNTERS->constructed_objects(), 1);
|
| __ ret(0);
|
| }
|
|
|
| @@ -492,8 +492,8 @@
|
| // Invoke the code.
|
| if (is_construct) {
|
| // Expects rdi to hold function pointer.
|
| - __ Call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)),
|
| - RelocInfo::CODE_TARGET);
|
| + __ Call(Handle<Code>(Isolate::Current()->builtins()->builtin(
|
| + Builtins::JSConstructCall)), RelocInfo::CODE_TARGET);
|
| } else {
|
| ParameterCount actual(rax);
|
| // Function must be in rdi.
|
| @@ -630,7 +630,7 @@
|
| __ testq(rax, rax);
|
| __ j(not_zero, &done);
|
| __ pop(rbx);
|
| - __ Push(Factory::undefined_value());
|
| + __ Push(FACTORY->undefined_value());
|
| __ push(rbx);
|
| __ incq(rax);
|
| __ bind(&done);
|
| @@ -733,8 +733,8 @@
|
| __ j(not_zero, &function);
|
| __ Set(rbx, 0);
|
| __ GetBuiltinEntry(rdx, Builtins::CALL_NON_FUNCTION);
|
| - __ Jump(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
|
| - RelocInfo::CODE_TARGET);
|
| + __ Jump(Handle<Code>(Isolate::Current()->builtins()->builtin(
|
| + ArgumentsAdaptorTrampoline)), RelocInfo::CODE_TARGET);
|
| __ bind(&function);
|
| }
|
|
|
| @@ -748,8 +748,8 @@
|
| __ movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
|
| __ cmpq(rax, rbx);
|
| __ j(not_equal,
|
| - Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
|
| - RelocInfo::CODE_TARGET);
|
| + Handle<Code>(Isolate::Current()->builtins()->builtin(
|
| + ArgumentsAdaptorTrampoline)), RelocInfo::CODE_TARGET);
|
|
|
| ParameterCount expected(0);
|
| __ InvokeCode(rdx, expected, expected, JUMP_FUNCTION);
|
| @@ -863,7 +863,8 @@
|
| __ movq(rdx, Operand(rbp, kArgumentsOffset)); // load arguments
|
|
|
| // Use inline caching to speed up access to arguments.
|
| - Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
|
| + Handle<Code> ic(Isolate::Current()->builtins()->builtin(
|
| + Builtins::KeyedLoadIC_Initialize));
|
| __ Call(ic, RelocInfo::CODE_TARGET);
|
| // It is important that we do not have a test instruction after the
|
| // call. A test instruction after the call is used to indicate that
|
| @@ -935,7 +936,7 @@
|
| // scratch2: start of next object
|
| __ movq(FieldOperand(result, JSObject::kMapOffset), scratch1);
|
| __ Move(FieldOperand(result, JSArray::kPropertiesOffset),
|
| - Factory::empty_fixed_array());
|
| + FACTORY->empty_fixed_array());
|
| // Field JSArray::kElementsOffset is initialized later.
|
| __ Move(FieldOperand(result, JSArray::kLengthOffset), Smi::FromInt(0));
|
|
|
| @@ -943,7 +944,7 @@
|
| // fixed array.
|
| if (initial_capacity == 0) {
|
| __ Move(FieldOperand(result, JSArray::kElementsOffset),
|
| - Factory::empty_fixed_array());
|
| + FACTORY->empty_fixed_array());
|
| return;
|
| }
|
|
|
| @@ -960,7 +961,7 @@
|
| // scratch1: elements array
|
| // scratch2: start of next object
|
| __ Move(FieldOperand(scratch1, HeapObject::kMapOffset),
|
| - Factory::fixed_array_map());
|
| + FACTORY->fixed_array_map());
|
| __ Move(FieldOperand(scratch1, FixedArray::kLengthOffset),
|
| Smi::FromInt(initial_capacity));
|
|
|
| @@ -968,7 +969,7 @@
|
| // Reconsider loop unfolding if kPreallocatedArrayElements gets changed.
|
| static const int kLoopUnfoldLimit = 4;
|
| ASSERT(kPreallocatedArrayElements <= kLoopUnfoldLimit);
|
| - __ Move(scratch3, Factory::the_hole_value());
|
| + __ Move(scratch3, FACTORY->the_hole_value());
|
| if (initial_capacity <= kLoopUnfoldLimit) {
|
| // Use a scratch register here to have only one reloc info when unfolding
|
| // the loop.
|
| @@ -1052,7 +1053,7 @@
|
| // array_size: size of array (smi)
|
| __ bind(&allocated);
|
| __ movq(FieldOperand(result, JSObject::kMapOffset), elements_array);
|
| - __ Move(elements_array, Factory::empty_fixed_array());
|
| + __ Move(elements_array, FACTORY->empty_fixed_array());
|
| __ movq(FieldOperand(result, JSArray::kPropertiesOffset), elements_array);
|
| // Field JSArray::kElementsOffset is initialized later.
|
| __ movq(FieldOperand(result, JSArray::kLengthOffset), array_size);
|
| @@ -1071,7 +1072,7 @@
|
| // elements_array_end: start of next object
|
| // array_size: size of array (smi)
|
| __ Move(FieldOperand(elements_array, JSObject::kMapOffset),
|
| - Factory::fixed_array_map());
|
| + FACTORY->fixed_array_map());
|
| Label not_empty_2, fill_array;
|
| __ SmiTest(array_size);
|
| __ j(not_zero, ¬_empty_2);
|
| @@ -1092,7 +1093,7 @@
|
| __ bind(&fill_array);
|
| if (fill_with_hole) {
|
| Label loop, entry;
|
| - __ Move(scratch, Factory::the_hole_value());
|
| + __ Move(scratch, FACTORY->the_hole_value());
|
| __ lea(elements_array, Operand(elements_array,
|
| FixedArray::kHeaderSize - kHeapObjectTag));
|
| __ jmp(&entry);
|
| @@ -1137,7 +1138,7 @@
|
| r8,
|
| kPreallocatedArrayElements,
|
| call_generic_code);
|
| - __ IncrementCounter(&Counters::array_function_native, 1);
|
| + __ IncrementCounter(COUNTERS->array_function_native(), 1);
|
| __ movq(rax, rbx);
|
| __ ret(kPointerSize);
|
|
|
| @@ -1168,7 +1169,7 @@
|
| r9,
|
| true,
|
| call_generic_code);
|
| - __ IncrementCounter(&Counters::array_function_native, 1);
|
| + __ IncrementCounter(COUNTERS->array_function_native(), 1);
|
| __ movq(rax, rbx);
|
| __ ret(2 * kPointerSize);
|
|
|
| @@ -1190,7 +1191,7 @@
|
| r9,
|
| false,
|
| call_generic_code);
|
| - __ IncrementCounter(&Counters::array_function_native, 1);
|
| + __ IncrementCounter(COUNTERS->array_function_native(), 1);
|
|
|
| // rax: argc
|
| // rbx: JSArray
|
| @@ -1264,7 +1265,8 @@
|
| // Jump to the generic array code in case the specialized code cannot handle
|
| // the construction.
|
| __ bind(&generic_array_code);
|
| - Code* code = Builtins::builtin(Builtins::ArrayCodeGeneric);
|
| + Code* code = Isolate::Current()->builtins()->builtin(
|
| + Builtins::ArrayCodeGeneric);
|
| Handle<Code> array_code(code);
|
| __ Jump(array_code, RelocInfo::CODE_TARGET);
|
| }
|
| @@ -1298,7 +1300,8 @@
|
| // Jump to the generic construct code in case the specialized code cannot
|
| // handle the construction.
|
| __ bind(&generic_constructor);
|
| - Code* code = Builtins::builtin(Builtins::JSConstructStubGeneric);
|
| + Code* code = Isolate::Current()->builtins()->builtin(
|
| + Builtins::JSConstructStubGeneric);
|
| Handle<Code> generic_construct_stub(code);
|
| __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET);
|
| }
|
| @@ -1353,7 +1356,7 @@
|
| // -----------------------------------
|
|
|
| Label invoke, dont_adapt_arguments;
|
| - __ IncrementCounter(&Counters::arguments_adaptors, 1);
|
| + __ IncrementCounter(COUNTERS->arguments_adaptors(), 1);
|
|
|
| Label enough, too_few;
|
| __ cmpq(rax, rbx);
|
|
|