Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1956)

Delta Between Two Patch Sets: src/pkg/reflect/makefunc.go

Issue 6572043: code review 6572043: reflect: add ArrayOf, ChanOf, MapOf, SliceOf (Closed)
Left Patch Set: diff -r 0a3866d6cc6b https://code.google.com/p/go/ Created 11 years, 6 months ago
Right Patch Set: diff -r 6e9d872ffc66 https://code.google.com/p/go/ Created 11 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/reflect/export_test.go ('k') | src/pkg/reflect/type.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2012 The Go Authors. All rights reserved. 1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // MakeFunc implementation. 5 // MakeFunc implementation.
6 6
7 package reflect 7 package reflect
8 8
9 import ( 9 import (
10 "runtime" 10 "runtime"
11 "unsafe" 11 "unsafe"
12 ) 12 )
13 13
14 // makeFuncImpl is the closure value implementing the function 14 // makeFuncImpl is the closure value implementing the function
15 // returned by MakeFunc. 15 // returned by MakeFunc.
16 type makeFuncImpl struct { 16 type makeFuncImpl struct {
17 // References visible to the garbage collector. 17 // References visible to the garbage collector.
18 // The code array below contains the same references 18 // The code array below contains the same references
19 // embedded in the machine code. 19 // embedded in the machine code.
20 » typ *commonType 20 » typ *rtype
21 fn func([]Value) []Value 21 fn func([]Value) []Value
22 22
23 // code is the actual machine code invoked for the closure. 23 // code is the actual machine code invoked for the closure.
24 code [40]byte 24 code [40]byte
25 } 25 }
26 26
27 // MakeFunc returns a new function of the given Type 27 // MakeFunc returns a new function of the given Type
28 // that wraps the function fn. When called, that new function 28 // that wraps the function fn. When called, that new function
29 // does the following: 29 // does the following:
30 // 30 //
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 148
149 // armCallStub is the MakeFunc code template for arm machines. 149 // armCallStub is the MakeFunc code template for arm machines.
150 var armCallStub = []uintptr{ 150 var armCallStub = []uintptr{
151 0xe59f000c, // MOVW 0x14(PC), R0 151 0xe59f000c, // MOVW 0x14(PC), R0
152 0xe59f100c, // MOVW 0x14(PC), R1 152 0xe59f100c, // MOVW 0x14(PC), R1
153 0xe28d2004, // MOVW $4(SP), R2 153 0xe28d2004, // MOVW $4(SP), R2
154 0xe59ff008, // MOVW 0x10(PC), PC 154 0xe59ff008, // MOVW 0x10(PC), PC
155 0xeafffffe, // B 0(PC), just in case 155 0xeafffffe, // B 0(PC), just in case
156 } 156 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b