OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/bailout-reason.h" | 7 #include "src/bailout-reason.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/field-index.h" | 9 #include "src/field-index.h" |
10 #include "src/hydrogen.h" | 10 #include "src/hydrogen.h" |
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 Add<HConstant>(factory->empty_fixed_array()); | 1559 Add<HConstant>(factory->empty_fixed_array()); |
1560 HValue* shared_info = GetParameter(0); | 1560 HValue* shared_info = GetParameter(0); |
1561 | 1561 |
1562 AddIncrementCounter(counters->fast_new_closure_total()); | 1562 AddIncrementCounter(counters->fast_new_closure_total()); |
1563 | 1563 |
1564 // Create a new closure from the given function info in new space | 1564 // Create a new closure from the given function info in new space |
1565 HValue* size = Add<HConstant>(JSFunction::kSize); | 1565 HValue* size = Add<HConstant>(JSFunction::kSize); |
1566 HInstruction* js_function = | 1566 HInstruction* js_function = |
1567 Add<HAllocate>(size, HType::JSObject(), NOT_TENURED, JS_FUNCTION_TYPE); | 1567 Add<HAllocate>(size, HType::JSObject(), NOT_TENURED, JS_FUNCTION_TYPE); |
1568 | 1568 |
1569 int map_index = Context::FunctionMapIndex(casted_stub()->strict_mode(), | 1569 int map_index = Context::FunctionMapIndex(casted_stub()->language_mode(), |
1570 casted_stub()->kind()); | 1570 casted_stub()->kind()); |
1571 | 1571 |
1572 // Compute the function map in the current native context and set that | 1572 // Compute the function map in the current native context and set that |
1573 // as the map of the allocated object. | 1573 // as the map of the allocated object. |
1574 HInstruction* native_context = BuildGetNativeContext(); | 1574 HInstruction* native_context = BuildGetNativeContext(); |
1575 HInstruction* map_slot_value = Add<HLoadNamedField>( | 1575 HInstruction* map_slot_value = Add<HLoadNamedField>( |
1576 native_context, nullptr, HObjectAccess::ForContextSlot(map_index)); | 1576 native_context, nullptr, HObjectAccess::ForContextSlot(map_index)); |
1577 Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value); | 1577 Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value); |
1578 | 1578 |
1579 // Initialize the rest of the function. | 1579 // Initialize the rest of the function. |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2226 // megamorphic case is handled as part of the default stub. | 2226 // megamorphic case is handled as part of the default stub. |
2227 DCHECK(!FLAG_vector_ics); | 2227 DCHECK(!FLAG_vector_ics); |
2228 | 2228 |
2229 // Probe the stub cache. | 2229 // Probe the stub cache. |
2230 Add<HTailCallThroughMegamorphicCache>(receiver, name); | 2230 Add<HTailCallThroughMegamorphicCache>(receiver, name); |
2231 | 2231 |
2232 // We never continue. | 2232 // We never continue. |
2233 return graph()->GetConstant0(); | 2233 return graph()->GetConstant0(); |
2234 } | 2234 } |
2235 } } // namespace v8::internal | 2235 } } // namespace v8::internal |
OLD | NEW |