Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Unified Diff: src/ia32/builtins-ia32.cc

Issue 6685088: Merge isolates to bleeding_edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/assembler-ia32-inl.h ('k') | src/ia32/codegen-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/builtins-ia32.cc
===================================================================
--- src/ia32/builtins-ia32.cc (revision 7267)
+++ src/ia32/builtins-ia32.cc (working copy)
@@ -100,8 +100,8 @@
// Set expected number of arguments to zero (not changing eax).
__ Set(ebx, Immediate(0));
__ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
- __ jmp(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
- RelocInfo::CODE_TARGET);
+ __ jmp(Handle<Code>(Isolate::Current()->builtins()->builtin(
+ ArgumentsAdaptorTrampoline)), RelocInfo::CODE_TARGET);
}
@@ -184,7 +184,7 @@
// ebx: JSObject
// edi: start of next object
__ mov(Operand(ebx, JSObject::kMapOffset), eax);
- __ mov(ecx, Factory::empty_fixed_array());
+ __ mov(ecx, FACTORY->empty_fixed_array());
__ mov(Operand(ebx, JSObject::kPropertiesOffset), ecx);
__ mov(Operand(ebx, JSObject::kElementsOffset), ecx);
// Set extra fields in the newly allocated object.
@@ -194,9 +194,9 @@
{ Label loop, entry;
// To allow for truncation.
if (count_constructions) {
- __ mov(edx, Factory::one_pointer_filler_map());
+ __ mov(edx, FACTORY->one_pointer_filler_map());
} else {
- __ mov(edx, Factory::undefined_value());
+ __ mov(edx, FACTORY->undefined_value());
}
__ lea(ecx, Operand(ebx, JSObject::kHeaderSize));
__ jmp(&entry);
@@ -252,7 +252,7 @@
// edi: FixedArray
// edx: number of elements
// ecx: start of next object
- __ mov(eax, Factory::fixed_array_map());
+ __ mov(eax, FACTORY->fixed_array_map());
__ mov(Operand(edi, FixedArray::kMapOffset), eax); // setup the map
__ SmiTag(edx);
__ mov(Operand(edi, FixedArray::kLengthOffset), edx); // and length
@@ -262,7 +262,7 @@
// edi: FixedArray
// ecx: start of next object
{ Label loop, entry;
- __ mov(edx, Factory::undefined_value());
+ __ mov(edx, FACTORY->undefined_value());
__ lea(eax, Operand(edi, FixedArray::kHeaderSize));
__ jmp(&entry);
__ bind(&loop);
@@ -335,7 +335,8 @@
if (is_api_function) {
__ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
Handle<Code> code = Handle<Code>(
- Builtins::builtin(Builtins::HandleApiCallConstruct));
+ Isolate::Current()->builtins()->builtin(
+ Builtins::HandleApiCallConstruct));
ParameterCount expected(0);
__ InvokeCode(code, expected, expected,
RelocInfo::CODE_TARGET, CALL_FUNCTION);
@@ -376,7 +377,7 @@
__ pop(ecx);
__ lea(esp, Operand(esp, ebx, times_2, 1 * kPointerSize)); // 1 ~ receiver
__ push(ecx);
- __ IncrementCounter(&Counters::constructed_objects, 1);
+ __ IncrementCounter(COUNTERS->constructed_objects(), 1);
__ ret(0);
}
@@ -436,8 +437,8 @@
// Invoke the code.
if (is_construct) {
- __ 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(eax);
__ InvokeFunction(edi, actual, CALL_FUNCTION);
@@ -566,7 +567,7 @@
__ test(eax, Operand(eax));
__ j(not_zero, &done, taken);
__ pop(ebx);
- __ push(Immediate(Factory::undefined_value()));
+ __ push(Immediate(FACTORY->undefined_value()));
__ push(ebx);
__ inc(eax);
__ bind(&done);
@@ -600,9 +601,9 @@
__ test(ebx, Immediate(kSmiTagMask));
__ j(zero, &convert_to_object);
- __ cmp(ebx, Factory::null_value());
+ __ cmp(ebx, FACTORY->null_value());
__ j(equal, &use_global_receiver);
- __ cmp(ebx, Factory::undefined_value());
+ __ cmp(ebx, FACTORY->undefined_value());
__ j(equal, &use_global_receiver);
// We don't use IsObjectJSObjectType here because we jump on success.
@@ -674,8 +675,8 @@
__ j(not_zero, &function, taken);
__ Set(ebx, Immediate(0));
__ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION);
- __ jmp(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
- RelocInfo::CODE_TARGET);
+ __ jmp(Handle<Code>(Isolate::Current()->builtins()->builtin(
+ ArgumentsAdaptorTrampoline)), RelocInfo::CODE_TARGET);
__ bind(&function);
}
@@ -688,7 +689,8 @@
__ mov(edx, FieldOperand(edi, JSFunction::kCodeEntryOffset));
__ SmiUntag(ebx);
__ cmp(eax, Operand(ebx));
- __ j(not_equal, Handle<Code>(builtin(ArgumentsAdaptorTrampoline)));
+ __ j(not_equal, Handle<Code>(Isolate::Current()->builtins()->builtin(
+ ArgumentsAdaptorTrampoline)));
ParameterCount expected(0);
__ InvokeCode(Operand(edx), expected, expected, JUMP_FUNCTION);
@@ -753,9 +755,9 @@
// Compute the receiver in non-strict mode.
__ test(ebx, Immediate(kSmiTagMask));
__ j(zero, &call_to_object);
- __ cmp(ebx, Factory::null_value());
+ __ cmp(ebx, FACTORY->null_value());
__ j(equal, &use_global_receiver);
- __ cmp(ebx, Factory::undefined_value());
+ __ cmp(ebx, FACTORY->undefined_value());
__ j(equal, &use_global_receiver);
// If given receiver is already a JavaScript object then there's no
@@ -795,7 +797,8 @@
__ mov(edx, Operand(ebp, 2 * kPointerSize)); // 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
@@ -867,7 +870,7 @@
// scratch2: start of next object
__ mov(FieldOperand(result, JSObject::kMapOffset), scratch1);
__ mov(FieldOperand(result, JSArray::kPropertiesOffset),
- Factory::empty_fixed_array());
+ FACTORY->empty_fixed_array());
// Field JSArray::kElementsOffset is initialized later.
__ mov(FieldOperand(result, JSArray::kLengthOffset), Immediate(0));
@@ -875,7 +878,7 @@
// fixed array.
if (initial_capacity == 0) {
__ mov(FieldOperand(result, JSArray::kElementsOffset),
- Factory::empty_fixed_array());
+ FACTORY->empty_fixed_array());
return;
}
@@ -892,7 +895,7 @@
// scratch1: elements array
// scratch2: start of next object
__ mov(FieldOperand(scratch1, FixedArray::kMapOffset),
- Factory::fixed_array_map());
+ FACTORY->fixed_array_map());
__ mov(FieldOperand(scratch1, FixedArray::kLengthOffset),
Immediate(Smi::FromInt(initial_capacity)));
@@ -903,7 +906,7 @@
if (initial_capacity <= kLoopUnfoldLimit) {
// Use a scratch register here to have only one reloc info when unfolding
// the loop.
- __ mov(scratch3, Factory::the_hole_value());
+ __ mov(scratch3, FACTORY->the_hole_value());
for (int i = 0; i < initial_capacity; i++) {
__ mov(FieldOperand(scratch1,
FixedArray::kHeaderSize + i * kPointerSize),
@@ -913,7 +916,7 @@
Label loop, entry;
__ jmp(&entry);
__ bind(&loop);
- __ mov(Operand(scratch1, 0), Factory::the_hole_value());
+ __ mov(Operand(scratch1, 0), FACTORY->the_hole_value());
__ add(Operand(scratch1), Immediate(kPointerSize));
__ bind(&entry);
__ cmp(scratch1, Operand(scratch2));
@@ -968,7 +971,7 @@
// elements_array_end: start of next object
// array_size: size of array (smi)
__ mov(FieldOperand(result, JSObject::kMapOffset), elements_array);
- __ mov(elements_array, Factory::empty_fixed_array());
+ __ mov(elements_array, FACTORY->empty_fixed_array());
__ mov(FieldOperand(result, JSArray::kPropertiesOffset), elements_array);
// Field JSArray::kElementsOffset is initialized later.
__ mov(FieldOperand(result, JSArray::kLengthOffset), array_size);
@@ -987,7 +990,7 @@
// elements_array_end: start of next object
// array_size: size of array (smi)
__ mov(FieldOperand(elements_array, FixedArray::kMapOffset),
- Factory::fixed_array_map());
+ FACTORY->fixed_array_map());
// For non-empty JSArrays the length of the FixedArray and the JSArray is the
// same.
__ mov(FieldOperand(elements_array, FixedArray::kLengthOffset), array_size);
@@ -999,7 +1002,7 @@
__ SmiUntag(array_size);
__ lea(edi, Operand(elements_array,
FixedArray::kHeaderSize - kHeapObjectTag));
- __ mov(eax, Factory::the_hole_value());
+ __ mov(eax, FACTORY->the_hole_value());
__ cld();
// Do not use rep stos when filling less than kRepStosThreshold
// words.
@@ -1063,7 +1066,7 @@
edi,
kPreallocatedArrayElements,
&prepare_generic_code_call);
- __ IncrementCounter(&Counters::array_function_native, 1);
+ __ IncrementCounter(COUNTERS->array_function_native(), 1);
__ pop(ebx);
if (construct_call) {
__ pop(edi);
@@ -1119,7 +1122,7 @@
edi,
true,
&prepare_generic_code_call);
- __ IncrementCounter(&Counters::array_function_native, 1);
+ __ IncrementCounter(COUNTERS->array_function_native(), 1);
__ mov(eax, ebx);
__ pop(ebx);
if (construct_call) {
@@ -1146,7 +1149,7 @@
edi,
false,
&prepare_generic_code_call);
- __ IncrementCounter(&Counters::array_function_native, 1);
+ __ IncrementCounter(COUNTERS->array_function_native(), 1);
__ mov(eax, ebx);
__ pop(ebx);
if (construct_call) {
@@ -1232,7 +1235,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);
__ jmp(array_code, RelocInfo::CODE_TARGET);
}
@@ -1266,7 +1270,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);
__ jmp(generic_construct_stub, RelocInfo::CODE_TARGET);
}
@@ -1280,7 +1285,7 @@
// -- esp[(argc - n) * 4] : arg[n] (zero-based)
// -- esp[(argc + 1) * 4] : receiver
// -----------------------------------
- __ IncrementCounter(&Counters::string_ctor_calls, 1);
+ __ IncrementCounter(COUNTERS->string_ctor_calls(), 1);
if (FLAG_debug_code) {
__ LoadGlobalFunction(Context::STRING_FUNCTION_INDEX, ecx);
@@ -1309,7 +1314,7 @@
edx, // Scratch 2.
false, // Input is known to be smi?
&not_cached);
- __ IncrementCounter(&Counters::string_ctor_cached_number, 1);
+ __ IncrementCounter(COUNTERS->string_ctor_cached_number(), 1);
__ bind(&argument_is_string);
// ----------- S t a t e -------------
// -- ebx : argument converted to string
@@ -1338,7 +1343,7 @@
__ mov(FieldOperand(eax, HeapObject::kMapOffset), ecx);
// Set properties and elements.
- __ Set(ecx, Immediate(Factory::empty_fixed_array()));
+ __ Set(ecx, Immediate(FACTORY->empty_fixed_array()));
__ mov(FieldOperand(eax, JSObject::kPropertiesOffset), ecx);
__ mov(FieldOperand(eax, JSObject::kElementsOffset), ecx);
@@ -1361,12 +1366,12 @@
Condition is_string = masm->IsObjectStringType(eax, ebx, ecx);
__ j(NegateCondition(is_string), &convert_argument);
__ mov(ebx, eax);
- __ IncrementCounter(&Counters::string_ctor_string_value, 1);
+ __ IncrementCounter(COUNTERS->string_ctor_string_value(), 1);
__ jmp(&argument_is_string);
// Invoke the conversion builtin and put the result into ebx.
__ bind(&convert_argument);
- __ IncrementCounter(&Counters::string_ctor_conversions, 1);
+ __ IncrementCounter(COUNTERS->string_ctor_conversions(), 1);
__ EnterInternalFrame();
__ push(edi); // Preserve the function.
__ push(eax);
@@ -1379,7 +1384,7 @@
// Load the empty string into ebx, remove the receiver from the
// stack, and jump back to the case where the argument is a string.
__ bind(&no_arguments);
- __ Set(ebx, Immediate(Factory::empty_string()));
+ __ Set(ebx, Immediate(FACTORY->empty_string()));
__ pop(ecx);
__ lea(esp, Operand(esp, kPointerSize));
__ push(ecx);
@@ -1388,7 +1393,7 @@
// At this point the argument is already a string. Call runtime to
// create a string wrapper.
__ bind(&gc_required);
- __ IncrementCounter(&Counters::string_ctor_gc_required, 1);
+ __ IncrementCounter(COUNTERS->string_ctor_gc_required(), 1);
__ EnterInternalFrame();
__ push(ebx);
__ CallRuntime(Runtime::kNewStringWrapper, 1);
@@ -1439,7 +1444,7 @@
// -----------------------------------
Label invoke, dont_adapt_arguments;
- __ IncrementCounter(&Counters::arguments_adaptors, 1);
+ __ IncrementCounter(COUNTERS->arguments_adaptors(), 1);
Label enough, too_few;
__ cmp(eax, Operand(ebx));
@@ -1487,7 +1492,7 @@
Label fill;
__ bind(&fill);
__ inc(ecx);
- __ push(Immediate(Factory::undefined_value()));
+ __ push(Immediate(FACTORY->undefined_value()));
__ cmp(ecx, Operand(ebx));
__ j(less, &fill);
@@ -1515,8 +1520,9 @@
// We shouldn't be performing on-stack replacement in the first
// place if the CPU features we need for the optimized Crankshaft
// code aren't supported.
- CpuFeatures::Probe(false);
- if (!CpuFeatures::IsSupported(SSE2)) {
+ CpuFeatures* cpu_features = Isolate::Current()->cpu_features();
+ cpu_features->Probe(false);
+ if (!cpu_features->IsSupported(SSE2)) {
__ Abort("Unreachable code: Cannot optimize without SSE2 support.");
return;
}
« no previous file with comments | « src/ia32/assembler-ia32-inl.h ('k') | src/ia32/codegen-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698